springdoc-openapi
springdoc-openapi copied to clipboard
Change so useReturnTypeSchema is considered on an http code level
Fixes #3137
The issue reported stem from the fact the the useReturnTypeSchema currently is considered on a method level rather than on an http code level. This means that if several @ApiResponse are defined, then the last annotation determines whether the useReturnTypeSchema is triggered or not. This will then in turn lead to either all responses calculating the response type or none or them.
This change allows the definition to be tied to individual http code definitions, so that for example only the 200 response derives its response type, while any 4xx or 5xx definition can retain strictly an explicit schema implementation.