Swashbuckle.AspNetCore
Swashbuckle.AspNetCore copied to clipboard
Swagger Generator Does Not Use All API Explorer Metadata
Overview
The implementation of SwaggerGenerator.cs should consider all relevant metadata provided by API explorers. The following information is not currently mapped in all NonBodyParameter scenarios:
- Required - this can be determined by location and by ApiParameterDescription.RouteInfo.IsOptional
- Description - this can be determined by ApiParameterDescription.ModelMetadata.Description, when available
- Default - this can be determined by ApiParameterDescription.RouteInfo.DefaultValue
Scenarios
There are undoubtedly numerous scenarios where this woudl be useful. In the case of API Versioning, this will enable discovered API version parameters to be injected into Swagger documents and the UI via its API explorer extensions without requiring additional configuration from service authors. Service authors must currently use custom IOperationFilter implementations to bridge this gap.