SwaggerWrapper 1.0.1
dotnet add package SwaggerWrapper --version 1.0.1
NuGet\Install-Package SwaggerWrapper -Version 1.0.1
<PackageReference Include="SwaggerWrapper" Version="1.0.1" />
paket add SwaggerWrapper --version 1.0.1
#r "nuget: SwaggerWrapper, 1.0.1"
// Install SwaggerWrapper as a Cake Addin #addin nuget:?package=SwaggerWrapper&version=1.0.1 // Install SwaggerWrapper as a Cake Tool #tool nuget:?package=SwaggerWrapper&version=1.0.1
SwaggerWrapper
SwaggerWrapper simplifies the integration of OpenAPI and Swagger documentation generation in your ASP.NET Core applications. It provides an easy way to configure and manage your API documentation with minimal setup.
Feature
- Simplifies the setup of Swagger and OpenAPI documentation.
- Provides default settings that can be customized via
appsettings.json
. - Easy integration with your ASP.NET Core 8 application.
Installation
Install the SwaggerWrapper package via NuGet:
dotnet add package SwaggerWrapper
Add the following settings to your
appsettings.json
file if you want to customize the default values:{ "OpenApiSetting": { "Version": "v1", "Title": "Example", "Description": "Example Api", "TermsOfService": "https://example.com/terms", "Contact": { "Name": "Jon Doe", "Url": "https://example.com/jon" }, "JwtSecurity": { "Name": "Authorize", "Description": "Input your Access token to access this API", "BearerFormat": "JWT" }, "Options": { "EnableJwtAuthButton": false, "EnableCustomSchemaFilter": true }, "LicenseInfo": { "Name": "MIT", "Url": "https://mit-license.org/" } } }
Usage
Register the SwaggerWrapper service in
Startup.cs
orProgram.cs
:public void ConfigureServices(IServiceCollection services) { services.AddSwaggerWrapper(Configuration); }
Add SwaggerWrapper to the middleware pipeline in
Startup.cs
orProgram.cs
:public void Configure(IApplicationBuilder app, IWebHostEnvironment env) { app.UseSwaggerWrapper(); // Other middlewares }
Configuration
The following settings are available in the appsettings.json
file under the OpenApiSetting
section:
Version
: The version of the API (default: "v1").Title
: The title of the API (default: "Example").Description
: The description of the API (default: "Example Api").TermsOfService
: The URL of the terms of service (default: "https://example.com/terms").Contact
: Contact information for the API.Name
: The name of the contact person (default: "Jon Doe").Url
: The URL of the contact person (default: "https://example.com/jon").
JwtSecurity
: JWT security definition.Name
: The name of the security scheme (default: "Authorize").Description
: Description of the security scheme (default: "Input your Access token to access this API").BearerFormat
: Bearer format for the security scheme (default: "JWT").
Options
: Additional configuration options.EnableAuthFilter
: Enables the authorization filter (default: false).EnableCustomSchemaFilter
: Enables custom schema filter (default: true).
LicenseInfo
: License information for the API.Name
: The name of the license (default: "MIT").Url
: The URL of the license (default: "https://mit-license.org/").
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
This project is licensed under the MIT License. See the LICENSE
file for more information.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
-
net8.0
- Microsoft.AspNetCore.OpenApi (>= 8.0.6)
- Swashbuckle.AspNetCore (>= 6.6.2)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.