diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/native/JSON.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/native/JSON.mustache index 3d00cafc9033..1f5ea71e2015 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/native/JSON.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/native/JSON.mustache @@ -153,7 +153,12 @@ public class JSON { // Get the value of the discriminator property, if present in the input payload. node = node.get(discriminatorName); if (node != null && node.isValueNode()) { + {{^useJackson3}} String discrValue = node.asText(); + {{/useJackson3}} + {{#useJackson3}} + String discrValue = node.asString(); + {{/useJackson3}} if (discrValue != null) { return discrValue; } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/native/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/native/build.gradle.mustache index 4c31a9b03d60..ae4f9641b843 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/native/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/native/build.gradle.mustache @@ -83,7 +83,7 @@ ext { jackson_annotations_version = "2.21" {{/useJackson3}} {{#useJackson3}} - jackson3_version = "3.1.0" + jackson3_version = "3.1.1" jackson_annotations_version = "2.21" {{/useJackson3}} {{#useJakartaEe}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/native/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/native/pom.mustache index def5d8a1c914..cba50991b43a 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/native/pom.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/native/pom.mustache @@ -341,7 +341,7 @@ 0.2.10 {{/useJackson3}} {{#useJackson3}} - 3.1.0 + 3.1.1 2.21 {{/useJackson3}} {{#useJakartaEe}} diff --git a/samples/client/petstore/java/native-jackson3-jspecify/build.gradle b/samples/client/petstore/java/native-jackson3-jspecify/build.gradle index 4c1f924fc52a..6678f2900f3f 100644 --- a/samples/client/petstore/java/native-jackson3-jspecify/build.gradle +++ b/samples/client/petstore/java/native-jackson3-jspecify/build.gradle @@ -66,7 +66,7 @@ artifacts { ext { - jackson3_version = "3.1.0" + jackson3_version = "3.1.1" jackson_annotations_version = "2.21" jakarta_annotation_version = "1.3.5" beanvalidation_version = "2.0.2" diff --git a/samples/client/petstore/java/native-jackson3-jspecify/pom.xml b/samples/client/petstore/java/native-jackson3-jspecify/pom.xml index 12373cb5a80a..5017dd1daaf9 100644 --- a/samples/client/petstore/java/native-jackson3-jspecify/pom.xml +++ b/samples/client/petstore/java/native-jackson3-jspecify/pom.xml @@ -249,7 +249,7 @@ UTF-8 17 17 - 3.1.0 + 3.1.1 2.21 1.3.5 2.0.2 diff --git a/samples/client/petstore/java/native-jackson3-jspecify/src/main/java/org/openapitools/client/JSON.java b/samples/client/petstore/java/native-jackson3-jspecify/src/main/java/org/openapitools/client/JSON.java index e4f0b4e8ac0d..61ee126da289 100644 --- a/samples/client/petstore/java/native-jackson3-jspecify/src/main/java/org/openapitools/client/JSON.java +++ b/samples/client/petstore/java/native-jackson3-jspecify/src/main/java/org/openapitools/client/JSON.java @@ -110,7 +110,7 @@ String getDiscriminatorValue(JsonNode node) { // Get the value of the discriminator property, if present in the input payload. node = node.get(discriminatorName); if (node != null && node.isValueNode()) { - String discrValue = node.asText(); + String discrValue = node.asString(); if (discrValue != null) { return discrValue; } diff --git a/samples/client/petstore/java/native-jackson3/build.gradle b/samples/client/petstore/java/native-jackson3/build.gradle index f8be36507124..103f8aa97421 100644 --- a/samples/client/petstore/java/native-jackson3/build.gradle +++ b/samples/client/petstore/java/native-jackson3/build.gradle @@ -66,7 +66,7 @@ artifacts { ext { - jackson3_version = "3.1.0" + jackson3_version = "3.1.1" jackson_annotations_version = "2.21" jakarta_annotation_version = "1.3.5" beanvalidation_version = "2.0.2" diff --git a/samples/client/petstore/java/native-jackson3/pom.xml b/samples/client/petstore/java/native-jackson3/pom.xml index c4a9cbb064fd..a5e5034070a7 100644 --- a/samples/client/petstore/java/native-jackson3/pom.xml +++ b/samples/client/petstore/java/native-jackson3/pom.xml @@ -251,7 +251,7 @@ UTF-8 17 17 - 3.1.0 + 3.1.1 2.21 1.3.5 2.0.2 diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/JSON.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/JSON.java index efabdf554acd..e2d3d961ea97 100644 --- a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/JSON.java +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/JSON.java @@ -110,7 +110,7 @@ String getDiscriminatorValue(JsonNode node) { // Get the value of the discriminator property, if present in the input payload. node = node.get(discriminatorName); if (node != null && node.isValueNode()) { - String discrValue = node.asText(); + String discrValue = node.asString(); if (discrValue != null) { return discrValue; }