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

Override template path

Open simo9000 opened this issue 9 years ago • 0 comments

PR checklist

  • [X] Read the contribution guildelines.
  • [X] Ran the shell/batch script under ./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)
  • [X] Filed the PR against the correct branch: master for non-breaking changes and 2.3.0 branch for breaking (non-backward compatible) changes.

Description of the PR

I found the need to subclass a concrete language generator including the templates with the need to be able to inject partial templates from the subclass. This PR provides a means to enable a derived generator to route the template file look up to an arbitrary template location based on the name of the template. I then added some partial template tags and placeholder mustache files into the csharp client generator to enable subclasses to add packages/references to the generated project. I also added a ApiClient (also csharp) virtual method to intercept deserialization of models.

simo9000 avatar Dec 15 '16 18:12 simo9000