Skip to content

Comments

Nested Schema Validation#47

Open
clark0x wants to merge 13 commits intosailshq:masterfrom
clark0x:nested-schema
Open

Nested Schema Validation#47
clark0x wants to merge 13 commits intosailshq:masterfrom
clark0x:nested-schema

Conversation

@clark0x
Copy link

@clark0x clark0x commented May 26, 2014

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 old matchType.js and changed anchor.prototype.to() slightly. So it should be backward compatible: this PR pass all old anchor tests , sails#master tests and waterline#master tests, without changes.

But to make nested schema validation works, request.validate() and Model#validate() have to change the way of using anchor.prototype.to(). The former is quite simple, I'll send a PR on sails. The later is too complex, that's why I ensure it backward compatible.

@mikermcneil
Copy link
Member

another awesome PR from @clarkorz™

Thanks man. Will look as soon as I have a chance, slammed this week.

@FabricioFFC
Copy link

@mikermcneil will this PR be accepted? it's an excellent contribution!

@mikermcneil
Copy link
Member

@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

@elennaro
Copy link

when are you going to merge this?

@Eitz
Copy link

Eitz commented Mar 17, 2021

@elennaro

when are you going to merge this?

Maybe in a few years? 😢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

5 participants