Skip to content

Commit 2d4f60f

Browse files
add openApiNullable=false
1 parent 21b2655 commit 2d4f60f

File tree

12 files changed

+12
-10
lines changed

12 files changed

+12
-10
lines changed

bin/configs/java-native-jackson3.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ additionalProperties:
99
generateBuilders: true
1010
useReflectionEqualsHashCode: "true"
1111
useJackson3: "true"
12+
openApiNullable: "false"

modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaClientCodegenTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -643,6 +643,7 @@ public void testJdkHttpClientWithJackson3() {
643643
.addAdditionalProperty(CodegenConstants.API_PACKAGE, "xyz.abcdef.api")
644644
.addAdditionalProperty(CodegenConstants.INVOKER_PACKAGE, "xyz.abcdef.invoker")
645645
.addAdditionalProperty(JavaClientCodegen.USE_JACKSON_3, true)
646+
.addAdditionalProperty(JavaClientCodegen.OPENAPI_NULLABLE, false)
646647
.setInputSpec("src/test/resources/3_0/ping.yaml")
647648
.setOutputDir(output.toString().replace("\\", "/"));
648649

samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Fruit.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ public FruitDeserializer(Class<?> vc) {
8787

8888
@Override
8989
public Fruit deserialize(JsonParser jp, DeserializationContext ctxt) throws JacksonException {
90-
JsonNode tree = jp.readValueAsTree();
90+
JsonNode tree = ctxt.readTree(jp);
9191
Object deserialized = null;
9292
boolean typeCoercion = false; // MapperFeature.ALLOW_COERCION_OF_SCALARS was removed in Jackson 3
9393
int match = 0;

samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/FruitReq.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ public FruitReqDeserializer(Class<?> vc) {
8787

8888
@Override
8989
public FruitReq deserialize(JsonParser jp, DeserializationContext ctxt) throws JacksonException {
90-
JsonNode tree = jp.readValueAsTree();
90+
JsonNode tree = ctxt.readTree(jp);
9191
Object deserialized = null;
9292
boolean typeCoercion = false; // MapperFeature.ALLOW_COERCION_OF_SCALARS was removed in Jackson 3
9393
int match = 0;

samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/GmFruit.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public GmFruitDeserializer(Class<?> vc) {
8585

8686
@Override
8787
public GmFruit deserialize(JsonParser jp, DeserializationContext ctxt) throws JacksonException {
88-
JsonNode tree = jp.readValueAsTree();
88+
JsonNode tree = ctxt.readTree(jp);
8989

9090
Object deserialized = null;
9191
// deserialize Apple

samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Mammal.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ public MammalDeserializer(Class<?> vc) {
9090

9191
@Override
9292
public Mammal deserialize(JsonParser jp, DeserializationContext ctxt) throws JacksonException {
93-
JsonNode tree = jp.readValueAsTree();
93+
JsonNode tree = ctxt.readTree(jp);
9494
Object deserialized = null;
9595
boolean typeCoercion = false; // MapperFeature.ALLOW_COERCION_OF_SCALARS was removed in Jackson 3
9696
int match = 0;

samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/NullableShape.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ public NullableShapeDeserializer(Class<?> vc) {
8888

8989
@Override
9090
public NullableShape deserialize(JsonParser jp, DeserializationContext ctxt) throws JacksonException {
91-
JsonNode tree = jp.readValueAsTree();
91+
JsonNode tree = ctxt.readTree(jp);
9292
Object deserialized = null;
9393
boolean typeCoercion = false; // MapperFeature.ALLOW_COERCION_OF_SCALARS was removed in Jackson 3
9494
int match = 0;

samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Pig.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ public PigDeserializer(Class<?> vc) {
8888

8989
@Override
9090
public Pig deserialize(JsonParser jp, DeserializationContext ctxt) throws JacksonException {
91-
JsonNode tree = jp.readValueAsTree();
91+
JsonNode tree = ctxt.readTree(jp);
9292
Object deserialized = null;
9393
boolean typeCoercion = false; // MapperFeature.ALLOW_COERCION_OF_SCALARS was removed in Jackson 3
9494
int match = 0;

samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Quadrilateral.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ public QuadrilateralDeserializer(Class<?> vc) {
8888

8989
@Override
9090
public Quadrilateral deserialize(JsonParser jp, DeserializationContext ctxt) throws JacksonException {
91-
JsonNode tree = jp.readValueAsTree();
91+
JsonNode tree = ctxt.readTree(jp);
9292
Object deserialized = null;
9393
boolean typeCoercion = false; // MapperFeature.ALLOW_COERCION_OF_SCALARS was removed in Jackson 3
9494
int match = 0;

samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Shape.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ public ShapeDeserializer(Class<?> vc) {
8888

8989
@Override
9090
public Shape deserialize(JsonParser jp, DeserializationContext ctxt) throws JacksonException {
91-
JsonNode tree = jp.readValueAsTree();
91+
JsonNode tree = ctxt.readTree(jp);
9292
Object deserialized = null;
9393
boolean typeCoercion = false; // MapperFeature.ALLOW_COERCION_OF_SCALARS was removed in Jackson 3
9494
int match = 0;

0 commit comments

Comments
 (0)