Mastering Polymorphic OpenAPI Responses with oneOf & Discriminator
When an API returns different event shapes, documenting them clearly is hard. This post shows how OpenAPI 3.x’s oneOf and discriminator can model such polymorphic responses, with a live example, trade‑offs, and best‑practice checklist.