Added apiNameSuffix parameter for JaxRsSpec code generator
PR checklist
- [X] Read the contribution guidelines.
- [x] Ran the shell script under
./bin/to update Petstore sample so that CIs can verify the change. (For instance, only need to run./bin/{LANG}-petstore.shand./bin/security/{LANG}-petstore.shif updating the {LANG} (e.g. php, ruby, python, etc) code generator or {LANG} client's mustache templates). Windows batch files can be fold .und in.\bin\windows\. - [X] Filed the PR against the correct branch:
3.0.0branch for changes related to OpenAPI spec 3.0. Default:master. - [X] Copied the technical committee to review the pull request if your PR is targeting a particular programming language.
Description of the PR
Issue: https://github.com/swagger-api/swagger-codegen/issues/7150
I added an additional property to specify an api name suffix instead of always using "Api". I only changed the JaxRsSpec generator but it will also affect generator that are not reimplementing "toApiName()".
I did run the script as mentioned but I didn't include to change as it changed unrelated stuff. You might want to run all the script on master.
@bbdouglas @JFCote @sreeshas @jfiala @lukoyanov @cbornet
@ndurette I think it would be nice to see the changes on at least one generator (run the shell script). Also, I would be nice to add a .sh file that use your new parameter so we could the the effect it have compared to the default.
@JFCote I added a new script to generate a new server using my feature. I also ran the previous "jaxrs-spec-petstore-server" scripts.
In my case adding the property in JavaJAXRSSpecServerCodegen would do it. Do you think it can be valuable to have this additional property in AbstractJavaJAXRSServerCodegen?
The idea behind this modification was to copy the "model-name-suffix" feature. But I agree that it might not fit for every generator.
I'll wait for comments and then make the changes as needed.
The idea behind this modification was to copy the "model-name-suffix" feature. But I agree that it might not fit for every generator.
Given that it's only targeting a specified generator, please add the option to JavaJAXRSSpecServerCodegen for the time being. If there is more demand to add this feature to other generators, we'll add it one by one.