-
-
Notifications
You must be signed in to change notification settings - Fork 553
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
springdoc-openapi-ui version: 1.3.9
In my spring web endpoint I have an object which summarise query params
To make it work properly, I see @ParameterObject was introduced in #505
It works for GET requests (@GetMapping) -> all properties of object are parsed as separate query parameters
@GetMapping("/test")
public void testGet(@ParameterObject QueryObject queryObject) {
}
@Getter
@Setter
public class QueryObject {
private String queryParam1;
private String queryParam2;
}
json:
"parameters": [
{
"name": "queryParam1",
"in": "query",
"required": false,
"schema": {
"type": "string"
}
},
{
"name": "queryParam2",
"in": "query",
"required": false,
"schema": {
"type": "string"
}
}
]
However I don't see this behaviour with POST requests
And object holding query params is parsed as BODY object
Example of my code
@PostMapping("/test")
public void testPost(@ParameterObject QueryObject queryObject) {
}
json:
"requestBody": {
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"queryParam1": {
"type": "string"
},
"queryParam2": {
"type": "string"
}
}
}
}
}
}
Expected behavior
Objects in POST endpoints annotated with @ParameterObject should behave the same way as for GET and all fields of this object are parsed as query params
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request

