Is there any built-in way with Swashbuckle for ASP.NET Core to generate the swagger.json
file at build or compile time (i.e. not with dotnet run
)?
I'm starting down a path of microservices and I thought it would be nice to generate the swagger.json
file at build time to allow other services to generate client APIs.
You can use the Swashbuckle.AspNetCore.Cli to do this.
The CLI is versioned alongside the main package Swashbuckle.AspNetCore, so despite at the time of writing the readme saying use version 2.1.0-beta1
, use the version that matches your use of Swashbuckle.AspNetCore.
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