Closed falkenhawk closed 6 years ago
patch
attempts to ignore required properties, but it doesn't handle if
yet. I'll try to fix this.
@unhawkable I just released 1.1.7. This should be fixed in it.
Thank you. Your level of support is far beyond any expectations. 🥇
As a side note, do you think also "else" keyword should be added to subSchemaProps? And there is also a special property "dependencies" which can contain "required" prop in it, but can also take a short form of "dependencies": { "foo": ["bar"] }
more about it: https://stackoverflow.com/a/38781027
@unhawkable Thanks for the kind words!
I already added "else" to the list. Thanks for the tip about "dependencies". I'll see what I can do about that one.
I am getting a validation error when using if-then-else conditionals in jsonSchema. But not on insert, but only on patch() so far. I am not sure if it's a bug in objection or maybe in ajv? Tested on v1.0.0 and v1.1.6. Only downgrading to v0.9.4 fixes the error, but I am not sure then if if-then-else conditionals are checked in that version at all.
Reproduction case below. It seems that firstName null somehow meets the if firstName = 'Test' condition...