swagger-codegen
swagger-codegen copied to clipboard
Expand Resource and PagedResources generics for Java Rest
- add new hook to codegen config: postProcessFileContents that is invoked after the file contents are generated from the template but before they are written to the file. Default is to leave contents as found
- for java client code generator, if the library is resttemplate and template is for the api, expand all occurrences of PagedResourcesBlah into PagedResources<Blah> and ResourceBlah into Resource<Blah>
US203263
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 found 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. I am not sure what it means to 'copy the technical committee'. Here is the list of from the indicated website for Java. @bbdouglas (2017/07) @JFCote (2017/08) @sreeshas (2017/08) @jfiala (2017/08) @lukoyanov (2017/09) @cbornet (2017/09)
Description of the PR
(details of the change, additional tests that have been done, reference to the issue for tracking, etc) Close #7081 Add a step in the code generation after the templates are applied that turns references such as PagedResourcesResourceMyStuff back into PagedResources<Resource<MyStuff>> Applied only to Java codegens using the resttemplate library.