# rsuter/nswag

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/rsuter-nswag).**

7,342 stars · 1,354 forks · C# · MIT

## Links

- GitHub: https://github.com/RSuter/NSwag
- Homepage: http://NSwag.org
- awesome-repositories: https://awesome-repositories.com/repository/rsuter-nswag.md

## Description

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.

## Tags

### Development Tools & Productivity

- [API-First Development Toolsets](https://awesome-repositories.com/f/development-tools-productivity/compilers-toolchains/source-compilation-tools/source-generators/api-first-development-toolsets.md) — Provides an integrated toolset for defining API contracts and generating corresponding server and client boilerplate.
- [OpenAPI Specification Generators](https://awesome-repositories.com/f/development-tools-productivity/openapi-configurations/documentation-generators/openapi-specification-generators.md) — Extracts standardized OpenAPI documents from code comments and metadata to automatically document the service surface. ([source](https://github.com/rsuter/nswag#readme))
- [OpenAPI to Type Conversions](https://awesome-repositories.com/f/development-tools-productivity/openapi-configurations/openapi-to-type-conversions.md) — Translates OpenAPI specifications into language-specific type definitions for TypeScript and C# clients.
- [OpenAPI Toolchains](https://awesome-repositories.com/f/development-tools-productivity/openapi-toolchains.md) — Provides a comprehensive set of tools for generating typed client libraries and server controllers from OpenAPI specifications in .NET.
- [Template-Based Code Generators](https://awesome-repositories.com/f/development-tools-productivity/template-based-code-generators.md) — Uses pre-defined blueprints to transform OpenAPI specification models into typed source code for various languages.
- [Server Boilerplate Generators](https://awesome-repositories.com/f/development-tools-productivity/type-safe-binding-generators/server-boilerplate-generators.md) — Automates the creation of server-side controller boilerplate code from API schema definitions. ([source](https://github.com/rsuter/nswag#readme))
- [CLI Automation Tools](https://awesome-repositories.com/f/development-tools-productivity/cli-automation-tools.md) — Provides a command-line interface for executing specification and code generation tasks. ([source](https://github.com/rsuter/nswag#readme))
- [Interactive Documentation Interfaces](https://awesome-repositories.com/f/development-tools-productivity/openapi-configurations/documentation-generators/openapi-specification-generators/interactive-documentation-interfaces.md) — Provides a web interface that renders OpenAPI specifications for real-time testing and exploration of API endpoints. ([source](https://github.com/rsuter/nswag#readme))
- [REST API Toolchains](https://awesome-repositories.com/f/development-tools-productivity/rest-api-toolchains.md) — Automates the generation of specifications and client code through a configurable command line or graphical interface.

### Data & Databases

- [Client Library Generation](https://awesome-repositories.com/f/data-databases/openapi-processors/client-library-generation.md) — Transforms OpenAPI specifications into functional, type-safe client libraries in TypeScript and .NET.

### Software Engineering & Architecture

- [Automated API Documentation](https://awesome-repositories.com/f/software-engineering-architecture/automated-api-documentation.md) — Generates technical OpenAPI specifications and documentation directly from source code definitions.
- [Generated Client Proxies](https://awesome-repositories.com/f/software-engineering-architecture/typescript-type-definitions/generated-client-proxies.md) — Builds frontend services that communicate with .NET backends using automatically generated proxies and shared type definitions.
- [OpenAPI Specification Extraction](https://awesome-repositories.com/f/software-engineering-architecture/metadata-attachments/struct-tags/reflection-based-type-mapping/openapi-specification-extraction.md) — Analyzes compiled .NET assemblies and metadata to automatically derive OpenAPI documents from existing controller definitions.

### Web Development

- [Type-Safe Client Generators](https://awesome-repositories.com/f/web-development/api-client-generators/type-safe-client-generators.md) — Provides a generator that produces type-safe TypeScript client proxies from OpenAPI specifications to ensure frontend-backend consistency.

### Part of an Awesome List

- [API Development](https://awesome-repositories.com/f/awesome-lists/devtools/api-development.md) — Toolchain for OpenAPI generation and client code.
- [Development Tools](https://awesome-repositories.com/f/awesome-lists/devtools/development-tools.md) — Generates code and integrates APIs using Swagger definitions.
