A Swagger/OpenAPI toolchain for .NET, ASP.NET Core, and TypeScript that generates specifications and client code.
NSwag is a Swagger/OpenAPI toolchain for .NET, ASP.NET Core, and TypeScript that generates OpenAPI specifications from existing ASP.NET Web API controllers and creates client code from those specifications. It solves the problem of maintaining separate tools for API documentation and client generation by combining both functionalities into a single, cohesive workflow. This integration helps avoid compatibility issues and provides enhanced support for complex features like inheritance and enum handling.
Developers working with .NET or ASP.NET Core Web APIs who need to generate OpenAPI documentation and client code for frontend applications written in TypeScript or C#. It is particularly useful for teams implementing contract-first development or maintaining large API ecosystems.
Developers choose NSwag because it unifies the capabilities of Swashbuckle (OpenAPI generation) and AutoRest (client generation) into one toolchain, eliminating the need for multiple dependencies. Its deep integration with .NET and support for advanced JSON Schema features provide a more reliable and feature-rich experience compared to using separate tools.
The Swagger/OpenAPI toolchain for .NET, ASP.NET Core and TypeScript.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Combines OpenAPI specification generation and client code creation into a single workflow, eliminating compatibility issues between separate tools like Swashbuckle and AutoRest.
Handles complex features like inheritance and enum handling better than the base OpenAPI specification, as highlighted in the README for improved API modeling.
Offers flexibility via CLI, Windows GUI (NSwagStudio), NuGet packages, MSBuild targets, and ASP.NET Core middleware, catering to diverse development workflows.
CLI tools distributed via NuGet and NPM enable seamless integration into CI/CD pipelines, supporting automated code generation and documentation updates.
Primarily optimized for .NET and TypeScript, making it less effective for projects outside these ecosystems or with mixed technology stacks.
The extensive settings in NSwagStudio or JSON configuration files can be overwhelming, requiring significant time to master for optimal use.
The README admits issues with loading .NET Core assemblies in some scenarios, leading to potential runtime errors during code generation.
Critical information is scattered across a wiki, GitHub issues, and blog posts, making it difficult to find cohesive, up-to-date guidance.
NSwag is an open-source alternative to the following products: