You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In cases where objects are validated against values, any keys are allowed. If a value is dependent on another nested inside an object, the requiredIf or requiredIfNot rules use dot notation for finding the target value (requiredIfNot: 'rootObj.someVal'). This requires a user to explicitly declare the key name in the model definition, which does not play well with dynamic keys.
constmodel=obey.model({admin: {type: 'object',values: {type: 'object',required: true,keys: {valA: {type: 'string',requiredIfNot: 'valB'// This would check for a top-level valB prop,},// instead of the intended admin.<whateverKey>.valBvalB: {type: 'string',requiredIfNot: 'valA'// and vice versa}}}}})
The text was updated successfully, but these errors were encountered:
In cases where objects are validated against values, any keys are allowed. If a value is dependent on another nested inside an object, the
requiredIf
orrequiredIfNot
rules use dot notation for finding the target value (requiredIfNot: 'rootObj.someVal'
). This requires a user to explicitly declare the key name in the model definition, which does not play well with dynamic keys.The text was updated successfully, but these errors were encountered: