swagger-codegen-tooling icon indicating copy to clipboard operation
swagger-codegen-tooling copied to clipboard

Name collision with APIs

Open grimly opened this issue 9 years ago • 3 comments

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).

grimly avatar Oct 20 '16 10:10 grimly

Hey @jbellmann, do you agree with @grimly and/or have any feedback?

lasomethingsomething avatar Nov 21 '16 14:11 lasomethingsomething

@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

jbellmann avatar Nov 21 '16 18:11 jbellmann

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.

grimly avatar Feb 28 '17 15:02 grimly