VoliJS / Type-R

Reactive and serializable objects with transactional changes.
MIT License
51 stars 8 forks source link

document isValid check recursively related object validations #55

Open al-oath opened 5 years ago

al-oath commented 5 years ago

Need to add some ability to check only one level of specific object and not check recursively to other keys related object validations.

On save button we set the disabled property by ### !{document}.isValid() the problem is that the validation check recursively and propagating to other related object keys of type other document, and if there there is an validation error ... this isValid method return error, even if in this specific document object everything is ok.

For example, assume you have Order object that have key = "creatdBy", the createdBy is id of User object that have an isRequired key that not valid, so even if in this specific Order object everything is ok, but under the related User object there is something wrong ... so the Order.isValid() return false.