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

Validate json by schema name #37

Closed
index0h opened this issue May 7, 2014 · 4 comments
Closed

Validate json by schema name #37

index0h opened this issue May 7, 2014 · 4 comments
Labels

Comments

@index0h
Copy link

index0h commented May 7, 2014

Hi, is there ability to cache schema by setRemoteReference and next - validate by it's uri? For example:

ZSchema.setRemoteReference('http://localhost:1234/integer.json', fileContent);
ZSchema.validate(myJsonData, 'http://localhost:1234/integer.json', function () {...})

Cheers

@zaggino zaggino added the bug label May 12, 2014
@zaggino
Copy link
Owner

zaggino commented May 12, 2014

Not now but I can easily add this feature to the next version.

@whitlockjc
Copy link
Contributor

I think this could be useful too. Basically, if you have a tree of different schemas but would like to validate only a piece of it, being able to just specify the schema name/id and validate a document fragment against that schema would be great. This also means you could create one validator instance with all schemas and validate all or fragments with one instance instead of having to have one validator per schema name/id and manage all of those trees.

@zaggino
Copy link
Owner

zaggino commented Jun 15, 2014

npm http PUT https://registry.npmjs.org/z-schema
+ z-schema@2.4.8

This issue should be fixed now, it's logged in testcase
https://github.com/zaggino/z-schema/blob/master/test/issue_37.js

@zaggino
Copy link
Owner

zaggino commented Jul 26, 2014

@index0h can you please confirm this works for you and close this issue? Thanks

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

No branches or pull requests

3 participants