jhthorsen / json-validator

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

validation fails on an attribute that has nullable: true if there is also an enum #256

Closed mschout closed 2 years ago

mschout commented 2 years ago

Steps to reproduce the behavior

Schema validation is rejected for a nullable: true item if it has an enum

Expected behavior

The schema should be considered valid with a null value even if it has an enum if nullable: true is also present.

Actual behavior

The schema validation fails.

I will make a PR to address this later this evening -- I ran out of time.

jhthorsen commented 2 years ago

Please choose the correct label: draft4, ... openapi2/3. It's impossible to solve this issue when there's no example schema or schema version to work with.

jhthorsen commented 2 years ago

I'm going to close this, since #257 will be merged sooner or later...

mschout commented 2 years ago

Please choose the correct label: draft4, ... openapi2/3. It's impossible to solve this issue when there's no example schema or schema version to work with.

Sorry, example schema was in the PR :)