Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Derived class is not using the base class schema filter #1197

Open
OskarKlintrot opened this issue Nov 30, 2017 · 3 comments · May be fixed by #1199
Open

Derived class is not using the base class schema filter #1197

OskarKlintrot opened this issue Nov 30, 2017 · 3 comments · May be fixed by #1199

Comments

@OskarKlintrot
Copy link

OskarKlintrot commented Nov 30, 2017

VERSION:

5.6.0

STEPS TO REPRODUCE:

Create a base class with a SwaggerSchemaFilter-attribute.

EXPECTED RESULT:

Classes inheriting the base class should be leveraging the same schema filter as the base class.

ACTUAL RESULT:

The schema filter is ignored on the derived class.

ADDITIONAL DETAILS

To put it in context; I have a JsonConverter that turns a class with a single IEnumerable property into an json array instead of a json object. I want to create an abstract base class that has both the JsonConverter-attribute as well as the SwaggerSchemaFilter-attribute on it. Then all that is need is to derive from SingleJsonArrayResponse<T> in order for both the serialized json and the Swagger example to be correct.

Is this by design, an anti pattern or an actual bug?

@heldersepu
Copy link
Contributor

Do you have a minimal project reproducing this issue?

@OskarKlintrot
Copy link
Author

@heldersepu
Copy link
Contributor

heldersepu commented Nov 30, 2017

Initially it looked like all we needed was to change a false to true:
https://github.com/domaindrivendev/Swashbuckle/blob/master/Swashbuckle.Core/Swagger/Annotations/ApplySwaggerSchemaFilterAttributes.cs#L11
but that still not working...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants