RepletoryLib.Api.Swagger
1.0.0
dotnet add package RepletoryLib.Api.Swagger --version 1.0.0
NuGet\Install-Package RepletoryLib.Api.Swagger -Version 1.0.0
<PackageReference Include="RepletoryLib.Api.Swagger" Version="1.0.0" />
<PackageVersion Include="RepletoryLib.Api.Swagger" Version="1.0.0" />
<PackageReference Include="RepletoryLib.Api.Swagger" />
paket add RepletoryLib.Api.Swagger --version 1.0.0
#r "nuget: RepletoryLib.Api.Swagger, 1.0.0"
#:package RepletoryLib.Api.Swagger@1.0.0
#addin nuget:?package=RepletoryLib.Api.Swagger&version=1.0.0
#tool nuget:?package=RepletoryLib.Api.Swagger&version=1.0.0
RepletoryLib.Api.Swagger
Swagger/OpenAPI documentation with JWT auth, API versioning support, and standard error responses.
Part of the RepletoryLib ecosystem -- standalone, reusable .NET 10 libraries with zero business logic.
Overview
RepletoryLib.Api.Swagger provides a pre-configured Swagger/OpenAPI setup for ASP.NET Core applications. It includes JWT Bearer authentication in the Swagger UI, per-version API documentation when used with RepletoryLib.Api.Versioning, standard error response annotations, and XML documentation comment support.
Key Features
- JWT auth in Swagger UI -- "Authorize" button for testing authenticated endpoints
- API version support -- Separate Swagger documents per API version
- Standard error responses -- Auto-documents 400, 401, 404, 500 responses
- XML documentation -- Includes XML doc comments in the Swagger spec
- Configurable -- Title, description, contact info, route prefix
Installation
dotnet add package RepletoryLib.Api.Swagger
Dependencies
| Package | Type |
|---|---|
RepletoryLib.Common |
RepletoryLib |
Swashbuckle.AspNetCore |
NuGet |
Asp.Versioning.Mvc.ApiExplorer |
NuGet |
Quick Start
using RepletoryLib.Api.Swagger;
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddRepletorySwagger();
var app = builder.Build();
app.UseRepletorySwagger();
{
"Swagger": {
"Title": "My Application API",
"Description": "API documentation for My Application",
"ContactName": "Dev Team",
"ContactEmail": "dev@example.com",
"EnableInProduction": false,
"RoutePrefix": "swagger"
}
}
Configuration
SwaggerOptions
| Property | Type | Default | Description |
|---|---|---|---|
Title |
string |
"RepletoryLib API" |
API title in Swagger UI |
Description |
string |
"RepletoryLib API Documentation" |
API description |
ContactName |
string |
"" |
Contact name |
ContactEmail |
string |
"" |
Contact email |
EnableInProduction |
bool |
false |
Show Swagger in production |
RoutePrefix |
string |
"swagger" |
URL prefix for Swagger UI |
Usage Examples
With API Versioning
builder.Services
.AddRepletoryVersioning()
.AddRepletorySwagger();
// Generates /swagger/v1/swagger.json and /swagger/v2/swagger.json
JWT Authentication in Swagger UI
The JWT Bearer security scheme is automatically added. Click "Authorize" in the Swagger UI and paste your JWT token (without "Bearer" prefix).
Passing Assembly for XML Docs
builder.Services.AddRepletorySwagger(callingAssembly: typeof(Program).Assembly);
Integration with Other RepletoryLib Packages
| Package | Relationship |
|---|---|
RepletoryLib.Common |
Direct dependency |
RepletoryLib.Api.Versioning |
Generates per-version Swagger documents |
RepletoryLib.Auth.Jwt |
JWT auth button in Swagger UI |
License
This project is licensed under the MIT License.
Copyright (c) 2024-2026 Repletory.
For complete documentation, infrastructure setup, and configuration reference, see the RepletoryLib main repository.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Asp.Versioning.Mvc.ApiExplorer (>= 8.1.0)
- RepletoryLib.Common (>= 1.0.0)
- Swashbuckle.AspNetCore (>= 7.2.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.0 | 149 | 3/2/2026 |