1

I need to customise a single class that is generated by swagger codegen, I have been reading about the mustache templates and that seems like the right way to go but I only want to change a single generated class.

The examples I looked at seemed to change the template directory location from the command line with -t option but I really only want to change one single class.

What is the best way to do this?

berimbolo
  • 3,319
  • 8
  • 43
  • 78

1 Answers1

0

If let's say you want to only customize one of the models, a workaround is to whitelist all the other models in .swagger-codegen-ignore file, which means those whitelisted files will not be regenerated/overwritten.

Then you can pass the customized templates via the -t option and regenerate the model files again. Only the model not whitelisted in .swagger-codegen-ignore will be regenerated/overwritten.

William Cheng
  • 10,137
  • 5
  • 54
  • 79
  • Hi @William Cheng, Could you please help me with this question?[Change Swagger index.html logo and header contents](https://stackoverflow.com/questions/66704031/change-swagger-index-html-logo-and-header-contents). I am searching for some solution from last one month but couldn't find any :( Running out of time also. If you could help it would be great. Thanks in advance – Avinash Mar 25 '21 at 08:14