Description
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
- Specify @RouterOperation for an endpoint in a Spring Boot application.
- Define a method in a subclass that overrides a method from a parent class and parent class method is the beanMethod.
- Check the generated Swagger documentation.
Spring Boot version: 3
springdoc-openapi module version:
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-starter-webflux-ui</artifactId>
<version>2.3.0</version>
</dependency>
Expected behavior
Swagger documentation should include methods inherited from parent classes when using @RouterOperation.
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"))