Automatic Swagger JSON spec generation using the .NET CLI tools

PHOTO EMBED

Mon Sep 04 2023 16:12:25 GMT+0000 (Coordinated Universal Time)

Saved by @b1llso #c# #swagger #asp.net

dotnet swagger tofile --output .\wwwroot\swagger\v1.0\swagger.json .\bin\Debug\net6.0\[PROJECT NAME].dll [API VERSION]
content_copyCOPY

Create a tools-manifest.json file if your project doesn't already have one `dotnet new tools-manifest` Make sure that the output path exists before running the command Also check if the .NET CLI tool version matches your project's `dotnet --version` You can select the .NET version used by the CLI tool by creating a `global.json` file in the root of project such as this one: ``` { "sdk": { "version": "6.0.316" } } ```