Skip to content

Conversation

olensmar
Copy link
Contributor

This PR revamps the JAX-RS Server side codegen template to allow for regeneration of code without overriding the implementation. The codegen now generates the following:

  • an abstract base class for the methods of the Swagger API
  • an implementation of that class which will not be overwritten if already available
  • a jax-rs annotated class that acts as the actual API which delegates to the implementation of the abstract base class
  • a service factory for creating the implementation of the abstract base class - used by the jax-rs class - will not be overwritten in subsequent runs

the default code is now generated into the src/gen/main folder, a system property (swagger.codegen.jaxrs.impl.source) is used for putting implementation classes into a separate root (defaults to src/main/gen in the sample petstore sh).

Further system properties now available:

  • swagger.codegen.jaxrs.apipackage for setting the root package (defaults to io.swagger.api)
  • swagger.codegen.jaxrs.modelpackage setting the root package for the model (defaults to io.swagger.model)

The command-line tooling now has support for -D for setting system properties, for example -Dswagger.codegen.jaxrs.impl.src=src/main/java

Ole Lensmar added 7 commits May 12, 2015 13:18
…rresponding factory. JaxRs class uses the factory to find the implementation. Also fixed possibility for a code generator to control which API files that should be overwritten
…notation to warn if we get dead methods when the definitions changes
…impl folder via system property at command-line
…s://github.com/swagger-api/swagger-codegen into jaxrs-interface-generation

Conflicts:
	modules/swagger-codegen/src/main/java/com/wordnik/swagger/codegen/DefaultCodegen.java
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants