Handling Polymorphic JSON in OpenAPI with the Discriminator Keyword
OpenAPI's discriminator keyword lets you model polymorphic payloads—like multiple payment methods—in a single schema. This post shows how to define the mapping, see it work in Swagger UI, and generate type-safe clients without custom validation code.