Is there any way to create the swagger json during the build task of my web api? I want to use the json to feed it into a code generator and generate a typescript definition file.
Any help is more than welcome!
You can use the NSwag command line tools like this:
nswag.exe webapi2swagger /assembly:"path/to/assembly.dll" /output:"path/to/swagger.json"
This generates a Swagger specification with for all controllers in the given DLL.
For more information read this page.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With