eclipsesource/play-json-schema-validator

Double.Min|Max values do not trigger an error for integer type property

Closed this issue · 2 comments

Hi,

I have applied your fix for int32|int64 formats. Works great now.

Now about doubles :) I have spotted in tests that the following instance (magic number is Double.Max):

{
    "prop" : 1.7976931348623157E+308
}

is validated successfully against the schema:

  {
    "type" : "object",
    "properties" : {
      "prop" : {
        "type" : "integer"
      }
    }
  }

expected result is failure on validation. The similar issue exists for Double.Min.

I'm unsure about this since the validator currently validates numbers against the integer type successfully if they are whole. This relates to the same question whether { "prop": 1.0 } should validate, which is the case right now. There has been quite the discussion about this in the past, see here. I think I'd prefer to stick with the current behaviour. Do you have any objections?