-
-
Notifications
You must be signed in to change notification settings - Fork 886
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
Discriminator logic will not dereference schemas before validating preconditions #1554
Labels
Comments
Bumping into a similar (?) issue as well. Even if you embed the schema but you use compound keyword, it will throw a validation error. Will work:
Wont work:
|
dfeufel
added a commit
to dfeufel/ajv
that referenced
this issue
Nov 12, 2021
epoberezkin
added a commit
that referenced
this issue
Jan 15, 2022
* resolve references before validating the discriminator fixes #1554 * prettier style * adjust according to comments, add some doc * resolve schema from SchemaEnv * simplify code, change comment * add import * Update lib/vocabularies/discriminator/index.ts * let to conts * Update lib/vocabularies/discriminator/index.ts * update error message * fix regexp in the test Co-authored-by: Evgeny Poberezkin <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What version of Ajv you are you using?
8.0.5
What problem do you want to solve?
Defer the evaluation of precondition checks on
discriminator
s after dereferencing$ref
s. Currently, a schema will fail validation if the list ofoneOf
children contains a referenced schema instead of an embedded schema.See:
ajv/lib/vocabularies/discriminator/index.ts
Lines 64 to 72 in baf1475
What do you think is the correct solution to problem?
The preconditions for
discriminator
support should be deferred.Will you be able to implement it?
I don't think so. 😬
The text was updated successfully, but these errors were encountered: