diff --git a/src/main/java/com/networknt/schema/utils/JsonNodeUtil.java b/src/main/java/com/networknt/schema/utils/JsonNodeUtil.java index 549f8eb69..99fd6342c 100644 --- a/src/main/java/com/networknt/schema/utils/JsonNodeUtil.java +++ b/src/main/java/com/networknt/schema/utils/JsonNodeUtil.java @@ -48,7 +48,7 @@ public static boolean equalsToSchemaType(JsonNode node, JsonType schemaType, Jso if (schemaType == JsonType.NUMBER && nodeType == JsonType.INTEGER) { return true; } - if (schemaType == JsonType.INTEGER && nodeType == JsonType.NUMBER && 1.0 == node.asDouble() && V6_VALUE <= detectVersion(validationContext)) { + if (schemaType == JsonType.INTEGER && nodeType == JsonType.NUMBER && node.canConvertToExactIntegral() && V6_VALUE <= detectVersion(validationContext)) { return true; } diff --git a/src/test/java/com/networknt/schema/JsonSchemaTestSuiteTest.java b/src/test/java/com/networknt/schema/JsonSchemaTestSuiteTest.java index 5f8fa1f23..599769141 100644 --- a/src/test/java/com/networknt/schema/JsonSchemaTestSuiteTest.java +++ b/src/test/java/com/networknt/schema/JsonSchemaTestSuiteTest.java @@ -76,7 +76,6 @@ private void disableV202012Tests() { this.disabled.add(Paths.get("src/test/suite/tests/draft2020-12/dynamicRef.json")); this.disabled.add(Paths.get("src/test/suite/tests/draft2020-12/id.json")); this.disabled.add(Paths.get("src/test/suite/tests/draft2020-12/optional/cross-draft.json")); - this.disabled.add(Paths.get("src/test/suite/tests/draft2020-12/optional/float-overflow.json")); this.disabled.add(Paths.get("src/test/suite/tests/draft2020-12/optional/format-assertion.json")); this.disabled.add(Paths.get("src/test/suite/tests/draft2020-12/ref.json")); this.disabled.add(Paths.get("src/test/suite/tests/draft2020-12/refRemote.json")); @@ -88,7 +87,6 @@ private void disableV201909Tests() { this.disabled.add(Paths.get("src/test/suite/tests/draft2019-09/defs.json")); this.disabled.add(Paths.get("src/test/suite/tests/draft2019-09/id.json")); this.disabled.add(Paths.get("src/test/suite/tests/draft2019-09/optional/cross-draft.json")); - this.disabled.add(Paths.get("src/test/suite/tests/draft2019-09/optional/float-overflow.json")); this.disabled.add(Paths.get("src/test/suite/tests/draft2019-09/recursiveRef.json")); this.disabled.add(Paths.get("src/test/suite/tests/draft2019-09/ref.json")); this.disabled.add(Paths.get("src/test/suite/tests/draft2019-09/refRemote.json")); @@ -100,13 +98,11 @@ private void disableV7Tests() { this.disabled.add(Paths.get("src/test/suite/tests/draft7/defs.json")); this.disabled.add(Paths.get("src/test/suite/tests/draft7/optional/content.json")); this.disabled.add(Paths.get("src/test/suite/tests/draft7/optional/cross-draft.json")); - this.disabled.add(Paths.get("src/test/suite/tests/draft7/optional/float-overflow.json")); this.disabled.add(Paths.get("src/test/suite/tests/draft7/ref.json")); this.disabled.add(Paths.get("src/test/suite/tests/draft7/refRemote.json")); } private void disableV6Tests() { - this.disabled.add(Paths.get("src/test/suite/tests/draft6/optional/float-overflow.json")); this.disabled.add(Paths.get("src/test/suite/tests/draft6/optional/format.json")); this.disabled.add(Paths.get("src/test/suite/tests/draft6/ref.json")); this.disabled.add(Paths.get("src/test/suite/tests/draft6/refRemote.json"));