Query Parameter Serialization using content field
#5158
-
|
How parameter serialization should work given this schema: openapi: 3.1.0
info:
title:
version:
paths:
/test:
get:
parameters:
- in: query
name: pet
content:
application/json:
schema:
type: stringIn case we want specify string value 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. |
Beta Was this translation helpful? Give feedback.
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.

..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?