-
Notifications
You must be signed in to change notification settings - Fork 200
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
Extended support for Spring Controller interfaces #1115
Comments
If there are no annotations on the interface itself, how would Enunciate determine whether the interface is actually a controller or if it's just a common interface that multiple controllers want to share? |
I agree it's a bit "tricky" and surely does not make it less complex. Naive me thought just looking for the implementation class of the interface. But if we have multiple impls I would expect that all of them will be selected as a target for documentation generation. Similar to what happens with referenced DTOs in an interface - they are also picked up although maybe lying out of the provided package to scan. If this is a bigger thing todo it's maybe not worth the effort.... |
I can take a closer look, but let me summarize to make sure I understand what you'd like to see.
Is that accurate? |
Yes, that is accurate :). |
Okay. We'll probably have to make this a config option, though, because some people use interfaces to support common parameters and patters across multiple controllers and it doesn't imply that the interface is a controller. For example, if I want my |
Hey,
I'm using Enunciate 2.11.1 together with a Spring 5 WebMVC REST app. I'm separating the REST controllers via interfaces from its implementation, so that the interface can be reused by client generation like Feign. Recently Feign dropped support for @RequestMapping on Controller interfaces and so I dropped it as well, moving the path to e.g. @GetMapping on method level. Then I also wanted to cleanup @RestController on the interface, as it's already contained on my impl. But then it seemed that enunciate wasn't able to pickup the endpoints anymore on the interface - which I use for "scanning".
Now I'm wondering if there's a way for Enunciate to detect that the interface actually IS a RestController without having that annotation set on it directly - but maybe looking at the implementation class which has it? Does the internal metamodel in Enunciate already has this kind of information?
The text was updated successfully, but these errors were encountered: