Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
- Package: NSwag.SwaggerGeneration.AspNetCore
- Settings: AspNetCoreToSwaggerGeneratorSettings
- Usage: Code (below), AddSwaggerDocument(), UseSwagger()
This generator uses the ASP.NET Core API Explorer service to generate specs and will eventually supersede the reflection based generator WebApiToSwaggerGenerator. It is recommended to use this generator for new projects and also start migrating existing projects.
The generator can be used via middleware or CLI (project or assembly).
Important: If you run this generator via NSwag.MSBuild as part of your csproj build (after build target), you need to set NoBuild to true to avoid endless build recursions...
Remarks: If you are using .NET Core >= v2.1, you may need to set the CompatibilityVersion.
The generator exposes the same extension points and behavior as the WebApiToSwaggerGenerator:
TODO: Improve this page (copy over docs)