How do you use liquid templates with NSwagStudio to change how files are generated?
Asked
Active
Viewed 3,945 times
2
-
I asked a related question re: gaining access to Swagger/OAS 3.0 json from Templates at [Extension point or access to OpenApiDocument from Liquid Template](https://stackoverflow.com/questions/60304352/extension-point-or-access-to-openapidocument-from-liquid-template). If you have information it would be appreciated :) – ttugates Feb 19 '20 at 16:02
1 Answers
3
OK, it seems there are some samples of liquid templates there: https://github.com/RSuter/NSwag/tree/master/src/NSwag.CodeGeneration.CSharp/Templates
You can copy them and start editing them.
Then, you just need to point to your folder to use them to generate custom code.
There is a wiki: https://github.com/RSuter/NSwag/wiki/Templates

Antoine Griffard
- 83
- 2
- 13
-
Dumb question: Any idea how to put a line break in these liquid templates? – Vin Shahrdar Jan 02 '20 at 20:44
-
Another dump question: How do I stop using these templates? My requirments have changed and I don't need this templates anymore, but I get this error that says "template path is required" when I blank out the field. – Vin Shahrdar Feb 04 '21 at 21:46
-