RicoSuter / NSwag

The Swagger/OpenAPI toolchain for .NET, ASP.NET Core and TypeScript.
http://NSwag.org
MIT License
6.67k stars 1.23k forks source link

nswag.json is populated by NSwag.MSBuild #2942

Open Leon99 opened 4 years ago

Leon99 commented 4 years ago

We're trying to keep nswag.json for generating Swagger doc to minimum as most of the properties are set via code and consumed with the help of "useDocumentProvider": true. However, the MSBuild task rewrites the file by adding the full set of the properties during code generation. Why would it do that?

RicoSuter commented 4 years ago

Main reason is that it updates the config with the latest default values so that if they change in the future they are fixed and you immediately see the newly supported options.

Leon99 commented 4 years ago

Oh okay, I never thought about it that way... I might be (overly) used to SemVer and reading release notes :) Anyway, would you accept a PR to make that rewrite optional?

RicoSuter commented 3 years ago

@jeremyVignelles what do you think?

jeremyVignelles commented 3 years ago

Why not, but how would you do that? an option in the file?

RicoSuter commented 3 years ago

An option to specify how options are handled in the options file ;)

jeremyVignelles commented 3 years ago

that's meta, but why not.

"autoUpgrade":false

?

RicoSuter commented 3 years ago

Why not...