New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Erro in schema oneOf (discriminator) #458
Comments
@pmacaubas thanks for the issue. discriminator support is lacking. i have put together a PR that will handle top level discriminators with oneOf and anyOf. I'll get this merged in soon. will love to get your thoughts |
* chore: update change log * feat: add top level discriminator support #458 * validate one of * continue if no discriminator option available found
@pmacaubas initial discriminator support is available in here are some examples: |
…imascio#461) * chore: update change log * feat: add top level discriminator support cdimascio#458 * validate one of * continue if no discriminator option available found
Describe the bug
I tried to use oneOf and the error happened:
{
"message": "request.body should match exactly one schema in oneOf",
"errors": [
{
"path": ".body",
"message": "should match exactly one schema in oneOf",
"errorCode": "oneOf.openapi.validation"
}
]
}
To Reproduce
app.yaml
This example is the same code that is in OpenApi Specification.
Request
Response ERROR
Actual behavior
As listed above, the error happened and the schema doesn't validated, because i used oneOf :
This example is the same code that is in OpenApi Specification.
Expected behavior
I behavior expected is the same the specification for oneOf step:
https://swagger.io/docs/specification/data-models/oneof-anyof-allof-not
In the OpenApi Specification the body bellow is valid :
Examples and context
This example is the same code that is in OpenApi Specification.
https://swagger.io/docs/specification/data-models/oneof-anyof-allof-not
The text was updated successfully, but these errors were encountered: