Swashbuckle.AspNetCore.Filters icon indicating copy to clipboard operation
Swashbuckle.AspNetCore.Filters copied to clipboard

Schema and Document filters stop working

Open PostImpatica opened this issue 1 year ago • 3 comments

using

"Swashbuckle.AspNetCore" Version="6.6.1" 
"Swashbuckle.AspNetCore.Annotations" Version="6.6.1" 
"Swashbuckle.AspNetCore.Filters" Version="8.0.2"

When I add options.ExampleFilters(); My Schema and Document filters stop working. Is there a trick to get these to play nice? Like in your test examples, the OperationFilter I have continues working though.

PostImpatica avatar May 20 '24 19:05 PostImpatica

Hmm, I dunno. Are you calling services.AddSwaggerExamplesFromAssemblyOf<MyExample>(); as per the Installation instructions in the Readme?

mattfrear avatar May 20 '24 21:05 mattfrear

@mattfrear Yes, I did that before builder.Services.AddSwaggerGen.

options.ExampleFilters(); works fine, it is just that it breaks my existing Schema and Document filters but doesn't break my existing OperationFilter.

PostImpatica avatar May 21 '24 16:05 PostImpatica

I don't know why my example filters would be breaking your schema and document filters - but, I have never used a schema or document filter.

I wonder, do you actually need my example filters? I don't use them any more, I use XML comment examples instead.

mattfrear avatar May 22 '24 04:05 mattfrear