A .NET tool is cross-platform command-line tooling that extends the .NET SDK. Installed globally, it can be invoked from the command line and used across projects. section 11.4.2 section 12.3.1
For OpenAPI clients, install the Microsoft .NET OpenAPI tool globally, add an OpenAPI reference to a console project, and build. The tool downloads the API description and generates a strongly typed C# client through NSwag. section 11.4 section 11.4.2
A typical OpenAPI client workflow is:
- Run the API and make its OpenAPI JSON document accessible. section 11.4.2
- Add the document with dotnet openapi add url, saving it locally such as OpenAPIs\fruit.json. section 11.4.2
- Add the client-generation packages, then build to generate the C# client. section 11.4
Generated OpenAPI client
An OpenAPI reference can specify the local document, namespace, and generated class: <OpenApiReference Include="OpenAPIs\fruit.json" SourceUrl="http://localhost:5062/swagger/v1/swagger.json" Namespace="Fruit" ClassName="FruitClient" />. Building the project then produces a FruitClient with serialization and deserialization support. section 11.4

