How propertyDependencies works with objects and values
masterThe propertyDependencies keyword defines dependencies between properties in an object. It is important to note the following behaviors:
- Object Requirement:
propertyDependenciesonly acts on data that is a non-array object. If the data being validated is not an object, the dependency rules are not applied. - Value Matching: The dependency logic triggers based on the value of the dependent property. If the value of the property (e.g.,
foo) does not match the key specified in the dependency map (e.g.,bar), the rules are not applied. In the provided examples, iffoois not equal to the target value, the validation logic for that dependency is skipped.
{ "propertyDependencies": { "foo": { "bar": false } } }