NSwag is a toolchain for the .NET ecosystem designed to automate the generation of API documentation, server controllers, and typed client proxies from OpenAPI contracts. It functions as a contract-first API tool that enables the creation of server-side boilerplate and client libraries based on predefined specifications.
The suite distinguishes itself through its ability to extract OpenAPI specifications from existing ASP.NET Core code via reflection and its capacity to generate type-safe TypeScript client proxies. It also provides an interactive documentation server that hosts and renders these specifications for testing and exploration.
The project covers a broad range of API lifecycle capabilities, including template-based code generation, schema-to-type mapping for TypeScript and C#, and the automation of REST API toolchain management. These tasks can be orchestrated through a command-line interface or a graphical user interface using centralized configuration files.