su-fit-vut / kachna-online

Students' Club U Kachničky: Member's portal
MIT License
5 stars 5 forks source link

Add option to adjust how Swashbuckle handles inheritance-based schema references #12

Open ondryaso opened 2 years ago

ondryaso commented 2 years ago

Currently, Swashbuckle automatically generates oneOf schema for types that have descendants. This is not the wanted behaviour in some endpoints like /states/current where StateDto is the response type but PastStateDto, its descendant, may never be returned.

An attribute and a Swashbuckle filter should be implemented that allow adjustment of the OpenAPI generator behaviour in situations like this.