-
-
Notifications
You must be signed in to change notification settings - Fork 242
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
Fail on ruby 1.9.3, jruby 1.6.8 --1.9 #45
Comments
Is this still an issue? I haven't been able to reproduce on the current master release on either JRuby or MRI 1.9.3 |
Hey @hoxworth Following an example from the docs, the following works: schema = {
type: 'object',
"required" => ["a"],
properties: {
a: {type: "integer", default: 42},
b: {type: "integer"}
}
}
data = {
b: 5
}
is_valid = JSON::Validator.validate(schema, data) but when the "required" key is changed to use the new Hash syntax, the following fails (with a NoMethodError): schema = {
type: 'object',
required: ["a"], # <----- new Hash syntax
properties: {
a: {type: "integer", default: 42},
b: {type: "integer"}
}
}
data = {
b: 5
}
is_valid = JSON::Validator.validate(schema, data) The specific error is:
Ruby info:ruby 1.9.3p429 (2013-05-15 revision 40747) [x86_64-darwin12.3.0] Gem info: json-schema (2.1.1) |
Thanks @laser , will start taking a look at this soon. |
Yeah... the library was written to assume string keys in the schema. I'll add a todo to add indifferent access; this affects other keywords, like |
Just push version 2.1.2 that should fix this issue, as well as other symbol -> string issues. Thanks. |
json-schema 1.0.9 fails to validate on 1.9 rubies with:
The text was updated successfully, but these errors were encountered: