← ClaudeAtlas

swagger-dotnetlisted

Swashbuckle and NSwag for ASP.NET Core API documentation. Covers XML comments, operation filters, and OpenAPI customization. USE WHEN: user mentions "Swagger", "Swashbuckle", "NSwag", ".NET OpenAPI", "API documentation", "Swagger UI", ".NET API docs" DO NOT USE FOR: Springdoc OpenAPI - use `springdoc-openapi`, generic OpenAPI spec - use `openapi`
claude-dev-suite/claude-dev-suite · ★ 33 · AI & Automation · score 80
Install: claude install-skill claude-dev-suite/claude-dev-suite
# Swagger for .NET - Quick Reference > **Deep Knowledge**: Use `mcp__documentation__fetch_docs` with technology: `aspnet-core` for OpenAPI documentation. ## Swashbuckle Setup ```csharp // Program.cs builder.Services.AddEndpointsApiExplorer(); builder.Services.AddSwaggerGen(options => { options.SwaggerDoc("v1", new OpenApiInfo { Title = "My API", Version = "v1", Description = "API for managing users and orders", }); // XML comments var xmlFile = $"{Assembly.GetExecutingAssembly().GetName().Name}.xml"; var xmlPath = Path.Combine(AppContext.BaseDirectory, xmlFile); options.IncludeXmlComments(xmlPath); // JWT auth in Swagger UI options.AddSecurityDefinition("Bearer", new OpenApiSecurityScheme { In = ParameterLocation.Header, Description = "Enter JWT token", Name = "Authorization", Type = SecuritySchemeType.Http, BearerFormat = "JWT", Scheme = "bearer", }); options.AddSecurityRequirement(new OpenApiSecurityRequirement { { new OpenApiSecurityScheme { Reference = new OpenApiReference { Type = ReferenceType.SecurityScheme, Id = "Bearer", } }, Array.Empty<string>() } }); }); // Enable XML docs in .csproj // <GenerateDocumentationFile>true</GenerateDocumentationFile> ``` ## Controller Annotations ```csh