cancel
Showing results for 
Search instead for 
Did you mean: 

Can I define a custom attributes as part of CodegenParameter

RohanPalkar
Occasional Contributor

Can I define a custom attributes as part of CodegenParameter

I am trying to define a custom code generator for my area by extending the DefaultCodegen and implementing the CodegenConfig interface. I have a custom rest-api client that I have customised to the needs of my product and I am trying to generate mycustom-api-client code for which, I need to define some special parameters, ideally CodegenParameter so that I can perform some conditional logic in my code-generator implementation. 

How can I add more attributes/parameters to CodegenParameter or any CodegenModelType ? or can I extend the CodegenParameter ?

1 REPLY 1
joejoyce
Staff

Re: Can I define a custom attributes as part of CodegenParameter

Hey @RohanPalkar. It's possible to create your own templates for codegen using Mustache (https://mustache.github.io/). 

 

You create a template file, and then use the '-t' flag to specify the template folder to be used during code generation.

 

Full documentation is here: https://github.com/swagger-api/swagger-codegen ('Customizing the generator' section)

New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors