Modeling Polymorphic Responses in OpenAPI 3.1 with Discriminators
An API that returns different shapes for the same endpoint forces clients to guess. A discriminator in OpenAPI 3.1 makes polymorphic responses explicit by naming a property that selects the concrete subtype in a oneOf composition.