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
When the spring-modulith-observability dependency is present, RestControllers that implement any interface are no longer serving their endpoints or apear in the OpenAPI documentation (Swagger).
This is not limited to interfaces with Rest Annotations (like @GetMapping), or OpenAPI Annotations, but also to interfaces that are not related to the REST API, including empty marker interfaces.
The expected behavior is, that the spring-modulith-observability doesn't have an effect on the availability of RestControllers implementing an interface.
In the reproducer Module1Controller is not implementing an interface, Module2Controller and Module3Controller however are implementing an interface.
For the Module1Controller bean the ModuleTracingBeanPostProcessor.postProcessAfterInitialization returns a Spring CGLIB Proxy, which is then processed by the other BeanPostProcessor instances.
For the controllerModule2Controller and Module3Controller beans a JdkDynamicAOPProxy instance is returned.
Unfortunately I'm not sure whether this behavior really causes the outlined issue, but maybe this first analysis helps you @odrotbohm.
Edit:
I assume this is a general Spring AOP limitation which is used by spring-modulith-observability under the hood.
The RequestMapping docs point out (in the last note) that mapping annotations should be added on the interface rather than the implementing controller class when AOP is used.
When annotating the interfaces rather than the controller classes in your reproducer they are picked up again properly by SpringDocs.
When the spring-modulith-observability dependency is present, RestControllers that implement any interface are no longer serving their endpoints or apear in the OpenAPI documentation (Swagger).
This is not limited to interfaces with Rest Annotations (like @GetMapping), or OpenAPI Annotations, but also to interfaces that are not related to the REST API, including empty marker interfaces.
The expected behavior is, that the spring-modulith-observability doesn't have an effect on the availability of RestControllers implementing an interface.
Reproducer https://github.com/gmuecke/spring-modulith-observability-reproducer
Spring Modulith: 1.2.0, 1.1.5
Spring Boot: 3.3.0, 3.2.6
JDK 21
The text was updated successfully, but these errors were encountered: