-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Nested Schema Validation #47
base: master
Are you sure you want to change the base?
Conversation
another awesome PR from @clarkorz™ Thanks man. Will look as soon as I have a chance, slammed this week. |
@mikermcneil will this PR be accepted? it's an excellent contribution! |
@clarkorz we're working on a more flexible version of some of the basic type-checking here as part of the machine module in the node-machine project-- let me know what you think! Would be good to figure out a way to share some code between modules |
when are you going to merge this? |
Maybe in a few years? 😢 |
Currently, anchor works only for either type(nested type) or ruleset. But I really need nested schema check which combines type and ruleset (means, any type defined in nested type schema can be replace with a ruleset). This PR add Nested Schema Validation, and the code is based on a copy of
deepMatchType
, I only refactor the oldmatchType.js
and changedanchor.prototype.to()
slightly. So it should be backward compatible: this PR pass all old anchor tests ,sails#master
tests andwaterline#master
tests, without changes.But to make nested schema validation works,
request.validate()
andModel#validate()
have to change the way of usinganchor.prototype.to()
. The former is quite simple, I'll send a PR onsails
. The later is too complex, that's why I ensure it backward compatible.