Query Parameter Serialization using content field
#5158
Unanswered
valerii15298
asked this question in
Q&A
Replies: 1 comment 1 reply
-
..is correct. JSON-encoded strings have double quotes around them, and then those characters are url-encoded to %22. Does the swagger editor properly encode other JSON values, e.g. objects and arrays? |
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.
Uh oh!
There was an error while loading. Please reload this page.
-
How parameter serialization should work given this schema:
In case we want specify string value
catfor thepetparameter.Since
petis defined usingapplication/jsonI expect the serialized url query string to look like this(with quotes percent encoded since the correct json representation for string should be with double quotes"cat"):and NOT like this:
Is my assumption correct?
Looking at https://spec.openapis.org/oas/latest.html#parameter-object-examples there is this example which I was looking at which seems logical:

The confusion for me is that swagger editor does not include quotes so it seems like the violation of the spec. And I am building similar UI tool, so I want to better understand how to implement parameter serialization which is one of the most complicated things to do with abnormal amount of edge cases and multiple specs involved.
I created issue on their side: swagger-api/swagger-ui#10661
Beta Was this translation helpful? Give feedback.
All reactions