Closed okitan closed 8 years ago
@okitan Nice catch! Thanks :)
The one problem is that I don't think that the validator is going to handle the object properly as is currently written.
I guess the validator works fine, because additional_items works only when its value is false.
https://github.com/brandur/json_schema/blob/master/lib/json_schema/validator.rb#L242
I guess the validator works fine, because additional_items works only when its value is false.
Oh right. But I meant that I don't think it'll do the right thing when additionalItems
is a schema. Is that your reading as well?
Sure, what I meant is the current behavior of this gem is as per spec.
http://json-schema.org/latest/json-schema-validation.html#anchor37
if the value of "additionalItems" is boolean value true or an object, validation of the instance always succeeds;
@okitan Oh what?! So am I reading this right in that an additionalItems
that's a schema basically just does the same as a boolean true value? Nice catch :)
Alright, going to pull this in then! Thanks.
Released as 0.12.4.
Thanks!
See: https://github.com/okitan/json_schema/blob/master/schemas/schema.json#L70-L76