json-schema
json-schema copied to clipboard
Attribute uniqueItem: false should not trigger validation
Hi, I encounter a problem with json-schema. Given the following spec:
require "json-schema"
schema = {
"type" => "object",
"required" => ["target"],
"properties" => {
"target" => {
"type" => "array",
"items" => {},
"uniqueItems" => false,
}
}
}
data = { "target" => [1, 1] }
JSON::Validator.fully_validate(schema, data)
# => ["The property '#/target' contained duplicated array values in schema 4d32e7eb-0393-5de4-81f2-37eecb8cc064"]
In my opinion and according to the json schema spec, it should validate only if set to true
.