Style serialization/deserialization with multipart/form-data is not described well #5406
karenetheridge
started this conversation in
General
Replies: 1 comment 1 reply
-
|
I did some archaeology:
cc @mkistler as his name is all over these issues |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
In Appendix C:
Okay, so that would seem to suggest that a simple object e.g.
{ "a": 1, "b": 2 }should be serialized to this multipart body (where the message's Content-Type ismultipart/form-data; boundary="4aKOX"):How is that to be expressed in the OAD? We cannot say "use style=form for the entire object", because
encodingdescribes individual properties, not an object as a whole:And what is the point of using
stylehere at all, if&and=can't be used to combine multiple values, and percent encoding isn't done? A part's string value will always just deserialize to itself usingformstyle; it's an identity function, so I don't see how it could ever be useful to include it.Similarly, how would style=deepObject work here? If I have this multipart body:
..how does that deserialize? I've just created two separate objects:
{"x": 1}and{"y": 2}. Now what?I think the spec wording quoted above is trying to say that all parts must be considered together and parsed as an array or object, but then there is nowhere to put the
encodinginformation for that structure.Some understanding of how
stylecame to be used here would be helpful, because I don't see how any of this makes sense at all. I see that the addition ofstylefor multipart/form-data was introduced for 3.1 (3.0.4 restricts style to justapplication/x-www-form-urlencoded, which makes more sense, as it is a single string being composed of several values, concatenated by&, just like the URI query string).Beta Was this translation helpful? Give feedback.
All reactions