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.
Currently, Swashbuckle automatically generates
oneOf
schema for types that have descendants. This is not the wanted behaviour in some endpoints like/states/current
whereStateDto
is the response type butPastStateDto
, 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.