Showing content from https://github.com/RicoSuter/NSwag/wiki/SwaggerToTypeScriptClientGeneratorSettings below:
Home · RicoSuter/NSwag Wiki · GitHub
Roadmap | SDK Development | Contribute
Ways to use the toolchain
ASP.NET (Core) Middlewares:
Automated/CLI:
GUI:
- NSwagStudio (Windows GUI)
- Edit .nswag configuration files which can be executed via command line
- Swagger/OpenAPI specification via URL or from a .NET assembly (no running web app needed)
NSwag builds on top of NJsonSchema and thus most of its settings, extension points, etc. also apply.
Swagger/OpenAPI Generation
Available Swagger generators:
- AspNetCoreOpenApiDocumentGenerator (ASP.NET Core only):
- Generate a Swagger/OpenAPI specification from ASP.NET Core controllers via API Explorer
AddOpenApiDocument()
, AddSwaggerDocument()
, etc.
UseOpenApi()
, UseSwaggerUi3()
, UseReDoc()
, etc.
- WebApiOpenApiDocumentGenerator (supports ASP.NET and ASP.NET Core, deprecated):
- Generate a Swagger specification for Web API controller classes (Reflection based):
UseSwagger()
, UseSwaggerUi3()
, etc.
- Assembly loading instructions (required for CLI usage)
The Swagger/OpenAPI generators use the JSON Schema generator from the NJsonSchema project:
- JsonSchemaGenerator (NJsonSchema): Generates schemas from .NET classes
- XML Documentation (NJsonSchema)
- The
NSwag.AspNetCore
NuGet package automatically installs the required NuGet packages for reading XML Documentation.
- Enums (NJsonSchema)
- Inheritance (NJsonSchema): How to describe and generate inheritance of DTO classes.
Swagger/OpenAPI generation:
You can customize the Swagger/OpenAPI generator with the following extension points of NSwag:
Schema processing:
- Type Mappers (NJsonSchema): Type mappers allow you to generate a custom JSON Schema for a given .NET type.
- Schema Processors (NJsonSchema): Post process the generation of the schema or child schemas
- Schema Name Generators (NJsonSchema): Customize the names of schema 'definitions' keys.
- Templates: Modify or extend the code generator templates.
Available code generators:
RetroSearch is an open source project built by @garambo
| Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4