Loading...
question api openapi June 23, 2025 How to define conditional payloads and responses in OpenAPI spec?

OpenAPI (especially v3.1) does support conditional request/response schemas based on parameters in the payload — using oneOf, anyOf, discriminator, or JSON Schema if / then / else (in v3.1 only).

Like my work?

Please, feel free to reach out. I would be more than happy to chat.