Open ckoegel opened 9 months ago
Same here, but according to the https://swagger.io/docs/specification/serialization/ explode: true for the deepObject is n/a. However it seems that e.g. github.com/go-openapi/runtime/middleware explodes deepObject by default. So probably the best is to handle that in the web app.
Q&A (please complete the following information)
Content & configuration
Example Swagger/OpenAPI definition:
Describe the bug you're encountering
According to the Official Swagger Docs, when a query parameter is defined with the style
deepObject
and has the explode field set totrue
, each property of the object is expanded into its own query parameter as such:paramName[property]=value
. When using the combination ofdeepObject
andexplode: true
for a parameter and viewing it in the Swagger Editor, the example for the parameter shows as an object in the formparamName={property: value}
instead of the exploded form. In the example spec provided above, thefirstName
parameter is defined as adeepObject
with explode set totrue
. Instead of each property being their own parameter, the example shows one singlefirstName
object as a query parameter, and using theTry it out
function sends the request using the unexploded form. This happens for both v3.0.3 and v3.1.0 of OAS.To reproduce...
Steps to reproduce the behavior:
Try it out
feature in the right panel for thelistCustomers
endpointExpected behavior
The editor should render the provided example as a series of exploded query parameters and the
Try it out
request should use the exploded form instead of object form for the provided properties.Additional context or thoughts
This is in the alpha version of the editor, so there may be plans to support this in the future I'm unaware of