Skip to content

When using RestControllerAdvice, one of the responses is missing and replaced with a default #440

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
edgeofoblivion opened this issue Feb 17, 2020 · 2 comments
Labels
bug Something isn't working

Comments

@edgeofoblivion
Copy link

edgeofoblivion commented Feb 17, 2020

Describe the bug
Empty default response is displayed instead of one described in exception handler.

implementation 'org.springdoc:springdoc-openapi-ui:1.2.30'

To Reproduce
demo.zip
See the attached spring boot example with a single controller and a RestControllerAdvice having 2 exception handling methods.
One of the methods from the RestControllerAdvice is displayed with MediaType all and the "default response" description.

Expected behavior
Each of the handled responses displayed as described in the annotations in the Advice along with that from the GreetingController

Screenshots
ControllerAdvice

Additional context
I also believe that one of those responses described in the controller advice will be replaced with the default (not always the same method). This can be seen when restarting the application and is particularly noticeable when many handler methods exist in the same class.
See screenshot following a restart - this time the 400 is incorrect and the 500 is as expected
ControllerAdvice2

@bnasslahsen
Copy link
Collaborator

Fix will be available on v1.2.31

@edgeofoblivion
Copy link
Author

Confirmed this is resolved in 1.2.31, thanks so much.

@bnasslahsen bnasslahsen added the bug Something isn't working label Jan 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants