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

Should we support draft-v3-valid but draft-v4-invalid JSON schema? #11

Open
astj opened this issue Jan 1, 2016 · 2 comments
Open

Should we support draft-v3-valid but draft-v4-invalid JSON schema? #11

astj opened this issue Jan 1, 2016 · 2 comments

Comments

@astj
Copy link
Collaborator

astj commented Jan 1, 2016

Now I'm working for #9.

From draft v3 to draft v4 (draft-00?), some definitions are changed. http://json-schema.org/latest/json-schema-validation.html#anchor145

For example, behavior of dependencies changed in draft v4.

"dependencies" member values can no longer be single strings; at least one element is required in a property dependency array.

If we implement validator of draft v4's dependencies strictly, dependencies with single strings value schema (which is draft-v3-valid) should be invalid JSON schema.

Maybe we have 3 choices.

  • Implement for draft v4 (or newest draft). Don't think about older draft.
  • Accept both draft-v4-valid schema and draft-v3-valid schema (as long as we can)
  • Add some option to work with draft v3 compatibility mode.

IMO the first one seems best. How do you think? > @hitode909 @pokutuna FYI @aereal

@hitode909
Copy link
Collaborator

@astj

Implement for draft v4 (or newest draft). Don't think about older draft.

I think this plan is best, too.

Add some option to work with draft v3 compatibility mode.

We can implement it in phase 2.

@hitode909
Copy link
Collaborator

ruby-json-schema has a option, like this.

JSON::Validator.validate(schema, data, :version => :draft2)

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