PUT method (addressing_mode=0) expects extra_data be populated as if it was addressing_mode=2 #29

Closed
opened 2025-04-30 23:20:16 +00:00 by stanislav.hejny · 1 comment
Member

Ref epic: CleverSwarm Onboarding #58

while testing update function of CleverSwarm integration, using test benchmark command:
python benchmark_client.py --detailed --username user --ontologies_ids 1 10 --server_url http://127.0.0.1:8080/api/v0 --token abcd, the update method fails with the dictionary key error for key value 'unstructured'.

Reason is that the PUT request is provided by Java adapter as DataMessage with addressing_mode=0 (meaning the DataMessage body contains the actual request payload, in this case entire multipart/form-data content), while the handler method assumes addressing_mode=2 (uploaded files are transmitted separately from the DataMessage).

Because the actual files are encoded in the multipart message itself rather than sent via separate queue, while the handler still expects the extra_data dictionary, associated with addressing_mode=2, to have reference to temp file, in order to build UploadedFile class instance. However in the addressing_mode=0, the arg value already IS UploadedFile instance and needs not a conversion (and the extra_data dictionary, capturing the separate file uploads, is empty, because there are no separate queue file uploads.

Ref epic: [CleverSwarm Onboarding #58](https://git.cleverthis.com/clevermicro/clevermicro/issues/58) while testing update function of CleverSwarm integration, using test benchmark command: `python benchmark_client.py --detailed --username user --ontologies_ids 1 10 --server_url http://127.0.0.1:8080/api/v0 --token abcd`, the update method fails with the dictionary key error for key value 'unstructured'. Reason is that the PUT request is provided by Java adapter as DataMessage with addressing_mode=0 (meaning the DataMessage body contains the actual request payload, in this case entire multipart/form-data content), while the handler method assumes addressing_mode=2 (uploaded files are transmitted separately from the DataMessage). Because the actual files are encoded in the multipart message itself rather than sent via separate queue, while the handler still expects the extra_data dictionary, associated with addressing_mode=2, to have reference to temp file, in order to build UploadedFile class instance. However in the addressing_mode=0, the arg value already IS UploadedFile instance and needs not a conversion (and the extra_data dictionary, capturing the separate file uploads, is empty, because there are no separate queue file uploads.
stanislav.hejny added the
Type
Bug
Points
1
State
In Progress
labels 2025-04-30 23:20:16 +00:00
Author
Member

fixed by PR #30, the reverts above is because accidentally an unrelated file was included to the PR.

fixed by PR #30, the reverts above is because accidentally an unrelated file was included to the PR.
stanislav.hejny added
State
Completed
Signed-off: Owner
and removed
State
In Progress
labels 2025-05-01 18:01:48 +00:00
stanislav.hejny self-assigned this 2025-06-15 07:30:20 +00:00
stanislav.hejny added this to the V.01 milestone 2025-06-15 07:30:24 +00:00
stanislav.hejny added this to the Sprint May 1st- 14th project 2025-06-15 07:30:28 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Blocks
You do not have permission to read 1 dependency
Reference: clevermicro/amq-adapter-python#29