You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
openapi: 3.0.3info:
title: Customers APIversion: 1.0.0servers:
- url: 'https://api.customers.com/'description: Productionpaths:
/customers:
get:
summary: List All CustomersoperationId: listCustomersdescription: This operation returns a list of all customers.tags:
- Customersparameters:
- $ref: '#/components/parameters/firstName'responses:
'200':
description: OKcomponents:
schemas:
nameQueryParameter:
title: Name Query Parameterdescription: Base model for a name query parameter.properties:
eq:
type: stringne:
type: stringregex:
type: stringcontains:
type: stringsort:
$ref: '#/components/schemas/sort'example:
ne: 'David'contains: 'Da'sort: ASCsort:
type: stringenum:
- ASC
- DESCparameters:
firstName:
name: firstNamein: querydescription: Sorting and filtering parameters for `firstName`.style: deepObjectexplode: trueschema:
$ref: '#/components/schemas/nameQueryParameter'securitySchemes:
Token:
type: httpscheme: bearerbearerFormat: JWTsecurity:
- Token: []tags:
- name: Customers
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 to true, each property of the object is expanded into its own query parameter as such: paramName[property]=value. When using the combination of deepObject and explode: true for a parameter and viewing it in the Swagger Editor, the example for the parameter shows as an object in the form paramName={property: value} instead of the exploded form. In the example spec provided above, the firstName parameter is defined as a deepObject with explode set to true. Instead of each property being their own parameter, the example shows one single firstName object as a query parameter, and using the Try it out function sends the request using the unexploded form. This happens for both v3.0.3 and v3.1.0 of OAS.
Refer to the example or Try it out feature in the right panel for the listCustomers endpoint
Expected 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
The text was updated successfully, but these errors were encountered:
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
The text was updated successfully, but these errors were encountered: