-
-
Notifications
You must be signed in to change notification settings - Fork 873
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
if/then false positive when if-property is undefined. #2439
Comments
Reproduction:
|
Hi @LazerJesus, thanks for brining this to our attention. After playing around with your example for a bit it does indeed look like a bug to me. I can even pass an empty object and it still complains about missing |
schema in "if" says that when verbForm is present it should be "fin" but it doesn't require that it's present. So in the absense of verbForm the schema in "if" passes validation, and schema in "then" is applied.
That's exactly how JSON schema spec is supposed to work 🤷♂️ If you make this property required, it will be "false", but it's not implied. |
Ah yes of course, I was thrown by the fact that the outer schema has
|
Indeed that solves it. thank you for the information. i must say tho, that its very counterintuitive and seems to conflict with logic. that being said, ill just add the qualifier and thats that ✌️ all the best |
I define this schema of an annotation object.
I pass the following annotation:
{ pos: 'verb' }
I expect only 1 error of 'required verbform`.
but also i get this error:
meaning that the
if: { properties: { verbform: { const: "fin" } } }
is somehow true for{ pos: 'verb' }
?!The text was updated successfully, but these errors were encountered: