jhthorsen / json-validator

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

Differences between 3.0 and 3.1 #273

Open yewtc opened 4 months ago

yewtc commented 4 months ago

Steps to reproduce the behaviour

Valid 3.0.1 data is failing to validate,

Expected behavior

It should validate

Actual behavior

It doesn't.

Between 3.0 and 3.1 the meaning of exclusiveMinimum and exclusiveMaximum changed. The behaviour of the code is as for 3.1.

Versions of openapi before 3.1 used an older version of the JSON schema. Specifically it used to be that exclusiveMinmum was a boolean rather than a value. The effect is that pre 3.1 schemas are checked against "true" which equates to 1 in perl terms.