jhthorsen / json-validator

:cop: Validate data against a JSON schema
https://metacpan.org/release/JSON-Validator
57 stars 59 forks source link

enum check is failing for array item property #69

Closed foobargeez closed 7 years ago

foobargeez commented 7 years ago

Schema:

{
   "required" : [
      "update"
   ],
   "type" : "object",
   "properties" : {
      "update" : {
         "maxItems" : 1,
         "type" : "array",
         "minItems" : 1,
         "items" : [
            {
               "enum" : [
                  "haha"
               ],
               "type" : "string"
            }
         ]
      }
   }
}

Input:

{"update": ["hah"]}

Tested against http://www.jsonschemavalidator.net/ and it's throwing errors as expected but the Perl module does not.

Thanks in advance!

jhthorsen commented 7 years ago

Thanks for reporting in! 👍

This should be fixed in version 1.02 - soon available on CPAN.