ExodusMovement / schemasafe

A reasonably safe JSON Schema validator with draft-04/06/07/2019-09/2020-12 support.
https://npmjs.com/@exodus/schemasafe
MIT License
156 stars 12 forks source link

Skip `property` existance check when validated by `required` #79

Closed ChALkeR closed 4 years ago

ChALkeR commented 4 years ago

For now, this works only 'properies' rule that has a sibling 'required' rule, and only in allErrors = false mode.

In that case, we can be sure that some properties existence is already checked by sibling required rule, so we don't have to re-check it in properties rule before doing further value validation.

This simplifies generated code for any required + properties combination which we'll use a lot.