-
-
Notifications
You must be signed in to change notification settings - Fork 523
Inherited Methods Not Included in Swagger Documentation with @RouterOperation in Spring Boot WebFlux Application #2525
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
Comments
Try adding a complete reproducible sample, so we can confirm the fix. This ticket will be closed, but can be reopened if your provide the reproducible sample. |
Sure, I will add the one simple code to reproduce the issue. |
Hi @bnasslahsen
GetNameHandlerClass
Router Class I am using Functional Endpoint
In the GetNameHandler class I am commenting and uncommenting the code, I am getting the results as below. This is the result of keeping the code commented. This is the result of uncommented code. Below is repo link of the simple Spring-Boot working code of above example. Please clone and check the results I mentioned above. Please let me know if anything wrong I am doing or any clarification regarding my code. |
Describe the bug
When using @RouterOperation to document API endpoints in Spring Boot Webflux applications with springdoc-openapi, the Swagger does not include methods inherited from parent classes. This occurs because internally, AopUtils.getTargetClass(handlerBean).getDeclaredMethods() is used, which only retrieves declared methods, not methods from parent classes.
Because suppose there is a method already implemented in parent class and I don't want to implement that method again in child class and the method implemented in the parentClass is my beanMethod.
Since that method is already inherited by the child class it should be child class function also.
To Reproduce
Spring Boot version: 3
springdoc-openapi module version:
Expected behavior
Swagger documentation should include methods inherited from parent classes when using @RouterOperation.
Screenshots

Additional context
Code where beanClass and beanMethod is used.
@RouterOperation(path = "v1/payment", method = RequestMethod.POST, beanClass = PaymentHandler.class, beanMethod = "handle", operation = @Operation(description = "Say hello GET", operationId = "lowercaseGET", tags = "persons"))
The text was updated successfully, but these errors were encountered: