moved 'useAnnotatedBasePath' option into jaxrs abstract codegen #7306
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR checklist
./bin/
to update Petstore sample so that CIs can verify the change. (For instance, only need to run./bin/{LANG}-petstore.sh
and./bin/security/{LANG}-petstore.sh
if updating the {LANG} (e.g. php, ruby, python, etc) code generator or {LANG} client's mustache templates). Windows batch files can be found in.\bin\windows\
.3.0.0
branch for changes related to OpenAPI spec 3.0. Default:master
.Description of the PR
Short Description:
I moved the 'useAnnotatedBasePath' from the cxf codegen to the abstract jaxrs codegen.
This change enables the standard codegens to serve more situations without that (some) jaxrs users needs to write their custom generator.
Long Description:
Using the jaxrs server codegen (for jersey), I found some difficulties to generate code for my project.
As already said here, this generator seems to be used as a project skeleton. To generate only a REST interface, a custom codegen should be created.
This change lets the generator(s) be more elastic to adapt at user needs:
The 'useAnnotatedBasePath' can be used by all the implementation of the abstract jaxrs codegen. This way, it is possible to exploit
.swagger-codegen-ignore
to avoid generation of servlet filters and web.xml like files. Then, the 'useAnnotatedBasePath' options enables other loosly coupled software components to exploit the@Path
annotation (now containing also the basePath)As an example:
A custom
webserver
can inspect arest
package to discover through java introspection the jaxrs annotated class.Thus, the webserver and the rest controllers are loosly coupled without rewriting a new custom codegen.
tests
I've not the full environment. I cannot test all the project.
I've run only the unit test through maven and I'm using this version as generator for my project