swagger-codegen-tooling
swagger-codegen-tooling copied to clipboard
Name collision with APIs
Hello,
I tried your org.zalando.maven.plugins:swagger-codegen-maven-plugin plugin with the example provided by the io.swagger:swagger-codegen-maven-plugin plugin.
I ran into a name collision between model classes and API classes, namely io.swagger.annotations.APIResponse and com.example.project.model.APIResponse with the jaxrsinterfaces language of yours.
Machines doesn't need to make pretty code to make it work. I see no reason not to use fully qualified name and prevent such collisions (all annotation names are concerned actually).
Hey @jbellmann, do you agree with @grimly and/or have any feedback?
@grimly
Yes you are right. I had a look into the original templates provided by swagger.io. They changed a lot since the day I started this project. Unfortunately I did not give JAXRS much attention since then in favour of Spring-* . Using the FQN solved the problem.
To be honest, I played with the idea to drop JAXRS-Support completely. Would it make any sense to you not to drop it? Did you compared both maven-plugins? Why did you try out this one too? Do you see some features here you miss in the "official" maven-plugin?
Please take time to answer my questions.
Regards, Jörg
Sorry for the late answer.
You may not really compare Spring and JAXRS as their goal are not the same.
JAXRS is a specification targeted at serving REST services while Spring is an implementation aimed at Web applications (which is a superset).
My opinion would be to make priviledged the JAXRS support. You can then use it with Jersey or CXF, which both works with Spring. I personally use Jersey+Guice and nothing from Spring so my interests are obviously biased toward the JAXRS support.