-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Closed
Milestone
Description
Parameter filters are only executed if Swagger creates OpenApiOperation from scratch and not by metadata.
The SwaggerGenerator.GenerateOperation
calls GenerateOpenApiOperationFromMetadata(...)
to get an operation from metadata. If it got one, no filters except the operation filters will be called, because those are in the sub-call-trees of GenerateParameters(...)
, GenerateRequestBody(...)
,...
Swashbuckle.AspNetCore/src/Swashbuckle.AspNetCore.SwaggerGen/SwaggerGenerator/SwaggerGenerator.cs
Lines 208 to 216 in 8f363f7
operation ??= new OpenApiOperation | |
{ | |
Tags = GenerateOperationTags(apiDescription), | |
OperationId = _options.OperationIdSelector(apiDescription), | |
Parameters = GenerateParameters(apiDescription, schemaRepository), | |
RequestBody = GenerateRequestBody(apiDescription, schemaRepository), | |
Responses = GenerateResponses(apiDescription, schemaRepository), | |
Deprecated = apiDescription.CustomAttributes().OfType<ObsoleteAttribute>().Any() | |
}; |
Please support excuting all filters regardless if there is already openapi metadata available.
Metadata
Metadata
Assignees
Labels
No labels