Closed nikos closed 12 years ago
It seems to me like JSV takes only the very first union constraint for validation, but not any subsequent. My JSON schema definition looks like ...
{ "type":"object", "additionalProperties":false, "properties":{ "imgs":{ "type":"array", "title":"Images", "items":[ { "type":"object", "additionalProperties":false, "properties":{ "image_url":{ "title":"Image (intern)", "type":"string", "format":"uri" } } }, { "type":"object", "additionalProperties":false, "properties":{ "flickr_url":{ "title":"Image (flickr)", "type":"string", "format":"uri" } } } ] } } }
It is fine for
{ "imgs":[ {"image_url":"http://example.org"} ] }
but not
{ "imgs":[ {"flickr_url":"http://example.org"} ] }
Any help would on this would be very much appreciated, thanks for your time, Niko
The array version of "items" is tuple typing. You need to use "additionalItems" along with union types.
It seems to me like JSV takes only the very first union constraint for validation, but not any subsequent. My JSON schema definition looks like ...
It is fine for
but not
Any help would on this would be very much appreciated, thanks for your time, Niko