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
The OpenAPI 3.0 specification provides the ability to specify a parameter serialization style for objects, but I can't find a way to implement the "style": "deepObject" option when defining a parameter that's an object.
For example, the JSON-API specification indicates that sparse fieldset and pagination parameters should be sent in the following format:
/api/v1/examples?page[number]=1&page[size]=25
In order to accomplish this, I would define a parameter like this:
# @parameter page [object<number:integer,size:integer>] Sets the current page and the page size
When I run that through SwaggerYard, the parameter structure that shows up in the JSON file looks like this:
{
"name": "page",
"description": "Sets the current page and the page size",
"required": false,
"in": "query",
"schema": {
"type": "object",
"properties": {
"number": {
"type": "integer"
},
"size": {
"type": "integer"
}
}
}
}
In order for Swagger UI to serialize the object in the format that's necessary, I need to be able to specify the "style": "deepObject" option for the parameter above, but I don't see anything in the SwaggerYard documentation that would allow me to do it.
Is there a way for me to specify this option? Thanks for your help.
The text was updated successfully, but these errors were encountered:
Looks like I missed that option when adding OpenAPI 3 support recently. Would you mind submitting a PR? The relevant area would probably be here in the OpenAPI class. Is that an option that needs to have configuration, or can we get by always setting "style": "deepObject" when the schema type for a parameter has properties?
It looks like there are 4 possible values for the style option. Can you let me know if there’s a specific way you’d like the options handled. I’ll submit a PR early next week. Thanks.
The OpenAPI 3.0 specification provides the ability to specify a parameter serialization style for objects, but I can't find a way to implement the
"style": "deepObject"
option when defining a parameter that's anobject
.For example, the JSON-API specification indicates that sparse fieldset and pagination parameters should be sent in the following format:
In order to accomplish this, I would define a parameter like this:
When I run that through SwaggerYard, the parameter structure that shows up in the JSON file looks like this:
In order for Swagger UI to serialize the object in the format that's necessary, I need to be able to specify the
"style": "deepObject"
option for the parameter above, but I don't see anything in the SwaggerYard documentation that would allow me to do it.Is there a way for me to specify this option? Thanks for your help.
The text was updated successfully, but these errors were encountered: