Swagger UI query parameters array of custom object get request
See original GitHub issueI have a customer array object in my get request with below query parameter
{
"name": "filters",
"in": "query",
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/ColumnFilter"
}
}
}
schema of custom object is:
"ColumnFilter": {
"type": "object",
"properties": {
"column": {
"type": "string",
"nullable": true
},
"value": {
"type": "string",
"nullable": true
}
}
I swagger UI what should i pass as value for this custom object below manual url works for me: https://localhost:8989/…?filters[0].Column=Site ID&filters[0].Value=Site_1
when i mention the below values in swagger UI for filters (array[objec]) column=“Horizontal Beamwidth”&value=“100” it is generating the below invalid url https://localhost:8989/…?filters=column%3D%22Horizontal%20Beamwidth%22%26value%3D%22100%22
What should i enter in the swagger UI to generate a valid query parameter?
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Parameter Serialization - Swagger
OpenAPI 3.0 supports arrays and objects in operation parameters (path, query, header, and cookie) and lets you specify how these parameters should be ......
Read more >Use object type query param in swagger documentation
The request query param having an object value would be encoded in an actual request. Even though swagger shows an error at the...
Read more >How to pass array of objects using query string in SwaggerUI
Operator=Equal&filter... it works properly but when i use SwaggerUI 2019-04-11 16_09_09-Swagger UI.png it bind empty model and pass query ...
Read more >OpenAPI Specification v3.1.0 | Introduction, Definitions, & More
servers, [Server Object], An array of Server Objects, ... the query parameter is id . header - Custom headers that are expected as...
Read more >Types and Parameters - OpenAPI - Documentation | NestJS
The SwaggerModule searches for all @Body() , @Query() , and @Param() ... the @ApiProperty() decorator allows setting various Schema Object properties:
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@dsr301 This is a limitation of the OpenAPI Specification (not Swagger UI) - currently it does not provide a way to serialize an array of objects into a query string like
?filters[0].Column=Site ID&filters[0].Value=Site_1
. There’s an existing feature request to support this serialization method as part of thedeepObject
style: https://github.com/OAI/OpenAPI-Specification/issues/1706.So… is there a workaround for this at all. Can I use swagger without OpenAPI… this is a pretty big limitation to swagger-ui.