You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
By default Spring sets the content type of responses returned with the ProblemDetail object
to application/problem+json correctly according to the RFC.
Unfortunately, Springdoc sets these endpoints as they return the defaultProducesMediaType (springdoc.default-produces-media-type) too.
'400':
description: Bad Requestcontent:
application/json:
schema:
$ref: '#/components/schemas/ProblemDetail'
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 the defaultProducesMediaType.
Describe alternatives you've considered
Setting the produces type on exception handler (supported since Spring Framework 6.2):
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: