Support discriminator for response object selection
#523
Replies: 3 comments 1 reply
-
|
Support for the discriminator keyword needs to happen in two places:
Implementing in 1 is possible, 2... is tricky. One idea would be trying to convert discriminator to if/then/else in https://github.com/mikunn/openapi-schema-to-json-schema/ |
Beta Was this translation helpful? Give feedback.
-
|
This is on hold until we figure out if discriminator is going to be deprecated or not. OAI/OpenAPI-Specification#2143 |
Beta Was this translation helpful? Give feedback.
-
|
Any updates here guys? The dsiscriminator is not going to be deprecated in OpenAPI spec 3.0 any time near soon. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
User story.
As an API designer, I want to define more generalized APIs that have nearly identical semantics, but have different response objects based on a path parameter, detailed by the
discriminatorproperty.Is your feature request related to a problem?
The current mock server randomly chooses a schema (x or y), regardless of the value of {dataset} (see example below). Also, currently, when a full example is defined for one of the response types, only that response is used in mock responses. I would have expected continued random selection between the 2 example schemas.
Describe the solution you'd like
Support for
discriminatorin general.Additional context
e.g.
Beta Was this translation helpful? Give feedback.
All reactions