Set default content type for problem details object to application/problem+json
#2963
Labels
enhancement
New feature or request
Is your feature request related to a problem? Please describe.
By default Spring sets the content type of responses returned with the
ProblemDetail
objectto
application/problem+json
correctly according to the RFC.Unfortunately, Springdoc sets these endpoints as they return the
defaultProducesMediaType
(springdoc.default-produces-media-type
) too.Spring configuration:
Example exception handler:
Endpoint response:
Generated yaml (relevant part):
Describe the solution you'd like
I would like to Springdoc also set the content type for these methods automatically to
application/problem+json
by default, regardless of thedefaultProducesMediaType
.Describe alternatives you've considered
@ApiResponse
:ExceptionHandler
.Additional context
ExceptionHandler.produces
values for generation.The text was updated successfully, but these errors were encountered: