Closed kool79 closed 9 months ago
The official test is caled "a float with zero fractional part is an integer"
This seems to suggest that b: 5.0
should pass.
Thanks for link. Actually it is not logical from many points of views, but standard is the standard, even if it is not logical.
By the way, with other library I used {type: number, multipleOf: 1.0} for 5.0 and {type: integer} for 5
Specifications (since draft-6) say (https://json-schema.org/draft/2020-12/draft-bhutton-json-schema-01#name-mathematical-integers): For consistency, integer JSON numbers SHOULD NOT be encoded with a fractional part. (should not == not recommended) But both the properties in json below matches to
{"type": "integer"}
while the only integer property is the "a" Note thal library works in expected way when I select draft-3 or draft-4 here: https://tryjsonschematypes.appspot.com/#validate