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
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="RepletoryLib.Api.Swagger" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="RepletoryLib.Api.Swagger" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="RepletoryLib.Api.Swagger" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add RepletoryLib.Api.Swagger --version 1.0.0
                    
#r "nuget: RepletoryLib.Api.Swagger, 1.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package RepletoryLib.Api.Swagger@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=RepletoryLib.Api.Swagger&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=RepletoryLib.Api.Swagger&version=1.0.0
                    
Install as a Cake Tool

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.

NuGet .NET 10 License: MIT


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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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