Acontplus.ApiDocumentation
1.0.6
See the version list below for details.
dotnet add package Acontplus.ApiDocumentation --version 1.0.6
NuGet\Install-Package Acontplus.ApiDocumentation -Version 1.0.6
<PackageReference Include="Acontplus.ApiDocumentation" Version="1.0.6" />
<PackageVersion Include="Acontplus.ApiDocumentation" Version="1.0.6" />
<PackageReference Include="Acontplus.ApiDocumentation" />
paket add Acontplus.ApiDocumentation --version 1.0.6
#r "nuget: Acontplus.ApiDocumentation, 1.0.6"
#:package Acontplus.ApiDocumentation@1.0.6
#addin nuget:?package=Acontplus.ApiDocumentation&version=1.0.6
#tool nuget:?package=Acontplus.ApiDocumentation&version=1.0.6
Acontplus.ApiDocumentation
A .NET 9+ library for standardized API versioning and OpenAPI/Swagger documentation. Supports both controller-based and minimal APIs, with advanced customization and versioning support.
🚀 Features
- API Versioning - Flexible, multi-version API support
- Swagger/OpenAPI UI - Beautiful, customizable API docs
- Minimal & Controller API Support - Works with both paradigms
- JWT Bearer Auth UI - Secure your APIs and test with tokens
- XML Comments - Show your code docs in Swagger UI
- Custom Metadata - Configure contact, license, and more from
appsettings.json - .NET 9+ Ready - Fast and future-proof
📦 Installation
dotnet add package Acontplus.ApiDocumentation
🎯 Quick Start (Controller-based API)
Enable XML Documentation in your
.csproj:<GenerateDocumentationFile>true</GenerateDocumentationFile>Add SwaggerInfo to
appsettings.json:"SwaggerInfo": { "ContactName": "Acontplus Development Team", "ContactEmail": "proyectos@acontplus.com", "ContactUrl": "https://www.acontplus.com", "LicenseName": "MIT License", "LicenseUrl": "https://opensource.org/licenses/MIT" }Register services in
Program.cs:using Acontplus.ApiDocumentation; var builder = WebApplication.CreateBuilder(args); builder.Services.AddControllers(); builder.Services.AddApiVersioningAndDocumentation(); var app = builder.Build(); if (app.Environment.IsDevelopment()) { app.UseApiVersioningAndDocumentation(); } app.UseHttpsRedirection(); app.UseAuthorization(); app.MapControllers(); app.Run();
🎯 Quick Start (Minimal API)
Add the package:
dotnet add package Microsoft.AspNetCore.OpenApiRegister OpenAPI in
Program.cs:var builder = WebApplication.CreateBuilder(args); builder.Services.AddOpenApi(); var app = builder.Build(); if (app.Environment.IsDevelopment()) { app.MapOpenApi(); } app.MapGet("/", () => "Hello world!"); app.Run();
🗂️ API Versioning Example
[ApiController]
[Route("api/v{version:apiVersion}/[controller]")]
[ApiVersion("1.0")]
public class DataController : ControllerBase
{
[HttpGet]
public string Get() => "This is response from API version 1.0";
}
⚡ Migration & Troubleshooting Notes
- Do NOT reference
Microsoft.OpenApidirectly.- For controller-based APIs, use
Swashbuckle.AspNetCore.SwaggerGenandSwashbuckle.AspNetCore.SwaggerUIonly. These packages bring the correct OpenAPI model types. - For minimal APIs, use
Microsoft.AspNetCore.OpenApi.
- For controller-based APIs, use
- If you see errors like
The type or namespace name 'OpenApiInfo' could not be found:- Make sure you have not added
Microsoft.OpenApidirectly. - Ensure you have the following using statement:
using Microsoft.OpenApi.Models; - Swashbuckle will bring in the correct version of
Microsoft.OpenApi.Models.
- Make sure you have not added
- For advanced UI and controller-based APIs, continue using Swashbuckle (
AddSwaggerGen,UseSwaggerUI). - For minimal APIs, use the new built-in OpenAPI support in .NET 9+.
🛠️ Advanced Customization
- Custom Swagger Info: Edit the
SwaggerInfosection inappsettings.json. - JWT Bearer Auth: UI is pre-configured for Bearer tokens.
- Multiple API Versions: Decorate controllers with
[ApiVersion]and use versioned routes. - XML Comments: Enable in
.csprojfor rich documentation.
📄 License & Info
- License: MIT
- Authors: Ivan Paz
- Company: Acontplus
- Repository: github.com/Acontplus-S-A-S/acontplus-dotnet-libs
- Contact: proyectos@acontplus.com
© 2024 Acontplus All rights reserved.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. 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. |
-
net9.0
- Asp.Versioning.Mvc (>= 8.1.0)
- Asp.Versioning.Mvc.ApiExplorer (>= 8.1.0)
- Swashbuckle.AspNetCore.SwaggerGen (>= 9.0.6)
- Swashbuckle.AspNetCore.SwaggerUI (>= 9.0.6)
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.2.2 | 102 | 3/26/2026 |
| 1.2.1 | 135 | 3/17/2026 |
| 1.2.0 | 120 | 3/1/2026 |
| 1.1.3 | 108 | 2/22/2026 |
| 1.1.2 | 129 | 1/1/2026 |
| 1.1.1 | 206 | 12/23/2025 |
| 1.1.0 | 229 | 11/23/2025 |
| 1.0.6 | 223 | 10/23/2025 |
| 1.0.5 | 235 | 9/3/2025 |
| 1.0.4 | 150 | 7/11/2025 |
| 1.0.3 | 131 | 7/11/2025 |
| 1.0.2 | 179 | 7/9/2025 |
| 1.0.1 | 199 | 6/30/2025 |
| 1.0.0 | 187 | 6/30/2025 |
Enhanced with contemporary API documentation patterns, comprehensive OpenAPI/Swagger integration, advanced API versioning support for controller-based and minimal APIs, and enterprise-ready documentation solutions for ASP.NET Core applications.