Agent skill
swagger
Configure Swagger/OpenAPI documentation for affolterNET.Web.Api. Use when setting up API documentation, customizing Swagger UI, or configuring OpenAPI metadata.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/documents/swagger-mcafee123-affolternet-web
SKILL.md
Swagger/OpenAPI Configuration
Configure Swagger/OpenAPI documentation for your API.
For complete reference, see Library Guide.
Quick Start
appsettings.json
{
"affolterNET": {
"Web": {
"Swagger": {
"Enabled": true,
"Title": "My API",
"Version": "v1",
"Description": "API documentation for My Application"
}
}
}
}
Configuration Options
SwaggerOptions
| Property | Type | Default | Description |
|---|---|---|---|
Enabled |
bool | true (dev) |
Enable Swagger UI and endpoint |
Title |
string | "API" |
API title in Swagger UI |
Version |
string | "v1" |
API version |
Description |
string | null |
API description |
RoutePrefix |
string | "swagger" |
URL prefix for Swagger UI |
Common Patterns
Development Only
{
"affolterNET": {
"Web": {
"Swagger": {
"Enabled": true
}
}
}
}
In production, set Enabled to false or remove the configuration.
Custom Route
{
"affolterNET": {
"Web": {
"Swagger": {
"Enabled": true,
"RoutePrefix": "api-docs"
}
}
}
}
Access at: https://your-api.com/api-docs
With Authentication
When authentication is enabled, Swagger UI will include the authorization header configuration for testing authenticated endpoints.
Controller Documentation
Use XML comments for API documentation:
/// <summary>
/// Gets all users
/// </summary>
/// <returns>List of users</returns>
/// <response code="200">Returns the list of users</response>
/// <response code="401">Unauthorized</response>
[HttpGet]
[ProducesResponseType(typeof(List<User>), 200)]
[ProducesResponseType(401)]
public IActionResult GetUsers() { ... }
Enable XML documentation in your .csproj:
<PropertyGroup>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<NoWarn>$(NoWarn);1591</NoWarn>
</PropertyGroup>
Troubleshooting
Swagger UI not loading
- Verify
Enabledistruein configuration - Check the
RoutePrefixmatches your expected URL - Ensure no middleware is blocking the Swagger routes
Missing endpoints
- Confirm controllers are properly registered
- Check that routes are correctly attributed
- Verify authorization doesn't block discovery
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?