Forum Discussion

vilppuvuorinen's avatar
vilppuvuorinen
Occasional Visitor
4 years ago

Swagger Core annotation processing

I'm looking into doing JAX-RS -> OpenAPI -> codegen during a single mvn compile invocation. The issue here is that swagger-core seems to be reflective. The classes I'd like to generate do not exist yet.

I looked into the JAX-RS reader source and it seemed to be exclusively based of reflection. Are there any parts of the core package that would already deal with Elements instead of Classes that could be leveraged for producing the JAX-RS docs during compile time or am I just simply out of luck?

I believe it should be possible to use a couple of maven plugins to do the on-the-fly partial compilation to first generate OpenAPI out of the classes and then run the code generation separately on the resulting file. This just feels weird knowing swagger-core would just work if I wouldn't need the classes before I can run the app.
No RepliesBe the first to reply