TaskHub.Shared.Swagger
Unified OpenAPI/Swagger configuration for TaskHub microservices.
Contents
Summary
- Pre-configured Swagger UI with JWT Bearer support.
- Automatic version discovery.
- Consistent API documentation across the ecosystem.
This module provides a consistent Swagger/OpenAPI setup across all TaskHub services, ensuring that API documentation is professional and easy to use.
Features
- Security Schemes: Automatically adds a “Bearer” token input to the Swagger UI if JWT is enabled.
- Versioning: Integrated with the Versioning module to support multiple API versions in the documentation.
- Filters: Custom filters to handle common TaskHub.Shared patterns (like Results).
Usage
builder.Services.AddAppSwagger(builder.Configuration.GetSection("Swagger").Bind);
In BuildApp():
app.UseSwagger();
app.UseAppSwaggerUI(builder.Configuration.GetSection("Swagger").Bind);