From a80de496885d421b025adc0ca9d75ac89c751524 Mon Sep 17 00:00:00 2001 From: Sebastian Toepfer <61313468+sebastian-toepfer@users.noreply.github.com> Date: Tue, 13 Feb 2024 21:24:55 +0100 Subject: [PATCH 1/2] fix instancetype.integer issue with values greater 19 --- .../io/github/sebastiantoepfer/jsonschema/InstanceType.java | 2 +- .../github/sebastiantoepfer/jsonschema/InstanceTypeTest.java | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/api/src/main/java/io/github/sebastiantoepfer/jsonschema/InstanceType.java b/api/src/main/java/io/github/sebastiantoepfer/jsonschema/InstanceType.java index 8d72ec7a..e97970d4 100644 --- a/api/src/main/java/io/github/sebastiantoepfer/jsonschema/InstanceType.java +++ b/api/src/main/java/io/github/sebastiantoepfer/jsonschema/InstanceType.java @@ -51,7 +51,7 @@ private boolean isIntegral(final BigDecimal decimal) { BigDecimal.ZERO.equals(decimal) || BigDecimal.ONE.equals(decimal) || BigDecimal.TEN.equals(decimal) || - decimal.stripTrailingZeros().scale() == 0 + decimal.stripTrailingZeros().scale() <= 0 ); } }, diff --git a/api/src/test/java/io/github/sebastiantoepfer/jsonschema/InstanceTypeTest.java b/api/src/test/java/io/github/sebastiantoepfer/jsonschema/InstanceTypeTest.java index 8fb737e6..cf4436a1 100644 --- a/api/src/test/java/io/github/sebastiantoepfer/jsonschema/InstanceTypeTest.java +++ b/api/src/test/java/io/github/sebastiantoepfer/jsonschema/InstanceTypeTest.java @@ -54,6 +54,9 @@ static Stream provideWithValidCombinations() { arguments(InstanceType.NUMBER, Json.createValue(23L)), arguments(InstanceType.INTEGER, Json.createValue(23L)), arguments(InstanceType.INTEGER, Json.createValue(10L)), + arguments(InstanceType.INTEGER, Json.createValue(20L)), + arguments(InstanceType.INTEGER, Json.createValue(100L)), + arguments(InstanceType.INTEGER, Json.createValue(1000L)), arguments(InstanceType.INTEGER, Json.createValue(0.0)) ); } From 401a3bc919ea571dcffe37ccbb79928a3717da34 Mon Sep 17 00:00:00 2001 From: Sebastian Toepfer <61313468+sebastian-toepfer@users.noreply.github.com> Date: Tue, 13 Feb 2024 21:37:02 +0100 Subject: [PATCH 2/2] bump version to 0.1.2 --- api/pom.xml | 2 +- core/pom.xml | 2 +- pom.xml | 4 ++-- vocabulary-spi/pom.xml | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/api/pom.xml b/api/pom.xml index 7fb8bca7..dbdec09d 100644 --- a/api/pom.xml +++ b/api/pom.xml @@ -5,7 +5,7 @@ io.github.sebastian-toepfer.json-schema json-schema - 0.1.1 + 0.1.2 json-schema-api diff --git a/core/pom.xml b/core/pom.xml index ca93ae63..27703bb5 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -6,7 +6,7 @@ io.github.sebastian-toepfer.json-schema json-schema - 0.1.1 + 0.1.2 json-schema-core diff --git a/pom.xml b/pom.xml index 1ec1f33f..d4f9b95b 100644 --- a/pom.xml +++ b/pom.xml @@ -13,7 +13,7 @@ io.github.sebastian-toepfer.json-schema json-schema - 0.1.1 + 0.1.2 Json Schema pom @@ -45,7 +45,7 @@ - 2024-01-18T19:42:58Z + 2024-02-13T20:35:47Z 17 diff --git a/vocabulary-spi/pom.xml b/vocabulary-spi/pom.xml index 2281e59b..637e2b57 100644 --- a/vocabulary-spi/pom.xml +++ b/vocabulary-spi/pom.xml @@ -8,7 +8,7 @@ io.github.sebastian-toepfer.json-schema json-schema - 0.1.1 + 0.1.2 json-schema-vocabulary-spi