Skip to content

Parameter Filter Is Not Called If Operation Was Created From OpenApi Metadata #2613

@warappa

Description

@warappa

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(...),...

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

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions