Closed
Description
@GetMapping("test")
public void getWithRequestBody(@RequestBody MyClass myClass) {
}
This results in a definition where myClass
parameter is defined to appear "in": "query"
. Correct behavior would be a requestBody
block with $ref schema.
Neither org.springframework.web.bind.annotation.RequestBody
nor io.swagger.v3.oas.annotations.parameters.RequestBody
work.
Actual
"/test": {
"get": {
"tags": [
"test-controller"
],
"operationId": "TestController.getWithRequestBody",
"parameters": [
{
"name": "myClass",
"in": "query",
"required": true,
"schema": {
"$ref": "#/components/schemas/MyClass"
}
}
],
"responses": {
"200": {
"description": "OK"
}
}
}
}
Expected part
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/MyClass"
}
}
},
"required": true
}
It would be nice if a fix could be backported to the 1.8.x release 🙏.