We're using Swagger Codegen 2.4.5 to generate models from our API. Everything is working exactly as we need with one relatively minor exception.
We're generating C# models, and as per windows these are typically stored with CRLF
line endings. Whenever we run the generator these files are generated with the LF
line endings.
We'd like all the models to be generated with CRLF
instead of LF
. Is there a way to modify this behaviour?
I've looked into how mustache is used - a bit - and read through the general command line options for codegen and the csharp specific options (java -jar swagger-codegen-cli-2.4.5.jar config-help -l csharp
), and couldn't find anything.
For further clarification:
Currently this is a problem as each time you checkout then run generation again, then models appear as changed. This is simply because they're now encoded with LF
line-endings, whereas git has checked them out as CRLF
(which we cannot change)
The only other option I can think of at the moment, is to rewrite each file in the project with CRLF after the generation process has completed. I'd prefer it if there was a way via the generator tho.
*.cs text eol=lf
. See this page for more examples git-scm.com/docs/gitattributes – Storax