voxpupuli / json-schema

Ruby JSON Schema Validator
MIT License
1.52k stars 241 forks source link

Bug: Integer & Number exclusive restrictions not working #473

Open bhargavrpatel opened 1 year ago

bhargavrpatel commented 1 year ago

Context I am not seeing a failure on exclusive minimum and exclusive maximum restrictions.

How to reproduce

schema = {
  "properties" => {
    "rank" => {
      "type" => "integer",
      "description" => "Rank of the object",
      "exclusiveMinimum" => 1,
    }
  },
  "required": ["rank"]
}

JSON::Validator.validate!(schema, {"rank" => 1}, strict: true)
# => true

Expectation This should have failed per other schema validators

image