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

Attribute uniqueItem: false should not trigger validation #461

Open
hfabre opened this issue Nov 4, 2021 · 0 comments
Open

Attribute uniqueItem: false should not trigger validation #461

hfabre opened this issue Nov 4, 2021 · 0 comments

Comments

@hfabre
Copy link

hfabre commented Nov 4, 2021

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.

@hfabre hfabre changed the title Attribute uniqueItem: false should trigger validation Attribute uniqueItem: false should not trigger validation Nov 4, 2021
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

1 participant