[FEATURE] Support the discriminator
keyword properly
#1589
Labels
Status: Needs Triage
Requires initial assessment to categorize and prioritize
Is your feature request related to a problem? Please describe.
Schemathesis does not use
discriminator
at all, but it has certain behavior in OAS 3.0. Specifically:and
If these aspects are applied, then some responses previously considered invalid will be valid. Though, as the latter case uses "MAY", the current behavior of Schemathesis is OK in this regard (the former case, should be implemented anyway)
Describe the solution you'd like
Schemathesis uses
discriminator
to shortcut to the right schema instead of running the regular JSON Schema validation. It would be hard to do it dynamically, as schemas are recursive and I don't want to hook into the validation process. Instead, I think it could be emulated withif
&anyOf
:Or just with
if
/then
/else
, which may produce better error messages. Not sure yetAdditional context
I missed a couple of aspects of the Open API spec in this regard
The text was updated successfully, but these errors were encountered: