Closed
Description
Describe the bug
When produces
is not defined at a Controller method level, the Controller class level one is used instead.
Say
@RequestMapping(value = "/api/v1/addresses", produces = APPLICATION_JSON_VALUE)
@RestController
public class AddressResource {
@GetMapping
public AddressDto getAddress(@PathVariable String id) {
...
I would expect Spring to produce json for this method.
However, Springdoc has, instead of inherited the parent, it has merged class and method (choosing a default for the method - MediaTypes.ALL).
Resulting in
content": {
"*/*": {
"schema": {
"$ref": "#/components/schemas/AddressDto"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/AddressDto"
}
}
}
To Reproduce
Steps to reproduce the behavior:
-
What version of spring-boot you are using?
2.2.4-RELEASE -
What modules and versions of springdoc-openapi are you using?
1.2.30, no additional modules (ui, common, webmvccore)
Expected behavior
I would expect only json as a result, not ALL + json.