-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
createAttachmentOrder with meta #282
Comments
This comment has been minimized.
This comment has been minimized.
The suggested implementation does not work... if working with multipart you cannot pass dictionaries |
You mean dictionaries as values? I didn't, I used a string. |
yes, but on the server-side you'll not be able to de-serialize them automatically, so no good to pass JSON.dumps |
You need to use something like meta in the order POST... and still the multi-part issue with strings (in the SDK) would have to be fixed |
@gcandal let's also create some unit tests to avoid regression for this mixed types multipart situation |
Requires hivesolutions/appier#47 |
Rationale
The creation of order attachments expects a file and a
meta
dictionary (see https://github.com/ripe-tech/ripe-core/blob/ba23882efa65acb165e924c6f836c6933646604f/src/ripe_core/controllers/api/order.py#L97).However, the current SDK implementation of the endpoint doesn't support
meta
(seeripe-sdk/src/js/api/order.js
Line 201 in c9e7b8a
Description
The implementation of the rationale above could probably be similar to:
But unless I'm missing something obvious, ripe-sdk doesn't support strings as values when using a multipart payload
dataM
(seeripe-sdk/src/js/base/api.js
Line 1238 in c9e7b8a
Trying to use them results in
RangeError: offset is out of bounds
because the string is not being encoded, resulting in this:Related: https://github.com/ripe-tech/ripe-core/pull/4564
The text was updated successfully, but these errors were encountered: