Skip to content
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

Support for extends? #31

Closed
vanthome opened this issue Feb 6, 2013 · 6 comments
Closed

Support for extends? #31

vanthome opened this issue Feb 6, 2013 · 6 comments

Comments

@vanthome
Copy link

vanthome commented Feb 6, 2013

Hi,
I'm currently comparing some JSON Schema validators and would like to know whether you support the extends attribute for schema "inheritance"
Thanks

@awwright
Copy link
Collaborator

awwright commented Feb 7, 2013

extends probably doesn't do what you think it does. It's actually implemented wrong in the library right now. According to the specification, extends takes an array of additional schemas to validate against. In v4, it was renamed to allOf, so if you'd like this functionality, use that instead, which is implemented correctly. Using extends should be considered deprecated.

Is this what you were looking for?

@vanthome
Copy link
Author

vanthome commented Feb 9, 2013

Hi, I look for a functionality which allows me to inherit certain common attributes from something like a base schema to multiple other schemas -- think inheritance.
I just researched a bit and I think you're completely right... in v4 terms what I'm seeking for is "allOf."
Is this already supported by this lib?

@awwright
Copy link
Collaborator

awwright commented Feb 9, 2013

Yes, this is in the current master branch, as is anyOf and oneOf. We still need some documentation to describe that fact, which will come along with more v4 features sometime soon.

@vanthome
Copy link
Author

Maybe join forces with this effort I've found yesterday:
https://github.com/geraintluff/tv4
?

@awwright
Copy link
Collaborator

To accomplish what? If you're looking for other specific functionality, then you should probably open a new issue. And if you've found the functionality you were originally looking for, you should probably close this one.

@vanthome
Copy link
Author

This was just a hint that there are other efforts to implement a v4 compatible validator.
I close this.
Many thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants