diff --git a/bin/configs/kotlin-spring-boot-3-no-response-entity.yaml b/bin/configs/kotlin-spring-boot-3-no-response-entity.yaml index b0b7c3fe3825..fb88b7e5c053 100644 --- a/bin/configs/kotlin-spring-boot-3-no-response-entity.yaml +++ b/bin/configs/kotlin-spring-boot-3-no-response-entity.yaml @@ -4,6 +4,8 @@ library: spring-boot inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml templateDir: modules/openapi-generator/src/main/resources/kotlin-spring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" documentationProvider: none annotationLibrary: none useSwaggerUI: "false" diff --git a/bin/configs/kotlin-spring-boot-3.yaml b/bin/configs/kotlin-spring-boot-3.yaml index 5c0572cf1cb4..a102ecb2e695 100644 --- a/bin/configs/kotlin-spring-boot-3.yaml +++ b/bin/configs/kotlin-spring-boot-3.yaml @@ -4,6 +4,9 @@ library: spring-boot inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml templateDir: modules/openapi-generator/src/main/resources/kotlin-spring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" + optionalNonNullPropertyJsonInclude: "NONE" documentationProvider: none annotationLibrary: none useSwaggerUI: "false" diff --git a/bin/configs/kotlin-spring-boot-4.yaml b/bin/configs/kotlin-spring-boot-4.yaml index 6779d1910974..c544279bd050 100644 --- a/bin/configs/kotlin-spring-boot-4.yaml +++ b/bin/configs/kotlin-spring-boot-4.yaml @@ -4,6 +4,8 @@ library: spring-boot inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml templateDir: modules/openapi-generator/src/main/resources/kotlin-spring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" documentationProvider: none annotationLibrary: none useSwaggerUI: "false" diff --git a/bin/configs/kotlin-spring-boot-additionalproperties.yaml b/bin/configs/kotlin-spring-boot-additionalproperties.yaml index e9c962afffd6..59588abd4d20 100644 --- a/bin/configs/kotlin-spring-boot-additionalproperties.yaml +++ b/bin/configs/kotlin-spring-boot-additionalproperties.yaml @@ -4,6 +4,8 @@ library: spring-boot inputSpec: samples/server/petstore/kotlin-springboot-additionalproperties/src/main/resources/openapi.yaml templateDir: modules/openapi-generator/src/main/resources/kotlin-spring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" documentationProvider: none annotationLibrary: none useSwaggerUI: "false" diff --git a/bin/configs/kotlin-spring-boot-bigdecimal-default.yaml b/bin/configs/kotlin-spring-boot-bigdecimal-default.yaml index 6fa5b9556499..67ad5f0518b3 100644 --- a/bin/configs/kotlin-spring-boot-bigdecimal-default.yaml +++ b/bin/configs/kotlin-spring-boot-bigdecimal-default.yaml @@ -3,3 +3,6 @@ outputDir: samples/server/petstore/kotlin-springboot-bigdecimal-default library: spring-boot inputSpec: modules/openapi-generator/src/test/resources/3_0/issue_14584_bigdecimal_default.yaml templateDir: modules/openapi-generator/src/main/resources/kotlin-spring +additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" diff --git a/bin/configs/kotlin-spring-boot-delegate-nodefaults.yaml b/bin/configs/kotlin-spring-boot-delegate-nodefaults.yaml index 3596dbcf6383..778495dcd07b 100644 --- a/bin/configs/kotlin-spring-boot-delegate-nodefaults.yaml +++ b/bin/configs/kotlin-spring-boot-delegate-nodefaults.yaml @@ -4,6 +4,8 @@ library: spring-boot inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml templateDir: modules/openapi-generator/src/main/resources/kotlin-spring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" documentationProvider: none annotationLibrary: swagger2 useSwaggerUI: "true" diff --git a/bin/configs/kotlin-spring-boot-delegate.yaml b/bin/configs/kotlin-spring-boot-delegate.yaml index 2eb2f2e43e89..c09fcf345fdb 100644 --- a/bin/configs/kotlin-spring-boot-delegate.yaml +++ b/bin/configs/kotlin-spring-boot-delegate.yaml @@ -4,6 +4,8 @@ library: spring-boot inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml templateDir: modules/openapi-generator/src/main/resources/kotlin-spring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" documentationProvider: springdoc annotationLibrary: swagger2 useSwaggerUI: "true" diff --git a/bin/configs/kotlin-spring-boot-include-http-request-context-delegate.yaml b/bin/configs/kotlin-spring-boot-include-http-request-context-delegate.yaml index 44b82e9702fc..51990ca79a95 100644 --- a/bin/configs/kotlin-spring-boot-include-http-request-context-delegate.yaml +++ b/bin/configs/kotlin-spring-boot-include-http-request-context-delegate.yaml @@ -4,6 +4,8 @@ library: spring-boot inputSpec: modules/openapi-generator/src/test/resources/3_0/kotlin/petstore-with-x-kotlin-implements.yaml templateDir: modules/openapi-generator/src/main/resources/kotlin-spring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" documentationProvider: none annotationLibrary: swagger1 useSwaggerUI: false diff --git a/bin/configs/kotlin-spring-boot-integer-enum.yaml b/bin/configs/kotlin-spring-boot-integer-enum.yaml index 0b23e72b5bf6..3b470aed9488 100644 --- a/bin/configs/kotlin-spring-boot-integer-enum.yaml +++ b/bin/configs/kotlin-spring-boot-integer-enum.yaml @@ -4,6 +4,8 @@ library: spring-boot inputSpec: modules/openapi-generator/src/test/resources/3_0/kotlin/issue19244_integer_enum.yaml templateDir: modules/openapi-generator/src/main/resources/kotlin-spring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" interfaceOnly: "true" skipDefaultInterface: "true" useTags: "true" diff --git a/bin/configs/kotlin-spring-boot-modelMutable.yaml b/bin/configs/kotlin-spring-boot-modelMutable.yaml index ba49fcc91f90..2fb63e2cc4fc 100644 --- a/bin/configs/kotlin-spring-boot-modelMutable.yaml +++ b/bin/configs/kotlin-spring-boot-modelMutable.yaml @@ -4,6 +4,9 @@ library: spring-boot inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml templateDir: modules/openapi-generator/src/main/resources/kotlin-spring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" + optionalNonNullPropertyJsonInclude: "NON_DEFAULT" documentationProvider: springdoc annotationLibrary: swagger2 useSwaggerUI: "true" diff --git a/bin/configs/kotlin-spring-boot-multipart-request-model.yaml b/bin/configs/kotlin-spring-boot-multipart-request-model.yaml index 63d0b59fd5bb..184f3722f01f 100644 --- a/bin/configs/kotlin-spring-boot-multipart-request-model.yaml +++ b/bin/configs/kotlin-spring-boot-multipart-request-model.yaml @@ -3,3 +3,6 @@ outputDir: samples/server/petstore/kotlin-springboot-multipart-request-model library: spring-boot inputSpec: modules/openapi-generator/src/test/resources/3_0/issue_15251_multipart_request_model.yaml templateDir: modules/openapi-generator/src/main/resources/kotlin-spring +additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" diff --git a/bin/configs/kotlin-spring-boot-no-response-entity-delegate.yaml b/bin/configs/kotlin-spring-boot-no-response-entity-delegate.yaml index d5ad5a5a4b41..eb41fe7444b9 100644 --- a/bin/configs/kotlin-spring-boot-no-response-entity-delegate.yaml +++ b/bin/configs/kotlin-spring-boot-no-response-entity-delegate.yaml @@ -4,6 +4,8 @@ library: spring-boot inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml templateDir: modules/openapi-generator/src/main/resources/kotlin-spring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" documentationProvider: none annotationLibrary: none useSwaggerUI: "false" diff --git a/bin/configs/kotlin-spring-boot-no-response-entity.yaml b/bin/configs/kotlin-spring-boot-no-response-entity.yaml index 007fadf41864..ad4bac02f91b 100644 --- a/bin/configs/kotlin-spring-boot-no-response-entity.yaml +++ b/bin/configs/kotlin-spring-boot-no-response-entity.yaml @@ -4,6 +4,8 @@ library: spring-boot inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml templateDir: modules/openapi-generator/src/main/resources/kotlin-spring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" documentationProvider: none annotationLibrary: none useSwaggerUI: "false" diff --git a/bin/configs/kotlin-spring-boot-oneof-discriminator-const.yaml b/bin/configs/kotlin-spring-boot-oneof-discriminator-const.yaml index 1ecd7a2b660e..7198eb9926af 100644 --- a/bin/configs/kotlin-spring-boot-oneof-discriminator-const.yaml +++ b/bin/configs/kotlin-spring-boot-oneof-discriminator-const.yaml @@ -4,6 +4,8 @@ library: spring-boot inputSpec: modules/openapi-generator/src/test/resources/3_1/polymorphism-and-discriminator.yaml templateDir: modules/openapi-generator/src/main/resources/kotlin-spring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" documentationProvider: none annotationLibrary: none useSwaggerUI: "false" diff --git a/bin/configs/kotlin-spring-boot-oneof-discriminator.yaml b/bin/configs/kotlin-spring-boot-oneof-discriminator.yaml index 2d2edd95bfd1..228d0dcf5026 100644 --- a/bin/configs/kotlin-spring-boot-oneof-discriminator.yaml +++ b/bin/configs/kotlin-spring-boot-oneof-discriminator.yaml @@ -4,6 +4,8 @@ library: spring-boot inputSpec: modules/openapi-generator/src/test/resources/3_0/kotlin/polymorphism-oneof-discriminator.yaml templateDir: modules/openapi-generator/src/main/resources/kotlin-spring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" documentationProvider: none annotationLibrary: none useSwaggerUI: "false" diff --git a/bin/configs/kotlin-spring-boot-oneof-enum-discriminator.yaml b/bin/configs/kotlin-spring-boot-oneof-enum-discriminator.yaml index 235978710b26..53b322f29f00 100644 --- a/bin/configs/kotlin-spring-boot-oneof-enum-discriminator.yaml +++ b/bin/configs/kotlin-spring-boot-oneof-enum-discriminator.yaml @@ -4,6 +4,8 @@ library: spring-boot inputSpec: modules/openapi-generator/src/test/resources/3_0/kotlin/polymorphism-oneof-enum-discriminator.yaml templateDir: modules/openapi-generator/src/main/resources/kotlin-spring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" documentationProvider: none annotationLibrary: none useSwaggerUI: "false" diff --git a/bin/configs/kotlin-spring-boot-paged-model.yaml b/bin/configs/kotlin-spring-boot-paged-model.yaml index 02776a3a1c5b..079e3a49b83a 100644 --- a/bin/configs/kotlin-spring-boot-paged-model.yaml +++ b/bin/configs/kotlin-spring-boot-paged-model.yaml @@ -4,6 +4,8 @@ library: spring-boot inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-paged-model.yaml templateDir: modules/openapi-generator/src/main/resources/kotlin-spring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" documentationProvider: none annotationLibrary: none useSwaggerUI: "false" diff --git a/bin/configs/kotlin-spring-boot-reactive-without-flow.yaml b/bin/configs/kotlin-spring-boot-reactive-without-flow.yaml index 8f29401890a4..8428cfbede8e 100644 --- a/bin/configs/kotlin-spring-boot-reactive-without-flow.yaml +++ b/bin/configs/kotlin-spring-boot-reactive-without-flow.yaml @@ -4,6 +4,8 @@ library: spring-boot inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml templateDir: modules/openapi-generator/src/main/resources/kotlin-spring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" documentationProvider: springdoc annotationLibrary: swagger2 useSwaggerUI: "true" diff --git a/bin/configs/kotlin-spring-boot-reactive.yaml b/bin/configs/kotlin-spring-boot-reactive.yaml index c05cc232fcf4..a8272859ce07 100644 --- a/bin/configs/kotlin-spring-boot-reactive.yaml +++ b/bin/configs/kotlin-spring-boot-reactive.yaml @@ -4,6 +4,8 @@ library: spring-boot inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml templateDir: modules/openapi-generator/src/main/resources/kotlin-spring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" documentationProvider: springdoc annotationLibrary: swagger2 useSwaggerUI: "true" diff --git a/bin/configs/kotlin-spring-boot-request-cookie.yaml b/bin/configs/kotlin-spring-boot-request-cookie.yaml index fdf613630ae9..7aeb82984780 100644 --- a/bin/configs/kotlin-spring-boot-request-cookie.yaml +++ b/bin/configs/kotlin-spring-boot-request-cookie.yaml @@ -4,6 +4,8 @@ library: spring-boot inputSpec: modules/openapi-generator/src/test/resources/3_0/kotlin/petstore-with-fake-endpoints-for-testing-with-cookie.yaml templateDir: modules/openapi-generator/src/main/resources/kotlin-spring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" appendRequestToHandler: true interfaceOnly: true useSpringBoot3: true \ No newline at end of file diff --git a/bin/configs/kotlin-spring-boot-sort-validation.yaml b/bin/configs/kotlin-spring-boot-sort-validation.yaml index 485233c40fad..827eaeedf8b3 100644 --- a/bin/configs/kotlin-spring-boot-sort-validation.yaml +++ b/bin/configs/kotlin-spring-boot-sort-validation.yaml @@ -4,6 +4,8 @@ library: spring-boot inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-sort-validation.yaml templateDir: modules/openapi-generator/src/main/resources/kotlin-spring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" documentationProvider: none annotationLibrary: none useSwaggerUI: "false" diff --git a/bin/configs/kotlin-spring-boot-source-swagger1.yaml b/bin/configs/kotlin-spring-boot-source-swagger1.yaml index 5a304d628e03..1a470a150fed 100644 --- a/bin/configs/kotlin-spring-boot-source-swagger1.yaml +++ b/bin/configs/kotlin-spring-boot-source-swagger1.yaml @@ -4,6 +4,8 @@ library: spring-boot inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml templateDir: modules/openapi-generator/src/main/resources/kotlin-spring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" documentationProvider: source annotationLibrary: swagger1 useSwaggerUI: "true" diff --git a/bin/configs/kotlin-spring-boot-source-swagger2.yaml b/bin/configs/kotlin-spring-boot-source-swagger2.yaml index 287d71be535c..94dfa2a58657 100644 --- a/bin/configs/kotlin-spring-boot-source-swagger2.yaml +++ b/bin/configs/kotlin-spring-boot-source-swagger2.yaml @@ -4,6 +4,8 @@ library: spring-boot inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml templateDir: modules/openapi-generator/src/main/resources/kotlin-spring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" documentationProvider: source annotationLibrary: swagger2 useSwaggerUI: "true" diff --git a/bin/configs/kotlin-spring-boot-x-kotlin-implements.yaml b/bin/configs/kotlin-spring-boot-x-kotlin-implements.yaml index 685c64a31c4d..1ee6f5030598 100644 --- a/bin/configs/kotlin-spring-boot-x-kotlin-implements.yaml +++ b/bin/configs/kotlin-spring-boot-x-kotlin-implements.yaml @@ -4,6 +4,8 @@ library: spring-boot inputSpec: modules/openapi-generator/src/test/resources/3_0/kotlin/petstore-with-x-kotlin-implements.yaml templateDir: modules/openapi-generator/src/main/resources/kotlin-spring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" documentationProvider: none annotationLibrary: swagger1 useSwaggerUI: false diff --git a/bin/configs/kotlin-spring-boot.yaml b/bin/configs/kotlin-spring-boot.yaml index 0595d4243c28..0f930bf63998 100644 --- a/bin/configs/kotlin-spring-boot.yaml +++ b/bin/configs/kotlin-spring-boot.yaml @@ -4,6 +4,9 @@ library: spring-boot inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml templateDir: modules/openapi-generator/src/main/resources/kotlin-spring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" + optionalNonNullPropertyJsonInclude: "NON_EMPTY" documentationProvider: none annotationLibrary: none useSwaggerUI: "false" diff --git a/bin/configs/kotlin-spring-cloud.yaml b/bin/configs/kotlin-spring-cloud.yaml index b4185c2a38d7..9a2def41fa0f 100644 --- a/bin/configs/kotlin-spring-cloud.yaml +++ b/bin/configs/kotlin-spring-cloud.yaml @@ -4,6 +4,8 @@ library: spring-cloud inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml templateDir: modules/openapi-generator/src/main/resources/kotlin-spring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" documentationProvider: none annotationLibrary: none useSwaggerUI: "false" diff --git a/bin/configs/kotlin-spring-declarative-interface-bean-validation.yaml b/bin/configs/kotlin-spring-declarative-interface-bean-validation.yaml index 7c7ab0f17b21..227e9b360e95 100644 --- a/bin/configs/kotlin-spring-declarative-interface-bean-validation.yaml +++ b/bin/configs/kotlin-spring-declarative-interface-bean-validation.yaml @@ -4,6 +4,8 @@ library: spring-declarative-http-interface inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml templateDir: modules/openapi-generator/src/main/resources/kotlin-spring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" documentationProvider: springDoc annotationLibrary: swagger2 useSwaggerUI: "false" diff --git a/bin/configs/kotlin-spring-declarative-interface-reactive-coroutines.yaml b/bin/configs/kotlin-spring-declarative-interface-reactive-coroutines.yaml index e8df0fd8855c..ac35f26cb4bf 100644 --- a/bin/configs/kotlin-spring-declarative-interface-reactive-coroutines.yaml +++ b/bin/configs/kotlin-spring-declarative-interface-reactive-coroutines.yaml @@ -4,6 +4,8 @@ library: spring-declarative-http-interface inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml templateDir: modules/openapi-generator/src/main/resources/kotlin-spring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" documentationProvider: springDoc annotationLibrary: swagger2 useSwaggerUI: "false" diff --git a/bin/configs/kotlin-spring-declarative-interface-reactive-reactor-wrapped.yaml b/bin/configs/kotlin-spring-declarative-interface-reactive-reactor-wrapped.yaml index 1f16d8ec5dbc..431d1a9dc5f5 100644 --- a/bin/configs/kotlin-spring-declarative-interface-reactive-reactor-wrapped.yaml +++ b/bin/configs/kotlin-spring-declarative-interface-reactive-reactor-wrapped.yaml @@ -4,6 +4,8 @@ library: spring-declarative-http-interface inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml templateDir: modules/openapi-generator/src/main/resources/kotlin-spring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" documentationProvider: springDoc annotationLibrary: swagger2 useSwaggerUI: "false" diff --git a/bin/configs/kotlin-spring-declarative-interface-wrapped.yaml b/bin/configs/kotlin-spring-declarative-interface-wrapped.yaml index 01911f6a4b66..f8f5ec693cba 100644 --- a/bin/configs/kotlin-spring-declarative-interface-wrapped.yaml +++ b/bin/configs/kotlin-spring-declarative-interface-wrapped.yaml @@ -4,6 +4,8 @@ library: spring-declarative-http-interface inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml templateDir: modules/openapi-generator/src/main/resources/kotlin-spring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" documentationProvider: springDoc annotationLibrary: swagger2 useSwaggerUI: "false" diff --git a/bin/configs/kotlin-spring-declarative-interface.yaml b/bin/configs/kotlin-spring-declarative-interface.yaml index 5770ddafd8c8..1380afa9e362 100644 --- a/bin/configs/kotlin-spring-declarative-interface.yaml +++ b/bin/configs/kotlin-spring-declarative-interface.yaml @@ -4,6 +4,8 @@ library: spring-declarative-http-interface inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml templateDir: modules/openapi-generator/src/main/resources/kotlin-spring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" documentationProvider: springDoc annotationLibrary: swagger2 useSwaggerUI: "false" diff --git a/bin/configs/kotlin-spring-default.yaml b/bin/configs/kotlin-spring-default.yaml index 7cfefdc631cc..cb730f2d0f56 100644 --- a/bin/configs/kotlin-spring-default.yaml +++ b/bin/configs/kotlin-spring-default.yaml @@ -12,3 +12,7 @@ templateDir: modules/openapi-generator/src/main/resources/kotlin-spring # serializableModel: "true" # useBeanValidation: "true" # useSpringBoot3: "true" +additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" + optionalNonNullPropertyJsonInclude: "NON_NULL" diff --git a/bin/configs/kotlin-spring-sealed-interfaces.yaml b/bin/configs/kotlin-spring-sealed-interfaces.yaml index c8d7123f65fb..f05100172f78 100644 --- a/bin/configs/kotlin-spring-sealed-interfaces.yaml +++ b/bin/configs/kotlin-spring-sealed-interfaces.yaml @@ -3,6 +3,8 @@ outputDir: samples/server/petstore/kotlin-spring-sealed-interfaces inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml templateDir: modules/openapi-generator/src/main/resources/kotlin-spring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" useSealedResponseInterfaces: true interfaceOnly: true dateLibrary: java8 diff --git a/bin/configs/spring-boot-3-include-http-request-context.yaml b/bin/configs/spring-boot-3-include-http-request-context.yaml index 23cfdcd9214b..de8f771cc8ca 100644 --- a/bin/configs/spring-boot-3-include-http-request-context.yaml +++ b/bin/configs/spring-boot-3-include-http-request-context.yaml @@ -3,6 +3,8 @@ outputDir: samples/openapi3/server/petstore/springboot-3-include-http-request-co inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" groupId: org.openapitools.openapi3 documentationProvider: springdoc artifactId: springboot diff --git a/bin/configs/spring-boot-3.yaml b/bin/configs/spring-boot-3.yaml index 472f660ac7ab..37b8d2738f7d 100644 --- a/bin/configs/spring-boot-3.yaml +++ b/bin/configs/spring-boot-3.yaml @@ -3,6 +3,9 @@ outputDir: samples/openapi3/server/petstore/springboot-3 inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" + optionalNonNullPropertyJsonInclude: "NON_NULL" groupId: org.openapitools.openapi3 documentationProvider: springdoc artifactId: springboot diff --git a/bin/configs/spring-boot-4-jspecify.yaml b/bin/configs/spring-boot-4-jspecify.yaml index 50b78bf923b8..cf5bf24d3a3e 100644 --- a/bin/configs/spring-boot-4-jspecify.yaml +++ b/bin/configs/spring-boot-4-jspecify.yaml @@ -5,6 +5,8 @@ inputSpec: modules/openapi-generator/src/test/resources/3_0/java/jspecify.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring validateSpec: false additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" groupId: org.openapitools.openapi3 documentationProvider: springdoc interfaceOnly: true diff --git a/bin/configs/spring-boot-4.yaml b/bin/configs/spring-boot-4.yaml index fee5258d9ceb..7506d17c8d26 100644 --- a/bin/configs/spring-boot-4.yaml +++ b/bin/configs/spring-boot-4.yaml @@ -3,6 +3,8 @@ outputDir: samples/openapi3/server/petstore/springboot-4 inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" groupId: org.openapitools.openapi3 documentationProvider: springdoc artifactId: springboot diff --git a/bin/configs/spring-boot-api-response-examples.yaml b/bin/configs/spring-boot-api-response-examples.yaml index e0b4196cc44d..b4acf09a2bdf 100644 --- a/bin/configs/spring-boot-api-response-examples.yaml +++ b/bin/configs/spring-boot-api-response-examples.yaml @@ -4,6 +4,8 @@ library: spring-boot inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/api-response-examples_issue17610.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" artifactId: springboot-api-response-examples documentationProvider: springdoc useSpringBoot3: true diff --git a/bin/configs/spring-boot-beanvalidation-no-nullable.yaml b/bin/configs/spring-boot-beanvalidation-no-nullable.yaml index 408849f7eec6..837ec15f1acd 100644 --- a/bin/configs/spring-boot-beanvalidation-no-nullable.yaml +++ b/bin/configs/spring-boot-beanvalidation-no-nullable.yaml @@ -4,6 +4,8 @@ library: spring-boot inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" groupId: org.openapitools.openapi3 #documentationProvider: springdoc java8: "false" diff --git a/bin/configs/spring-boot-beanvalidation.yaml b/bin/configs/spring-boot-beanvalidation.yaml index 4a8904341cbd..0a49cca8f76c 100644 --- a/bin/configs/spring-boot-beanvalidation.yaml +++ b/bin/configs/spring-boot-beanvalidation.yaml @@ -4,6 +4,8 @@ library: spring-boot inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" #documentationProvider: springdoc useSwaggerUI: false java8: true diff --git a/bin/configs/spring-boot-builtin-validation.yaml b/bin/configs/spring-boot-builtin-validation.yaml index 8a070a7f278e..e2e1bd25fb45 100644 --- a/bin/configs/spring-boot-builtin-validation.yaml +++ b/bin/configs/spring-boot-builtin-validation.yaml @@ -4,6 +4,8 @@ library: spring-boot inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" #documentationProvider: springdoc useSwaggerUI: false java8: true diff --git a/bin/configs/spring-boot-defaultInterface-unhandledExcp.yaml b/bin/configs/spring-boot-defaultInterface-unhandledExcp.yaml index 18608bd41adf..a0feedc6f8f6 100644 --- a/bin/configs/spring-boot-defaultInterface-unhandledExcp.yaml +++ b/bin/configs/spring-boot-defaultInterface-unhandledExcp.yaml @@ -3,6 +3,8 @@ outputDir: samples/server/petstore/spring-boot-defaultInterface-unhandledExcp inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" artifactId: spring-boot-defaultInterface-unhandledException hideGenerationTimestamp: true java8: true diff --git a/bin/configs/spring-boot-delegate-j8.yaml b/bin/configs/spring-boot-delegate-j8.yaml index 1561840073a0..f0efd05a3117 100644 --- a/bin/configs/spring-boot-delegate-j8.yaml +++ b/bin/configs/spring-boot-delegate-j8.yaml @@ -3,6 +3,8 @@ outputDir: samples/server/petstore/springboot-delegate-j8 inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" #documentationProvider: springdoc artifactId: springboot-delegate-j8 hideGenerationTimestamp: "true" diff --git a/bin/configs/spring-boot-delegate-no-response-entity.yaml b/bin/configs/spring-boot-delegate-no-response-entity.yaml index 13d062eb01c9..560d4db7aeaa 100644 --- a/bin/configs/spring-boot-delegate-no-response-entity.yaml +++ b/bin/configs/spring-boot-delegate-no-response-entity.yaml @@ -3,6 +3,8 @@ outputDir: samples/server/petstore/springboot-delegate-no-response-entity inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" #documentationProvider: springdoc artifactId: springboot-delegate-no-response-entity hideGenerationTimestamp: "true" diff --git a/bin/configs/spring-boot-delegate-oas3.yaml b/bin/configs/spring-boot-delegate-oas3.yaml index 28ba653ad086..d0dc5546af85 100644 --- a/bin/configs/spring-boot-delegate-oas3.yaml +++ b/bin/configs/spring-boot-delegate-oas3.yaml @@ -3,6 +3,8 @@ outputDir: samples/openapi3/server/petstore/springboot-delegate inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" groupId: org.openapitools.openapi3 documentationProvider: springdoc artifactId: springboot-delegate diff --git a/bin/configs/spring-boot-delegate.yaml b/bin/configs/spring-boot-delegate.yaml index 5edcca222c49..a05ba9a72e20 100644 --- a/bin/configs/spring-boot-delegate.yaml +++ b/bin/configs/spring-boot-delegate.yaml @@ -3,6 +3,8 @@ outputDir: samples/server/petstore/springboot-delegate inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" documentationProvider: springdoc artifactId: springboot-delegate hideGenerationTimestamp: "true" diff --git a/bin/configs/spring-boot-file-delegate-optional.yaml b/bin/configs/spring-boot-file-delegate-optional.yaml index 68c15c540431..9ac105b03460 100644 --- a/bin/configs/spring-boot-file-delegate-optional.yaml +++ b/bin/configs/spring-boot-file-delegate-optional.yaml @@ -3,6 +3,8 @@ outputDir: samples/server/petstore/springboot-file-delegate-optional inputSpec: modules/openapi-generator/src/test/resources/3_0/issue18345.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" delegatePattern: true useOptional: true useSpringBoot3: true diff --git a/bin/configs/spring-boot-implicitHeaders-annotationLibrary.yaml b/bin/configs/spring-boot-implicitHeaders-annotationLibrary.yaml index 11dbb339bd95..68f75e49d4b4 100644 --- a/bin/configs/spring-boot-implicitHeaders-annotationLibrary.yaml +++ b/bin/configs/spring-boot-implicitHeaders-annotationLibrary.yaml @@ -3,6 +3,8 @@ outputDir: samples/server/petstore/springboot-implicitHeaders-annotationLibrary inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" artifactId: springboot-implicitHeaders-annotationLibrary documentationProvider: none annotationLibrary: none diff --git a/bin/configs/spring-boot-implicitHeaders-oas3.yaml b/bin/configs/spring-boot-implicitHeaders-oas3.yaml index 6d204b53c55e..9db0d986422a 100644 --- a/bin/configs/spring-boot-implicitHeaders-oas3.yaml +++ b/bin/configs/spring-boot-implicitHeaders-oas3.yaml @@ -3,6 +3,8 @@ outputDir: samples/openapi3/server/petstore/springboot-implicitHeaders inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" groupId: org.openapitools.openapi3 documentationProvider: springdoc oas3: "true" diff --git a/bin/configs/spring-boot-implicitHeaders.yaml b/bin/configs/spring-boot-implicitHeaders.yaml index 7fae7e85daf0..d5b7187f3b5c 100644 --- a/bin/configs/spring-boot-implicitHeaders.yaml +++ b/bin/configs/spring-boot-implicitHeaders.yaml @@ -3,6 +3,8 @@ outputDir: samples/server/petstore/springboot-implicitHeaders inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" artifactId: springboot-implicitHeaders documentationProvider: springdoc hideGenerationTimestamp: "true" diff --git a/bin/configs/spring-boot-include-http-request-context.yaml b/bin/configs/spring-boot-include-http-request-context.yaml index a52eeaf879a7..4eedfe7957cb 100644 --- a/bin/configs/spring-boot-include-http-request-context.yaml +++ b/bin/configs/spring-boot-include-http-request-context.yaml @@ -3,6 +3,8 @@ outputDir: samples/server/petstore/springboot-include-http-request-context inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" documentationProvider: springdoc artifactId: springboot snapshotVersion: "true" diff --git a/bin/configs/spring-boot-lombok-data.yaml b/bin/configs/spring-boot-lombok-data.yaml index 57f54d71d3db..5125bfae5b12 100644 --- a/bin/configs/spring-boot-lombok-data.yaml +++ b/bin/configs/spring-boot-lombok-data.yaml @@ -3,6 +3,9 @@ outputDir: samples/server/petstore/springboot-lombok-data inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" + optionalNonNullPropertyJsonInclude: "NON_EMPTY" groupId: org.openapitools.openapi3 artifactId: springboot-lombok-data hideGenerationTimestamp: "true" diff --git a/bin/configs/spring-boot-lombok-tostring.yaml b/bin/configs/spring-boot-lombok-tostring.yaml index 35d4e934eb82..666a16eb2f16 100644 --- a/bin/configs/spring-boot-lombok-tostring.yaml +++ b/bin/configs/spring-boot-lombok-tostring.yaml @@ -3,6 +3,8 @@ outputDir: samples/server/petstore/springboot-lombok-tostring inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" groupId: org.openapitools.openapi3 artifactId: springboot-lombok-tostring hideGenerationTimestamp: "true" diff --git a/bin/configs/spring-boot-oas3.yaml b/bin/configs/spring-boot-oas3.yaml index 1c4c87f19402..4e4e8abff336 100644 --- a/bin/configs/spring-boot-oas3.yaml +++ b/bin/configs/spring-boot-oas3.yaml @@ -3,6 +3,9 @@ outputDir: samples/openapi3/server/petstore/springboot inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" + optionalNonNullPropertyJsonInclude: "NONE" groupId: org.openapitools.openapi3 documentationProvider: springdoc artifactId: springboot diff --git a/bin/configs/spring-boot-oneof-interface.yaml b/bin/configs/spring-boot-oneof-interface.yaml index a66a2c4bfc97..34d04736d56b 100644 --- a/bin/configs/spring-boot-oneof-interface.yaml +++ b/bin/configs/spring-boot-oneof-interface.yaml @@ -3,6 +3,8 @@ outputDir: samples/openapi3/server/petstore/spring-boot-oneof-interface inputSpec: modules/openapi-generator/src/test/resources/3_0/oneof_polymorphism_and_inheritance.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" groupId: org.openapitools.openapi3 documentationProvider: springdoc artifactId: springboot-oneof diff --git a/bin/configs/spring-boot-oneof-sealed.yaml b/bin/configs/spring-boot-oneof-sealed.yaml index 83da74dc7c01..fbb14bf90b1b 100644 --- a/bin/configs/spring-boot-oneof-sealed.yaml +++ b/bin/configs/spring-boot-oneof-sealed.yaml @@ -3,6 +3,8 @@ outputDir: samples/openapi3/server/petstore/spring-boot-oneof-sealed inputSpec: modules/openapi-generator/src/test/resources/3_0/oneof_polymorphism_and_inheritance.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" groupId: org.openapitools.openapi3 documentationProvider: springdoc artifactId: springboot-oneof-sealed diff --git a/bin/configs/spring-boot-oneof.yaml b/bin/configs/spring-boot-oneof.yaml index f4a7ca7a99cc..98a8e2dd4dfc 100644 --- a/bin/configs/spring-boot-oneof.yaml +++ b/bin/configs/spring-boot-oneof.yaml @@ -3,6 +3,8 @@ outputDir: samples/openapi3/server/petstore/spring-boot-oneof inputSpec: modules/openapi-generator/src/test/resources/3_0/oneof_polymorphism_and_inheritance.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" groupId: org.openapitools.openapi3 documentationProvider: springdoc artifactId: springboot-oneof diff --git a/bin/configs/spring-boot-paged-model.yaml b/bin/configs/spring-boot-paged-model.yaml index 5e0922688513..a9e3b91156e3 100644 --- a/bin/configs/spring-boot-paged-model.yaml +++ b/bin/configs/spring-boot-paged-model.yaml @@ -4,6 +4,8 @@ library: spring-boot inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-paged-model.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" documentationProvider: none annotationLibrary: none useSwaggerUI: "false" diff --git a/bin/configs/spring-boot-petstore-with-api-response-examples.yaml b/bin/configs/spring-boot-petstore-with-api-response-examples.yaml index 6a4604492b98..cc77cca4ddf7 100644 --- a/bin/configs/spring-boot-petstore-with-api-response-examples.yaml +++ b/bin/configs/spring-boot-petstore-with-api-response-examples.yaml @@ -4,6 +4,8 @@ library: spring-boot inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore_with_api_response_examples.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" artifactId: springboot-petstore-with-api-response-examples documentationProvider: springdoc useSpringBoot3: true diff --git a/bin/configs/spring-boot-reactive-noResponseEntity.yaml b/bin/configs/spring-boot-reactive-noResponseEntity.yaml index f69ad9806c5c..debb048ef2e5 100644 --- a/bin/configs/spring-boot-reactive-noResponseEntity.yaml +++ b/bin/configs/spring-boot-reactive-noResponseEntity.yaml @@ -3,6 +3,8 @@ outputDir: samples/server/petstore/springboot-reactive-noResponseEntity inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" groupId: org.openapitools.openapi3 artifactId: springboot-reactive-noResponseEntity documentationProvider: springdoc diff --git a/bin/configs/spring-boot-reactive.yaml b/bin/configs/spring-boot-reactive.yaml index 5bc52f55edda..338a4ebaeedf 100644 --- a/bin/configs/spring-boot-reactive.yaml +++ b/bin/configs/spring-boot-reactive.yaml @@ -3,6 +3,8 @@ outputDir: samples/server/petstore/springboot-reactive inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" groupId: org.openapitools.openapi3 artifactId: springboot-reactive documentationProvider: springdoc diff --git a/bin/configs/spring-boot-sort-validation.yaml b/bin/configs/spring-boot-sort-validation.yaml index c3c0cb1096e7..e2640306375b 100644 --- a/bin/configs/spring-boot-sort-validation.yaml +++ b/bin/configs/spring-boot-sort-validation.yaml @@ -4,6 +4,8 @@ library: spring-boot inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-sort-validation.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" documentationProvider: none annotationLibrary: none useSwaggerUI: "false" diff --git a/bin/configs/spring-boot-source.yaml b/bin/configs/spring-boot-source.yaml index a1572c0e19c4..89d895c1960b 100644 --- a/bin/configs/spring-boot-source.yaml +++ b/bin/configs/spring-boot-source.yaml @@ -3,6 +3,8 @@ outputDir: samples/openapi3/server/petstore/springboot-source inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" groupId: org.openapitools.openapi3 documentationProvider: source artifactId: springboot diff --git a/bin/configs/spring-boot-springdoc.yaml b/bin/configs/spring-boot-springdoc.yaml index fe479cd21e7f..cd15712ec7ca 100644 --- a/bin/configs/spring-boot-springdoc.yaml +++ b/bin/configs/spring-boot-springdoc.yaml @@ -3,6 +3,8 @@ outputDir: samples/openapi3/server/petstore/spring-boot-springdoc inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" groupId: org.openapitools.openapi3 documentationProvider: springdoc useSwaggerUI: false diff --git a/bin/configs/spring-boot-useoptional.yaml b/bin/configs/spring-boot-useoptional.yaml index daf57fe87351..428935c9bdd7 100644 --- a/bin/configs/spring-boot-useoptional.yaml +++ b/bin/configs/spring-boot-useoptional.yaml @@ -3,6 +3,9 @@ outputDir: samples/server/petstore/springboot-useoptional inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" + optionalNonNullPropertyJsonInclude: "NON_DEFAULT" groupId: org.openapitools.openapi3 #documentationProvider: springdoc useOptional: true diff --git a/bin/configs/spring-boot-virtualan.yaml b/bin/configs/spring-boot-virtualan.yaml index 87a2e30fb91a..526888c6ecef 100644 --- a/bin/configs/spring-boot-virtualan.yaml +++ b/bin/configs/spring-boot-virtualan.yaml @@ -4,6 +4,8 @@ library: spring-boot inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" documentationProvider: springdoc apiPackage: org.openapitools.virtualan.api modelPackage: org.openapitools.virtualan.model diff --git a/bin/configs/spring-boot-x-implements-skip.yaml b/bin/configs/spring-boot-x-implements-skip.yaml index a56794db3de8..66a2340a9cf3 100644 --- a/bin/configs/spring-boot-x-implements-skip.yaml +++ b/bin/configs/spring-boot-x-implements-skip.yaml @@ -3,6 +3,8 @@ outputDir: samples/server/petstore/springboot-x-implements-skip inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing-x-implements.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" additionalNotNullAnnotations: true documentationProvider: springdoc artifactId: springboot diff --git a/bin/configs/spring-boot.yaml b/bin/configs/spring-boot.yaml index 9464c18594ec..aafaea71da4f 100644 --- a/bin/configs/spring-boot.yaml +++ b/bin/configs/spring-boot.yaml @@ -3,6 +3,8 @@ outputDir: samples/server/petstore/springboot inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" documentationProvider: springdoc artifactId: springboot snapshotVersion: "true" diff --git a/bin/configs/spring-cloud-3-with-optional.yaml b/bin/configs/spring-cloud-3-with-optional.yaml index 7efd4ce223e0..de47cf1cf270 100644 --- a/bin/configs/spring-cloud-3-with-optional.yaml +++ b/bin/configs/spring-cloud-3-with-optional.yaml @@ -4,6 +4,8 @@ outputDir: samples/openapi3/client/petstore/spring-cloud-3-with-optional inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" groupId: org.openapitools.openapi3 artifactId: spring-cloud-oas3 useSpringBoot3: "true" diff --git a/bin/configs/spring-cloud-3.yaml b/bin/configs/spring-cloud-3.yaml index 18e3797f0ca3..ce03369d6208 100644 --- a/bin/configs/spring-cloud-3.yaml +++ b/bin/configs/spring-cloud-3.yaml @@ -4,6 +4,8 @@ outputDir: samples/openapi3/client/petstore/spring-cloud-3 inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" groupId: org.openapitools.openapi3 documentationProvider: springdoc artifactId: spring-cloud-oas3 diff --git a/bin/configs/spring-cloud-4-with-optional.yaml b/bin/configs/spring-cloud-4-with-optional.yaml index 1e474a40a122..10649fe8604f 100644 --- a/bin/configs/spring-cloud-4-with-optional.yaml +++ b/bin/configs/spring-cloud-4-with-optional.yaml @@ -4,6 +4,8 @@ outputDir: samples/openapi3/client/petstore/spring-cloud-4-with-optional inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" groupId: org.openapitools.openapi3 documentationProvider: springdoc artifactId: spring-cloud-oas4 diff --git a/bin/configs/spring-cloud-async-oas3.yaml b/bin/configs/spring-cloud-async-oas3.yaml index 01e4dc6ce4db..ecd0cdf03481 100644 --- a/bin/configs/spring-cloud-async-oas3.yaml +++ b/bin/configs/spring-cloud-async-oas3.yaml @@ -4,6 +4,8 @@ library: spring-cloud inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" groupId: org.openapitools.openapi3 documentationProvider: springdoc async: "true" diff --git a/bin/configs/spring-cloud-auth.yaml b/bin/configs/spring-cloud-auth.yaml index 88c2e399b892..0d559d7dcd57 100644 --- a/bin/configs/spring-cloud-auth.yaml +++ b/bin/configs/spring-cloud-auth.yaml @@ -4,6 +4,8 @@ library: spring-cloud inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-auth.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" documentationProvider: none artifactId: petstore-spring-cloud-auth hideGenerationTimestamp: "true" diff --git a/bin/configs/spring-cloud-date-time-oas3.yaml b/bin/configs/spring-cloud-date-time-oas3.yaml index 8574b519edfb..1bdffc887298 100644 --- a/bin/configs/spring-cloud-date-time-oas3.yaml +++ b/bin/configs/spring-cloud-date-time-oas3.yaml @@ -4,6 +4,8 @@ outputDir: samples/openapi3/client/petstore/spring-cloud-date-time inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/date-time-parameter-types-for-testing.yml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" groupId: org.openapitools.openapi3 documentationProvider: springdoc artifactId: spring-cloud-date-time-oas3 diff --git a/bin/configs/spring-cloud-date-time.yaml b/bin/configs/spring-cloud-date-time.yaml index 14c7e3361f31..58f80a88c883 100644 --- a/bin/configs/spring-cloud-date-time.yaml +++ b/bin/configs/spring-cloud-date-time.yaml @@ -4,6 +4,8 @@ outputDir: samples/client/petstore/spring-cloud-date-time inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/date-time-parameter-types-for-testing.yml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" documentationProvider: springdoc artifactId: spring-cloud-date-time interfaceOnly: "true" diff --git a/bin/configs/spring-cloud-deprecated-oas3.yaml b/bin/configs/spring-cloud-deprecated-oas3.yaml index b6d1943ce7ab..921d2a38a336 100644 --- a/bin/configs/spring-cloud-deprecated-oas3.yaml +++ b/bin/configs/spring-cloud-deprecated-oas3.yaml @@ -4,6 +4,8 @@ outputDir: samples/client/petstore/spring-cloud-deprecated inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-deprecated-fields.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" groupId: org.openapitools.openapi3 documentationProvider: springdoc artifactId: spring-cloud-deprecated diff --git a/bin/configs/spring-cloud-http-basic-only.yaml b/bin/configs/spring-cloud-http-basic-only.yaml index b6ff990b7963..13354e58cdfd 100644 --- a/bin/configs/spring-cloud-http-basic-only.yaml +++ b/bin/configs/spring-cloud-http-basic-only.yaml @@ -4,6 +4,8 @@ outputDir: samples/openapi3/client/petstore/spring-cloud-http-basic inputSpec: modules/openapi-generator/src/test/resources/3_0/http-basic-test.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" groupId: org.openapitools.openapi3 documentationProvider: springdoc artifactId: spring-cloud-http-basic diff --git a/bin/configs/spring-cloud-oas3-fakeapi.yaml b/bin/configs/spring-cloud-oas3-fakeapi.yaml index b4582cbe1c06..7be9c1fbc701 100644 --- a/bin/configs/spring-cloud-oas3-fakeapi.yaml +++ b/bin/configs/spring-cloud-oas3-fakeapi.yaml @@ -4,6 +4,8 @@ outputDir: samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" groupId: org.openapitools.openapi3 documentationProvider: springdoc artifactId: spring-cloud-oas3 diff --git a/bin/configs/spring-cloud-oas3.yaml b/bin/configs/spring-cloud-oas3.yaml index 4e07871206f1..1c4679fdaa1a 100644 --- a/bin/configs/spring-cloud-oas3.yaml +++ b/bin/configs/spring-cloud-oas3.yaml @@ -4,6 +4,8 @@ outputDir: samples/openapi3/client/petstore/spring-cloud inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" groupId: org.openapitools.openapi3 documentationProvider: springdoc artifactId: spring-cloud-oas3 diff --git a/bin/configs/spring-cloud-petstore-feign-spring-pageable-oas3.yaml b/bin/configs/spring-cloud-petstore-feign-spring-pageable-oas3.yaml index b130111f0e0d..afa0848f4ba1 100644 --- a/bin/configs/spring-cloud-petstore-feign-spring-pageable-oas3.yaml +++ b/bin/configs/spring-cloud-petstore-feign-spring-pageable-oas3.yaml @@ -4,6 +4,8 @@ library: spring-cloud inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-spring-pageable.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" groupId: org.openapitools.openapi3 documentationProvider: springdoc artifactId: spring-cloud-spring-pageable diff --git a/bin/configs/spring-cloud-petstore-feign-without-url-param.yaml b/bin/configs/spring-cloud-petstore-feign-without-url-param.yaml index dc342f51ad8e..0300fa35258a 100644 --- a/bin/configs/spring-cloud-petstore-feign-without-url-param.yaml +++ b/bin/configs/spring-cloud-petstore-feign-without-url-param.yaml @@ -4,6 +4,8 @@ library: spring-cloud inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" documentationProvider: springdoc artifactId: petstore-spring-cloud hideGenerationTimestamp: "true" diff --git a/bin/configs/spring-cloud-tags.yaml b/bin/configs/spring-cloud-tags.yaml index 8fad04c73760..524c25f253d2 100644 --- a/bin/configs/spring-cloud-tags.yaml +++ b/bin/configs/spring-cloud-tags.yaml @@ -4,6 +4,8 @@ outputDir: samples/client/petstore/spring-cloud-tags inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-tags.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" #documentationProvider: springdoc artifactId: spring-cloud-date-time interfaceOnly: "true" diff --git a/bin/configs/spring-cloud.yaml b/bin/configs/spring-cloud.yaml index b4a75a6391f5..a93b0924aa76 100644 --- a/bin/configs/spring-cloud.yaml +++ b/bin/configs/spring-cloud.yaml @@ -4,6 +4,8 @@ library: spring-cloud inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" #documentationProvider: springdoc artifactId: petstore-spring-cloud hideGenerationTimestamp: "true" diff --git a/bin/configs/spring-http-interface-bean-validation.yaml b/bin/configs/spring-http-interface-bean-validation.yaml index 9d3aca960b59..4da1d4cb1769 100644 --- a/bin/configs/spring-http-interface-bean-validation.yaml +++ b/bin/configs/spring-http-interface-bean-validation.yaml @@ -4,6 +4,8 @@ outputDir: samples/client/petstore/spring-http-interface-bean-validation inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" artifactId: spring-http-interface snapshotVersion: "true" hideGenerationTimestamp: "true" diff --git a/bin/configs/spring-http-interface-noResponseEntity.yaml b/bin/configs/spring-http-interface-noResponseEntity.yaml index 098c5ebf7598..b9614043cd45 100644 --- a/bin/configs/spring-http-interface-noResponseEntity.yaml +++ b/bin/configs/spring-http-interface-noResponseEntity.yaml @@ -4,6 +4,8 @@ outputDir: samples/client/petstore/spring-http-interface-noResponseEntity inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" artifactId: spring-http-interface-noResponseEntity snapshotVersion: "true" hideGenerationTimestamp: "true" diff --git a/bin/configs/spring-http-interface-oauth.yaml b/bin/configs/spring-http-interface-oauth.yaml index ef6e29eade40..36d44dfaae8b 100644 --- a/bin/configs/spring-http-interface-oauth.yaml +++ b/bin/configs/spring-http-interface-oauth.yaml @@ -4,6 +4,8 @@ outputDir: samples/client/petstore/spring-http-interface-oauth inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-addpet-only.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" artifactId: spring-http-interface-oauth-petstore snapshotVersion: "true" hideGenerationTimestamp: "true" diff --git a/bin/configs/spring-http-interface-reactive-bean-validation.yaml b/bin/configs/spring-http-interface-reactive-bean-validation.yaml index 6040068f931b..1929a918c2e8 100644 --- a/bin/configs/spring-http-interface-reactive-bean-validation.yaml +++ b/bin/configs/spring-http-interface-reactive-bean-validation.yaml @@ -4,6 +4,8 @@ outputDir: samples/client/petstore/spring-http-interface-reactive-bean-validatio inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" artifactId: spring-http-interface-reactive snapshotVersion: "true" hideGenerationTimestamp: "true" diff --git a/bin/configs/spring-http-interface-reactive-noResponseEntity.yaml b/bin/configs/spring-http-interface-reactive-noResponseEntity.yaml index e572fc5188e8..961fbeb5cdc2 100644 --- a/bin/configs/spring-http-interface-reactive-noResponseEntity.yaml +++ b/bin/configs/spring-http-interface-reactive-noResponseEntity.yaml @@ -4,6 +4,8 @@ outputDir: samples/client/petstore/spring-http-interface-reactive-noResponseEnti inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" artifactId: spring-http-interface-reactive-noResponseEntity snapshotVersion: "true" hideGenerationTimestamp: "true" diff --git a/bin/configs/spring-http-interface-reactive.yaml b/bin/configs/spring-http-interface-reactive.yaml index 1a289063f6bd..f7397c1788c8 100644 --- a/bin/configs/spring-http-interface-reactive.yaml +++ b/bin/configs/spring-http-interface-reactive.yaml @@ -4,6 +4,8 @@ outputDir: samples/client/petstore/spring-http-interface-reactive inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" artifactId: spring-http-interface-reactive snapshotVersion: "true" hideGenerationTimestamp: "true" diff --git a/bin/configs/spring-http-interface-springboot-4.yaml b/bin/configs/spring-http-interface-springboot-4.yaml index e9cee278abc9..60d458548d0e 100644 --- a/bin/configs/spring-http-interface-springboot-4.yaml +++ b/bin/configs/spring-http-interface-springboot-4.yaml @@ -4,6 +4,8 @@ outputDir: samples/client/petstore/spring-http-interface-springboot-4 inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" artifactId: spring-http-interface snapshotVersion: "true" hideGenerationTimestamp: "true" diff --git a/bin/configs/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfiguration.yaml b/bin/configs/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfiguration.yaml index 1d50b034c7ae..cd6c66e38bea 100644 --- a/bin/configs/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfiguration.yaml +++ b/bin/configs/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfiguration.yaml @@ -4,6 +4,8 @@ outputDir: samples/client/petstore/spring-http-interface-useHttpServiceProxyFact inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" artifactId: spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator snapshotVersion: "true" hideGenerationTimestamp: "true" diff --git a/bin/configs/spring-http-interface.yaml b/bin/configs/spring-http-interface.yaml index bc6bf36e5123..4051bb3afeb4 100644 --- a/bin/configs/spring-http-interface.yaml +++ b/bin/configs/spring-http-interface.yaml @@ -4,6 +4,8 @@ outputDir: samples/client/petstore/spring-http-interface inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" artifactId: spring-http-interface snapshotVersion: "true" hideGenerationTimestamp: "true" diff --git a/bin/configs/spring-nullable-set.yaml b/bin/configs/spring-nullable-set.yaml index 64122c7cf3c8..d186d5f6f382 100644 --- a/bin/configs/spring-nullable-set.yaml +++ b/bin/configs/spring-nullable-set.yaml @@ -4,6 +4,8 @@ outputDir: samples/server/petstore/spring-boot-nullable-set inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/10167-nullable-set.yml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" artifactId: spring-boot-nullable-set interfaceOnly: "true" singleContentTypes: "true" diff --git a/bin/configs/spring-stubs-oas3.yaml b/bin/configs/spring-stubs-oas3.yaml index c37ba7e3c3c2..b2f927457512 100644 --- a/bin/configs/spring-stubs-oas3.yaml +++ b/bin/configs/spring-stubs-oas3.yaml @@ -3,6 +3,8 @@ outputDir: samples/openapi3/client/petstore/spring-stubs inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" groupId: org.openapitools.openapi3 documentationProvider: springdoc artifactId: spring-stubs diff --git a/bin/configs/spring-stubs-skip-default-interface.yaml b/bin/configs/spring-stubs-skip-default-interface.yaml index 43d4dd080898..e18dd66ed804 100644 --- a/bin/configs/spring-stubs-skip-default-interface.yaml +++ b/bin/configs/spring-stubs-skip-default-interface.yaml @@ -3,6 +3,8 @@ outputDir: samples/openapi3/client/petstore/spring-stubs-skip-default-interface inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" groupId: org.openapitools.openapi3 documentationProvider: springdoc artifactId: spring-stubs diff --git a/bin/configs/springboot-petstore-server-spring-pageable-delegatePattern-without-j8.yaml b/bin/configs/springboot-petstore-server-spring-pageable-delegatePattern-without-j8.yaml index 056714c4f230..b52b6da47336 100644 --- a/bin/configs/springboot-petstore-server-spring-pageable-delegatePattern-without-j8.yaml +++ b/bin/configs/springboot-petstore-server-spring-pageable-delegatePattern-without-j8.yaml @@ -6,6 +6,8 @@ templateDir: modules/openapi-generator/src/main/resources/JavaSpring delegatePattern: true java8: false additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" documentationProvider: springdoc artifactId: springboot-spring-pageable-delegatePattern-without-j8 hideGenerationTimestamp: 'true' diff --git a/bin/configs/springboot-petstore-server-spring-pageable-delegatePattern.yaml b/bin/configs/springboot-petstore-server-spring-pageable-delegatePattern.yaml index 980dab683b8f..c41cb5a1eb12 100644 --- a/bin/configs/springboot-petstore-server-spring-pageable-delegatePattern.yaml +++ b/bin/configs/springboot-petstore-server-spring-pageable-delegatePattern.yaml @@ -5,6 +5,8 @@ inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with templateDir: modules/openapi-generator/src/main/resources/JavaSpring delegatePattern: true additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" documentationProvider: springdoc artifactId: springboot-spring-pageable-delegatePattern hideGenerationTimestamp: 'true' diff --git a/bin/configs/springboot-petstore-server-spring-pageable-without-j8.yaml b/bin/configs/springboot-petstore-server-spring-pageable-without-j8.yaml index 4d7feb4fadc3..4ac75381902b 100644 --- a/bin/configs/springboot-petstore-server-spring-pageable-without-j8.yaml +++ b/bin/configs/springboot-petstore-server-spring-pageable-without-j8.yaml @@ -5,6 +5,8 @@ inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with templateDir: modules/openapi-generator/src/main/resources/JavaSpring java8: false additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" documentationProvider: springdoc artifactId: springboot-spring-pageable-withoutj8 hideGenerationTimestamp: 'true' diff --git a/bin/configs/springboot-petstore-server-spring-pageable.yaml b/bin/configs/springboot-petstore-server-spring-pageable.yaml index 85dadcac577c..3f48b041c094 100644 --- a/bin/configs/springboot-petstore-server-spring-pageable.yaml +++ b/bin/configs/springboot-petstore-server-spring-pageable.yaml @@ -4,6 +4,8 @@ library: spring-boot inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing-with-spring-pageable.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" documentationProvider: springdoc artifactId: springboot-spring-pageable hideGenerationTimestamp: 'true' diff --git a/bin/configs/springboot-petstore-server-spring-provide-args.yaml b/bin/configs/springboot-petstore-server-spring-provide-args.yaml index 09ed7ec421be..b1afd47a7095 100644 --- a/bin/configs/springboot-petstore-server-spring-provide-args.yaml +++ b/bin/configs/springboot-petstore-server-spring-provide-args.yaml @@ -4,5 +4,7 @@ library: spring-boot inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-spring-provide-args.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" artifactId: springboot-spring-provide-args hideGenerationTimestamp: 'true' diff --git a/docs/generators/java-camel.md b/docs/generators/java-camel.md index 2e2d5191f02f..8e58d56d5696 100644 --- a/docs/generators/java-camel.md +++ b/docs/generators/java-camel.md @@ -64,6 +64,8 @@ These options may be applied as additional-properties (cli) or configOptions (pl |generateBuilders|Whether to generate builders for models| |false| |generateConstructorWithAllArgs|whether to generate a constructor for all arguments| |false| |generateGenericResponseEntity|Use a generic type for the `ResponseEntity` wrapping return values of generated API methods. If enabled, method are generated with return type ResponseEntity<?>| |false| +|generateJsonIncludeAnnotations|Whether to generate policy @JsonInclude annotations on model properties. When true, emits spec-honest annotations (required-field protection and the optional non-nullable policy from optionalNonNullPropertyJsonInclude). When false, none are generated and the global ObjectMapper owns inclusion. When left unset it defaults to false (7.23.0-equivalent output) and logs a warning; set it explicitly to silence the warning. A per-property override set via the `x-jackson-json-include-policy` vendor extension is always honored regardless of this flag.| |false| +|generateJsonSetterNullsAnnotations|Whether to generate @JsonSetter(nulls = ...) annotations on optional non-nullable model properties. When true, emits @JsonSetter so an explicit null in the payload does not overwrite the field. When false, none are generated and deserialization null-handling defers to the global ObjectMapper. When left unset it defaults to false (7.23.0-equivalent output) and logs a warning; set it explicitly to silence the warning.| |false| |generatePageableConstraintValidation|Generate a @ValidPageable annotation and PageableConstraintValidator class, and apply @ValidPageable to the injected Pageable parameter of operations whose 'page' or 'size' parameter specifies a maximum constraint. The annotation enforces those constraints on the Pageable object that replaces the individual page/size query parameters. Requires useBeanValidation=true and library=spring-boot.| |false| |generateSortValidation|Generate a @ValidSort annotation and SortValidator class, and apply @ValidSort to the injected Pageable parameter of operations whose 'sort' parameter has enum values. The annotation validates that sort values in the Pageable object match the allowed enum values from the spec. Requires useBeanValidation=true and library=spring-boot.| |false| |generatedConstructorWithRequiredArgs|Whether to generate constructors with required args for models| |true| @@ -83,6 +85,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |modelPackage|package for generated models| |org.openapitools.model| |openApiNullable|Enable OpenAPI Jackson Nullable library. Not supported by `microprofile` library.| |true| |optionalAcceptNullable|Use `ofNullable` instead of just `of` to accept null values when using Optional.| |true| +|optionalNonNullPropertyJsonInclude|The Jackson @JsonInclude policy emitted for optional, non-nullable model properties when generateJsonIncludeAnnotations is true. NONE emits no annotation, deferring fully to the global ObjectMapper inclusion policy.|
**NON_NULL**
Omit the property when its value is null (default, spec-safe for non-nullable fields).
**NON_EMPTY**
Omit the property when its value is null or considered empty.
**NON_DEFAULT**
Omit the property when its value equals the default.
**NONE**
Emit no @JsonInclude annotation; defer to the global ObjectMapper.
|NON_NULL| |parentArtifactId|parent artifactId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| |parentGroupId|parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| |parentVersion|parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| @@ -153,6 +156,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |x-minimum-message|Add this property whenever you need to customize the invalidation error message for the minimum value of a variable|FIELD, OPERATION_PARAMETER|null |x-maximum-message|Add this property whenever you need to customize the invalidation error message for the maximum value of a variable|FIELD, OPERATION_PARAMETER|null |x-spring-api-version|Value for 'version' attribute in @RequestMapping (for Spring 7 and above).|OPERATION|null +|x-jackson-json-include-policy|Manually override the resolved Jackson `@JsonInclude` policy for this property. Must be one of `ALWAYS`, `NON_NULL`, `NON_ABSENT`, `NON_EMPTY`, `NON_DEFAULT`, `USE_DEFAULTS`, `CUSTOM`, or `NONE` to emit no annotation. Always wins over the automatic required/nullable matrix and the `optionalNonNullPropertyJsonInclude` option.|FIELD|resolved automatically per the required/nullable matrix ## IMPORT MAPPING diff --git a/docs/generators/kotlin-spring.md b/docs/generators/kotlin-spring.md index f42388d53000..e821e8b34cf0 100644 --- a/docs/generators/kotlin-spring.md +++ b/docs/generators/kotlin-spring.md @@ -33,6 +33,8 @@ These options may be applied as additional-properties (cli) or configOptions (pl |documentationProvider|Select the OpenAPI documentation provider.|
**none**
Do not publish an OpenAPI specification.
**source**
Publish the original input OpenAPI specification.
**springdoc**
Generate an OpenAPI 3 specification using SpringDoc.
|springdoc| |enumPropertyNaming|Naming convention for enum properties: 'camelCase', 'PascalCase', 'snake_case', 'UPPERCASE', 'original', and 'bestEffortBacktick' (like 'original' but tries to wrap values in backticks before falling back to sanitizing, e.g. `name,asc` stays `name,asc` rather than becoming nameCommaAsc; useful for sort/order enums)| |original| |exceptionHandler|generate default global exception handlers (not compatible with reactive. enabling reactive will disable exceptionHandler )| |true| +|generateJsonIncludeAnnotations|Whether to generate policy @JsonInclude annotations on model properties. When true, emits spec-honest annotations (required-field protection and the optional non-nullable policy from optionalNonNullPropertyJsonInclude). When false, none are generated and the global ObjectMapper owns inclusion. When left unset it defaults to false (7.23.0-equivalent output) and logs a warning; set it explicitly to silence the warning. A per-property override set via the `x-jackson-json-include-policy` vendor extension is always honored regardless of this flag.| |false| +|generateJsonSetterNullsAnnotations|Whether to generate @JsonSetter(nulls = ...) annotations on optional non-nullable model properties. When true, emits @JsonSetter (Nulls.FAIL when openApiNullable is true, otherwise Nulls.SKIP) so an explicit null in the payload is handled explicitly. When false, none are generated and deserialization null-handling defers to the global ObjectMapper. When left unset it defaults to false (7.23.0-equivalent output) and logs a warning; set it explicitly to silence the warning.| |false| |generatePageableConstraintValidation|Generate a @ValidPageable annotation and PageableConstraintValidator class, and apply @ValidPageable to the injected Pageable parameter of operations whose 'page' or 'size' parameter specifies a maximum constraint. The annotation enforces those constraints on the Pageable object that replaces the individual page/size query parameters. Requires useBeanValidation=true and library=spring-boot.| |false| |generateSortValidation|Generate a @ValidSort annotation and SortValidator class, and apply @ValidSort to the injected Pageable parameter of operations whose 'sort' parameter has enum values. The annotation validates that sort values in the Pageable object match the allowed enum values from the spec. Requires useBeanValidation=true and library=spring-boot.| |false| |gradleBuildFile|generate a gradle build file using the Kotlin DSL| |true| @@ -44,6 +46,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |modelMutable|Create mutable models| |false| |modelPackage|model package for generated code| |org.openapitools.model| |openApiNullable|Enable OpenAPI Jackson Nullable library (jackson-databind-nullable) for strict null handling. Controls how optional + non-nullable properties (required: false, nullable: false) handle explicit JSON null: when false (default), @JsonSetter(nulls = Nulls.SKIP) is used — explicit null is silently ignored (lenient, protects any default value from being overridden); when true, @JsonSetter(nulls = Nulls.FAIL) is used — explicit null causes deserialization to fail (strict, enforces the non-nullable contract, useful for PATCH semantics). Additionally, when true, optional + nullable properties (required: false, nullable: true) use JsonNullable<T> = JsonNullable.undefined() to distinguish between a missing key and an explicit null. Requires jackson-databind-nullable >= 0.2.10 when used with useJackson3.| |false| +|optionalNonNullPropertyJsonInclude|The Jackson @JsonInclude policy emitted for optional, non-nullable model properties when generateJsonIncludeAnnotations is true. NONE emits no annotation, deferring fully to the global ObjectMapper inclusion policy.|
**NON_NULL**
Omit the property when its value is null (default, spec-safe for non-nullable fields).
**NON_EMPTY**
Omit the property when its value is null or considered empty.
**NON_DEFAULT**
Omit the property when its value equals the default.
**NONE**
Emit no @JsonInclude annotation; defer to the global ObjectMapper.
|NON_NULL| |packageName|Generated artifact package name.| |org.openapitools| |parcelizeModels|toggle "@Parcelize" for generated models| |null| |reactive|use coroutines for reactive behavior| |false| @@ -94,6 +97,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |x-kotlin-implements|Ability to specify interfaces that model must implement|MODEL|empty array |x-kotlin-implements-fields|Specify attributes that are implemented by the interface(s) added via `x-kotlin-implements`|MODEL|empty array |x-spring-paginated|Add `org.springframework.data.domain.Pageable` to controller method. Can be used to handle `page`, `size` and `sort` query parameters. If these query parameters are also specified in the operation spec, they will be removed from the controller method as their values can be obtained from the `Pageable` object. Only applies when `library=spring-boot`; ignored for client libraries (spring-cloud, spring-declarative-http-interface).|OPERATION|false +|x-jackson-json-include-policy|Manually override the resolved Jackson `@JsonInclude` policy for this property. Must be one of `ALWAYS`, `NON_NULL`, `NON_ABSENT`, `NON_EMPTY`, `NON_DEFAULT`, `USE_DEFAULTS`, `CUSTOM`, or `NONE` to emit no annotation. Always wins over the automatic required/nullable matrix and the `optionalNonNullPropertyJsonInclude` option.|FIELD|resolved automatically per the required/nullable matrix ## IMPORT MAPPING diff --git a/docs/generators/spring.md b/docs/generators/spring.md index 31f5f55ff4a5..f03b4183ef93 100644 --- a/docs/generators/spring.md +++ b/docs/generators/spring.md @@ -57,6 +57,8 @@ These options may be applied as additional-properties (cli) or configOptions (pl |generateBuilders|Whether to generate builders for models| |false| |generateConstructorWithAllArgs|whether to generate a constructor for all arguments| |false| |generateGenericResponseEntity|Use a generic type for the `ResponseEntity` wrapping return values of generated API methods. If enabled, method are generated with return type ResponseEntity<?>| |false| +|generateJsonIncludeAnnotations|Whether to generate policy @JsonInclude annotations on model properties. When true, emits spec-honest annotations (required-field protection and the optional non-nullable policy from optionalNonNullPropertyJsonInclude). When false, none are generated and the global ObjectMapper owns inclusion. When left unset it defaults to false (7.23.0-equivalent output) and logs a warning; set it explicitly to silence the warning. A per-property override set via the `x-jackson-json-include-policy` vendor extension is always honored regardless of this flag.| |false| +|generateJsonSetterNullsAnnotations|Whether to generate @JsonSetter(nulls = ...) annotations on optional non-nullable model properties. When true, emits @JsonSetter so an explicit null in the payload does not overwrite the field. When false, none are generated and deserialization null-handling defers to the global ObjectMapper. When left unset it defaults to false (7.23.0-equivalent output) and logs a warning; set it explicitly to silence the warning.| |false| |generatePageableConstraintValidation|Generate a @ValidPageable annotation and PageableConstraintValidator class, and apply @ValidPageable to the injected Pageable parameter of operations whose 'page' or 'size' parameter specifies a maximum constraint. The annotation enforces those constraints on the Pageable object that replaces the individual page/size query parameters. Requires useBeanValidation=true and library=spring-boot.| |false| |generateSortValidation|Generate a @ValidSort annotation and SortValidator class, and apply @ValidSort to the injected Pageable parameter of operations whose 'sort' parameter has enum values. The annotation validates that sort values in the Pageable object match the allowed enum values from the spec. Requires useBeanValidation=true and library=spring-boot.| |false| |generatedConstructorWithRequiredArgs|Whether to generate constructors with required args for models| |true| @@ -76,6 +78,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |modelPackage|package for generated models| |org.openapitools.model| |openApiNullable|Enable OpenAPI Jackson Nullable library. Not supported by `microprofile` library.| |true| |optionalAcceptNullable|Use `ofNullable` instead of just `of` to accept null values when using Optional.| |true| +|optionalNonNullPropertyJsonInclude|The Jackson @JsonInclude policy emitted for optional, non-nullable model properties when generateJsonIncludeAnnotations is true. NONE emits no annotation, deferring fully to the global ObjectMapper inclusion policy.|
**NON_NULL**
Omit the property when its value is null (default, spec-safe for non-nullable fields).
**NON_EMPTY**
Omit the property when its value is null or considered empty.
**NON_DEFAULT**
Omit the property when its value equals the default.
**NONE**
Emit no @JsonInclude annotation; defer to the global ObjectMapper.
|NON_NULL| |parentArtifactId|parent artifactId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| |parentGroupId|parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| |parentVersion|parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| @@ -146,6 +149,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |x-minimum-message|Add this property whenever you need to customize the invalidation error message for the minimum value of a variable|FIELD, OPERATION_PARAMETER|null |x-maximum-message|Add this property whenever you need to customize the invalidation error message for the maximum value of a variable|FIELD, OPERATION_PARAMETER|null |x-spring-api-version|Value for 'version' attribute in @RequestMapping (for Spring 7 and above).|OPERATION|null +|x-jackson-json-include-policy|Manually override the resolved Jackson `@JsonInclude` policy for this property. Must be one of `ALWAYS`, `NON_NULL`, `NON_ABSENT`, `NON_EMPTY`, `NON_DEFAULT`, `USE_DEFAULTS`, `CUSTOM`, or `NONE` to emit no annotation. Always wins over the automatic required/nullable matrix and the `optionalNonNullPropertyJsonInclude` option.|FIELD|resolved automatically per the required/nullable matrix ## IMPORT MAPPING diff --git a/docs/migration-guide.adoc b/docs/migration-guide.adoc index 591aebe82c91..9664005dd6a2 100644 --- a/docs/migration-guide.adoc +++ b/docs/migration-guide.adoc @@ -11,6 +11,43 @@ Another approach to find breaking changes is to look at issue and pull requests * link:https://github.com/OpenAPITools/openapi-generator/labels/Breaking%20change%20%28with%20fallback%29[Breaking change (with fallback)] * link:https://github.com/OpenAPITools/openapi-generator/labels/Breaking%20change%20%28without%20fallback%29[Breaking change (without fallback)] +=== From 7.24.x to 7.25.0 (java-spring / kotlin-spring) + +Version `7.24.0` (link:https://github.com/OpenAPITools/openapi-generator/pull/23993[#23993]) started emitting field-level Jackson annotations on model properties for the `spring` and `kotlin-spring` generators: + +* `@JsonInclude(...)` on properties (serialization), and +* `@JsonSetter(nulls = ...)` on optional non-nullable properties (deserialization). + +Field-level `@JsonInclude` overrides the project-wide `ObjectMapper` inclusion policy (for example `spring.jackson.default-property-inclusion=non_empty`), which silently changed the wire contract for projects that upgraded. See link:https://github.com/OpenAPITools/openapi-generator/issues/24401[#24401]. + +Starting with `7.25.0`, emission of these annotations is controlled by two independent, opt-in options. When an option is left **unset**, the generator defaults to the pre-`7.24.0` (`7.23.0`) behavior — *no* annotations are emitted — and logs a warning so the choice is visible even on transitive upgrades. Set the option explicitly to silence the warning. + +==== Serialization: `@JsonInclude` + +* `generateJsonIncludeAnnotations` (boolean) +** unset (default) → no `@JsonInclude` annotations; inclusion is governed entirely by the global `ObjectMapper` (a warning is logged). +** `false` → same weak behavior, warning silenced. +** `true` → emit spec-honest `@JsonInclude` annotations (required-field contract protection plus the optional non-nullable policy below). +* `optionalNonNullPropertyJsonInclude` (enum, default `NON_NULL`) → the policy emitted for optional non-nullable properties when `generateJsonIncludeAnnotations=true`. One of `NON_NULL` / `NON_EMPTY` / `NON_DEFAULT` / `NONE` (`NONE` emits nothing). + +A per-property override set via the `x-jackson-json-include-policy` vendor extension always wins, regardless of these flags. + +==== Deserialization: `@JsonSetter(nulls = ...)` + +* `generateJsonSetterNullsAnnotations` (boolean) +** unset (default) → no `@JsonSetter(nulls = ...)` annotations; null-handling is governed by the global `ObjectMapper` (a warning is logged). +** `false` → same weak behavior, warning silenced. +** `true` → emit `@JsonSetter(nulls = ...)` on optional non-nullable properties. + +[NOTE] +==== +This also affects the `kotlin-spring` strict-null (PATCH) behavior. In `7.24.x`, an optional non-nullable property generated with `openApiNullable=true` emitted `@JsonSetter(nulls = Nulls.FAIL)`, so an explicit `null` in the payload was rejected. From `7.25.0`, that annotation is only emitted when `generateJsonSetterNullsAnnotations=true`. Leaving the option unset (or `false`) means an explicit `null` is handled by the global `ObjectMapper` instead of failing. Set `generateJsonSetterNullsAnnotations=true` to restore the strict `Nulls.FAIL` behavior. +==== + +==== Note + +`@JsonInclude(NON_ABSENT)` is no longer emitted on `JsonNullable` fields: the `JsonNullable` module already governs their inclusion, so the annotation was redundant. + === From 3.x to 4.0.0 Version `4.0.0` is a major release, which contains some breaking changes without fallback. diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenConstants.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenConstants.java index ad507e2ff370..443acd45962d 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenConstants.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenConstants.java @@ -415,6 +415,12 @@ public static enum ENUM_PROPERTY_NAMING_TYPE {camelCase, PascalCase, snake_case, public static final String USE_VERTX_5 = "useVertx5"; public static final String USE_VERTX_5_DESC = "Setting this property to true will generate Vert.x 5 specific callbacks using Callables."; + public static final String OPTIONAL_NON_NULL_PROPERTY_JSON_INCLUDE = "optionalNonNullPropertyJsonInclude"; + + public static final String GENERATE_JSON_INCLUDE_ANNOTATIONS = "generateJsonIncludeAnnotations"; + + public static final String GENERATE_JSON_SETTER_NULLS_ANNOTATIONS = "generateJsonSetterNullsAnnotations"; + public static final String DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT = "disallowAdditionalPropertiesIfNotPresent"; public static final String DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT_DESC = "If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. " + diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/VendorExtension.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/VendorExtension.java index 288ca9d0fb99..638bbe62b2fd 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/VendorExtension.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/VendorExtension.java @@ -31,7 +31,8 @@ public enum VendorExtension { X_SIZE_MESSAGE("x-size-message", Arrays.asList(ExtensionLevel.FIELD, ExtensionLevel.OPERATION_PARAMETER), "Add this property whenever you need to customize the invalidation error message for the size or length of a variable", null), X_MINIMUM_MESSAGE("x-minimum-message", Arrays.asList(ExtensionLevel.FIELD, ExtensionLevel.OPERATION_PARAMETER), "Add this property whenever you need to customize the invalidation error message for the minimum value of a variable", null), X_MAXIMUM_MESSAGE("x-maximum-message", Arrays.asList(ExtensionLevel.FIELD, ExtensionLevel.OPERATION_PARAMETER), "Add this property whenever you need to customize the invalidation error message for the maximum value of a variable", null), - X_ZERO_BASED_ENUM("x-zero-based-enum", ExtensionLevel.MODEL, "When used on an enum, the index will not be generated and the default numbering will be used, zero-based", "false"); + X_ZERO_BASED_ENUM("x-zero-based-enum", ExtensionLevel.MODEL, "When used on an enum, the index will not be generated and the default numbering will be used, zero-based", "false"), + X_JACKSON_JSON_INCLUDE_POLICY("x-jackson-json-include-policy", ExtensionLevel.FIELD, "Manually override the resolved Jackson `@JsonInclude` policy for this property. Must be one of `ALWAYS`, `NON_NULL`, `NON_ABSENT`, `NON_EMPTY`, `NON_DEFAULT`, `USE_DEFAULTS`, `CUSTOM`, or `NONE` to emit no annotation. Always wins over the automatic required/nullable matrix and the `optionalNonNullPropertyJsonInclude` option.", "resolved automatically per the required/nullable matrix"); private final String name; private final List levels; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinSpringServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinSpringServerCodegen.java index baaa203e60b4..66436687f4bf 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinSpringServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinSpringServerCodegen.java @@ -34,7 +34,10 @@ import org.openapitools.codegen.model.OperationMap; import org.openapitools.codegen.model.OperationsMap; import org.openapitools.codegen.templating.mustache.SpringHttpStatusLambda; +import org.openapitools.codegen.utils.JsonAnnotationPolicyUtils; +import org.openapitools.codegen.utils.JsonIncludePolicy; import org.openapitools.codegen.utils.ModelUtils; +import org.openapitools.codegen.utils.TriStateBoolean; import org.openapitools.codegen.utils.URLPathUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -184,6 +187,9 @@ public String getDescription() { @Setter private boolean useEnumValueInterface = false; private String valuedEnumClassName = "ValuedEnum"; @Setter private boolean suspendFunctions = false; + @Getter @Setter private JsonIncludePolicy optionalNonNullPropertyJsonInclude = JsonIncludePolicy.NON_NULL; + @Getter @Setter private TriStateBoolean generateJsonIncludeAnnotations = TriStateBoolean.UNSET; + @Getter @Setter private TriStateBoolean generateJsonSetterNullsAnnotations = TriStateBoolean.UNSET; @Getter @Setter private boolean openApiNullable = false; @Getter @Setter protected boolean useDeductionForOneOfInterfaces = false; @@ -315,6 +321,23 @@ public KotlinSpringServerCodegen() { substituteGenericPagedModel); addSwitch(COMPANION_OBJECT, "Whether to generate companion objects in data classes, enabling companion extensions.", companionObject); addSwitch(SUSPEND_FUNCTIONS, "Whether to generate suspend functions for API operations. Useful for Spring MVC with Kotlin coroutines without requiring the full reactive stack.", suspendFunctions); + + CliOption optionalNonNullPropertyJsonIncludeOpt = CliOption.newString(CodegenConstants.OPTIONAL_NON_NULL_PROPERTY_JSON_INCLUDE, + JsonAnnotationPolicyUtils.OPTIONAL_NON_NULL_PROPERTY_JSON_INCLUDE_DESC); + for (JsonIncludePolicy policy : JsonIncludePolicy.OPTIONAL_NON_NULL_POLICIES) { + optionalNonNullPropertyJsonIncludeOpt.addEnum(policy.name(), policy.getDescription()); + } + optionalNonNullPropertyJsonIncludeOpt.setDefault(optionalNonNullPropertyJsonInclude.name()); + cliOptions.add(optionalNonNullPropertyJsonIncludeOpt); + + addSwitch(CodegenConstants.GENERATE_JSON_INCLUDE_ANNOTATIONS, + JsonAnnotationPolicyUtils.GENERATE_JSON_INCLUDE_ANNOTATIONS_DESC, false); + addSwitch(CodegenConstants.GENERATE_JSON_SETTER_NULLS_ANNOTATIONS, + "Whether to generate @JsonSetter(nulls = ...) annotations on optional non-nullable model properties. " + + "When true, emits @JsonSetter (Nulls.FAIL when openApiNullable is true, otherwise Nulls.SKIP) so " + + "an explicit null in the payload is handled explicitly. When false, none are generated and " + + "deserialization null-handling defers to the global ObjectMapper. When left unset it defaults to " + + "false (7.23.0-equivalent output) and logs a warning; set it explicitly to silence the warning.", false); cliOptions.add(CliOption.newBoolean(CodegenConstants.USE_DEDUCTION_FOR_ONE_OF_INTERFACES, CodegenConstants.USE_DEDUCTION_FOR_ONE_OF_INTERFACES_DESC, useDeductionForOneOfInterfaces)); addSwitch(CodegenConstants.USE_ENUM_VALUE_INTERFACE, CodegenConstants.USE_ENUM_VALUE_INTERFACE_DESC, useEnumValueInterface); addSwitch(CodegenConstants.OPENAPI_NULLABLE, @@ -735,6 +758,19 @@ public void processOpts() { } writePropertyBack(SUSPEND_FUNCTIONS, suspendFunctions); + if (additionalProperties.containsKey(CodegenConstants.GENERATE_JSON_INCLUDE_ANNOTATIONS)) { + this.generateJsonIncludeAnnotations = TriStateBoolean.fromNullableBoolean(convertPropertyToBoolean(CodegenConstants.GENERATE_JSON_INCLUDE_ANNOTATIONS)); + } + writePropertyBack(CodegenConstants.GENERATE_JSON_INCLUDE_ANNOTATIONS, generateJsonIncludeAnnotations.isTrue()); + if (additionalProperties.containsKey(CodegenConstants.GENERATE_JSON_SETTER_NULLS_ANNOTATIONS)) { + this.generateJsonSetterNullsAnnotations = TriStateBoolean.fromNullableBoolean(convertPropertyToBoolean(CodegenConstants.GENERATE_JSON_SETTER_NULLS_ANNOTATIONS)); + } + writePropertyBack(CodegenConstants.GENERATE_JSON_SETTER_NULLS_ANNOTATIONS, generateJsonSetterNullsAnnotations.isTrue()); + this.optionalNonNullPropertyJsonInclude = JsonAnnotationPolicyUtils.resolveOptionalNonNullPropertyJsonInclude( + additionalProperties, optionalNonNullPropertyJsonInclude); + writePropertyBack(CodegenConstants.OPTIONAL_NON_NULL_PROPERTY_JSON_INCLUDE, optionalNonNullPropertyJsonInclude.name()); + JsonAnnotationPolicyUtils.warnIfUnset(LOGGER, generateJsonIncludeAnnotations, generateJsonSetterNullsAnnotations); + if (additionalProperties.containsKey(BEAN_QUALIFIERS) && library.equals(SPRING_BOOT)) { this.setBeanQualifiers(convertPropertyToBoolean(BEAN_QUALIFIERS)); } @@ -1282,21 +1318,11 @@ public void postProcessModelProperty(CodegenModel model, CodegenProperty propert property.example = null; } - // Scenario 3: optional + non-nullable → always emit @JsonSetter to handle explicit JSON nulls. - // When openApiNullable=true: Nulls.FAIL → reject explicit null (strict PATCH semantics). - // When openApiNullable=false: Nulls.SKIP → silently ignore explicit null (lenient, protects defaults). - // Always emit @JsonInclude(NON_NULL) so null fields are omitted from serialized output regardless - // of who is deserializing on the other end — closer to spec, avoids round-trip failures. - if (!property.required && !property.isNullable) { - if (openApiNullable) { - property.vendorExtensions.put("x-has-json-setter-nulls-fail", true); - } else { - property.vendorExtensions.put("x-has-json-setter-nulls-skip", true); - } - model.imports.add("JsonSetter"); - model.imports.add("Nulls"); - model.imports.add("JsonInclude"); - } + // Emit @JsonSetter(nulls = ...) for optional, non-nullable properties when enabled; see + // JsonAnnotationPolicyUtils#resolveJsonSetterNullsMode for the full SKIP/FAIL rules. kotlin-spring + // supports both SKIP and FAIL (failModeSupported=true), unlike spring (SKIP-only). + applyJsonSetterNullsMode(model, property, JsonAnnotationPolicyUtils.resolveJsonSetterNullsMode( + generateJsonSetterNullsAnnotations, property.required, property.isNullable, openApiNullable, true)); // Scenario 4: optional + nullable with openApiNullable → use JsonNullable = JsonNullable.undefined() // so callers can distinguish between a missing key and an explicitly provided null. @@ -1305,6 +1331,8 @@ public void postProcessModelProperty(CodegenModel model, CodegenProperty propert model.imports.add("JsonNullable"); } + resolveJsonIncludePolicy(model, property); + //Add imports for Jackson if (!model.isEnum) { model.imports.add("JsonProperty"); @@ -1324,6 +1352,32 @@ public void postProcessModelProperty(CodegenModel model, CodegenProperty propert } } + /** + * Apply the resolved {@code @JsonSetter(nulls = ...)} mode to a property: sets the + * {@code x-has-json-setter-nulls-skip}/{@code -fail} vendor extension and adds the required imports. + */ + private void applyJsonSetterNullsMode(CodegenModel model, CodegenProperty property, JsonAnnotationPolicyUtils.JsonSetterNullsMode mode) { + if (mode == JsonAnnotationPolicyUtils.JsonSetterNullsMode.NONE) { + return; + } + property.vendorExtensions.put(mode == JsonAnnotationPolicyUtils.JsonSetterNullsMode.FAIL + ? "x-has-json-setter-nulls-fail" : "x-has-json-setter-nulls-skip", true); + model.imports.add("JsonSetter"); + model.imports.add("Nulls"); + } + + /** + * Resolve the {@code @JsonInclude} policy into the single universal + * {@code x-jackson-json-include-policy} vendor extension the template emits. See + * {@link JsonAnnotationPolicyUtils#resolveJsonIncludePolicy} for the full precedence rules; here, required + * properties (nullable or not) always resolve to {@code ALWAYS} since Kotlin's non-nullable types can + * never hold null. + */ + private void resolveJsonIncludePolicy(CodegenModel model, CodegenProperty property) { + JsonAnnotationPolicyUtils.resolveJsonIncludePolicy(model, property, generateJsonIncludeAnnotations, + optionalNonNullPropertyJsonInclude, JsonIncludePolicy.ALWAYS, JsonIncludePolicy.ALWAYS); + } + @Override public void addImportsToOneOfInterface(List> imports) { if (additionalProperties.containsKey("jackson")) { @@ -1468,19 +1522,18 @@ public ModelsMap postProcessModelsEnum(ModelsMap objs) { for (ModelMap mo : objs.getModels()) { CodegenModel cm = mo.getModel(); for (CodegenProperty var : cm.optionalVars) { - // Scenario 3: optional + non-nullable → always emit @JsonSetter and @JsonInclude(NON_NULL). + // Scenario 3: optional + non-nullable → emit @JsonSetter when generateJsonSetterNullsAnnotations is enabled. // openApiNullable=true: Nulls.FAIL (strict). openApiNullable=false: Nulls.SKIP (lenient). - if (!var.required && !var.isNullable) { - if (openApiNullable) { - var.vendorExtensions.put("x-has-json-setter-nulls-fail", true); - } else { - var.vendorExtensions.put("x-has-json-setter-nulls-skip", true); - } - } + applyJsonSetterNullsMode(cm, var, JsonAnnotationPolicyUtils.resolveJsonSetterNullsMode( + generateJsonSetterNullsAnnotations, var.required, var.isNullable, openApiNullable, true)); // Scenario 4: optional + nullable with openApiNullable → use JsonNullable if (openApiNullable && !var.required && var.isNullable) { var.vendorExtensions.put("x-is-jackson-optional-nullable", true); } + resolveJsonIncludePolicy(cm, var); + } + for (CodegenProperty var : cm.requiredVars) { + resolveJsonIncludePolicy(cm, var); } } @@ -1784,6 +1837,7 @@ public List getSupportedVendorExtensions() { extensions.add(VendorExtension.X_KOTLIN_IMPLEMENTS); extensions.add(VendorExtension.X_KOTLIN_IMPLEMENTS_FIELDS); extensions.add(VendorExtension.X_SPRING_PAGINATED); + extensions.add(VendorExtension.X_JACKSON_JSON_INCLUDE_POLICY); return extensions; } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java index 1ab10fd19d09..a449baca3e6d 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java @@ -40,8 +40,11 @@ import org.openapitools.codegen.templating.mustache.SplitStringLambda; import org.openapitools.codegen.templating.mustache.SpringHttpStatusLambda; import org.openapitools.codegen.templating.mustache.TrimWhitespaceLambda; +import org.openapitools.codegen.utils.JsonAnnotationPolicyUtils; +import org.openapitools.codegen.utils.JsonIncludePolicy; import org.openapitools.codegen.utils.ModelUtils; import org.openapitools.codegen.utils.ProcessUtils; +import org.openapitools.codegen.utils.TriStateBoolean; import org.openapitools.codegen.utils.URLPathUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -161,6 +164,9 @@ public enum RequestMappingMode { @Setter protected boolean apiFirst = false; protected boolean useOptional = false; @Setter protected boolean useSealed = false; + @Getter @Setter protected JsonIncludePolicy optionalNonNullPropertyJsonInclude = JsonIncludePolicy.NON_NULL; + @Getter @Setter protected TriStateBoolean generateJsonIncludeAnnotations = TriStateBoolean.UNSET; + @Getter @Setter protected TriStateBoolean generateJsonSetterNullsAnnotations = TriStateBoolean.UNSET; @Setter protected boolean virtualService = false; @Setter protected boolean hateoas = false; @Setter protected boolean returnSuccessCode = false; @@ -284,6 +290,23 @@ public SpringCodegen() { "Use Bean Validation Impl. to perform BeanValidation", performBeanValidation)); cliOptions.add(CliOption.newBoolean(USE_SEALED, "Whether to generate sealed model interfaces and classes")); + + CliOption optionalNonNullPropertyJsonIncludeOpt = CliOption.newString(CodegenConstants.OPTIONAL_NON_NULL_PROPERTY_JSON_INCLUDE, + JsonAnnotationPolicyUtils.OPTIONAL_NON_NULL_PROPERTY_JSON_INCLUDE_DESC); + for (JsonIncludePolicy policy : JsonIncludePolicy.OPTIONAL_NON_NULL_POLICIES) { + optionalNonNullPropertyJsonIncludeOpt.addEnum(policy.name(), policy.getDescription()); + } + optionalNonNullPropertyJsonIncludeOpt.setDefault(optionalNonNullPropertyJsonInclude.name()); + cliOptions.add(optionalNonNullPropertyJsonIncludeOpt); + + cliOptions.add(CliOption.newBoolean(CodegenConstants.GENERATE_JSON_INCLUDE_ANNOTATIONS, + JsonAnnotationPolicyUtils.GENERATE_JSON_INCLUDE_ANNOTATIONS_DESC, false)); + cliOptions.add(CliOption.newBoolean(CodegenConstants.GENERATE_JSON_SETTER_NULLS_ANNOTATIONS, + "Whether to generate @JsonSetter(nulls = ...) annotations on optional non-nullable model properties. " + + "When true, emits @JsonSetter so an explicit null in the payload does not overwrite the field. " + + "When false, none are generated and deserialization null-handling defers to the global ObjectMapper. " + + "When left unset it defaults to false (7.23.0-equivalent output) and logs a warning; set it " + + "explicitly to silence the warning.", false)); cliOptions.add(CliOption.newBoolean(API_FIRST, "Generate the API from the OAI spec at server compile time (API first approach)", apiFirst)); cliOptions @@ -558,6 +581,16 @@ public void processOpts() { convertPropertyToBooleanAndWriteBack(RETURN_SUCCESS_CODE, this::setReturnSuccessCode); convertPropertyToBooleanAndWriteBack(USE_SWAGGER_UI, this::setUseSwaggerUI); convertPropertyToBooleanAndWriteBack(USE_SEALED, this::setUseSealed); + convertPropertyToBooleanAndWriteBack(CodegenConstants.GENERATE_JSON_INCLUDE_ANNOTATIONS, + value -> this.generateJsonIncludeAnnotations = TriStateBoolean.fromNullableBoolean(value)); + convertPropertyToBooleanAndWriteBack(CodegenConstants.GENERATE_JSON_SETTER_NULLS_ANNOTATIONS, + value -> this.generateJsonSetterNullsAnnotations = TriStateBoolean.fromNullableBoolean(value)); + this.optionalNonNullPropertyJsonInclude = JsonAnnotationPolicyUtils.resolveOptionalNonNullPropertyJsonInclude( + additionalProperties, optionalNonNullPropertyJsonInclude); + additionalProperties.put(CodegenConstants.OPTIONAL_NON_NULL_PROPERTY_JSON_INCLUDE, optionalNonNullPropertyJsonInclude.name()); + if (jackson) { + JsonAnnotationPolicyUtils.warnIfUnset(LOGGER, generateJsonIncludeAnnotations, generateJsonSetterNullsAnnotations); + } if (DocumentationProvider.NONE.equals(getDocumentationProvider())) { this.setUseSwaggerUI(false); } @@ -1213,24 +1246,27 @@ public void postProcessModelProperty(CodegenModel model, CodegenProperty propert model.imports.add("Arrays"); } - // Optional + non-nullable: always emit @JsonInclude(NON_NULL) so null fields are omitted from - // serialized output regardless of who deserializes on the other end — closer to spec. - // When openApiNullable=false, also add @JsonSetter(nulls = Nulls.SKIP) on the setter. - if (!property.required && !property.isNullable) { - model.imports.add("JsonInclude"); - if (!openApiNullable) { - property.vendorExtensions.put("x-has-json-setter-nulls-skip", true); - model.imports.add("JsonSetter"); - model.imports.add("Nulls"); - } - } - // Optional + nullable with openApiNullable: emit @JsonInclude(NON_ABSENT) so that - // JsonNullable.undefined() is excluded from serialized output. - if (openApiNullable && !property.required && property.isNullable) { - model.imports.add("JsonInclude"); - } + // Optional + non-nullable, when openApiNullable=false: add @JsonSetter(nulls = Nulls.SKIP) on the + // setter so an explicit null in the payload does not overwrite the field's default. Only emitted when + // generateJsonSetterNullsAnnotations is explicitly enabled; otherwise deserialization defers to the mapper. + // spring never emits Nulls.FAIL (failModeSupported=false), unlike kotlin-spring. + JsonAnnotationPolicyUtils.JsonSetterNullsMode jsonSetterNullsMode = JsonAnnotationPolicyUtils.resolveJsonSetterNullsMode( + generateJsonSetterNullsAnnotations, property.required, property.isNullable, openApiNullable, false); + if (jsonSetterNullsMode == JsonAnnotationPolicyUtils.JsonSetterNullsMode.SKIP) { + property.vendorExtensions.put("x-has-json-setter-nulls-skip", true); + model.imports.add("JsonSetter"); + model.imports.add("Nulls"); + } + + // Resolve the @JsonInclude policy into the x-jackson-json-include-policy vendor extension; see + // JsonAnnotationPolicyUtils#resolveJsonIncludePolicy for the full precedence/matrix rules. For spring, + // required properties resolve to NON_NULL when non-nullable (contract protection) and ALWAYS when + // nullable (explicit null is valid and must be serialized). + JsonAnnotationPolicyUtils.resolveJsonIncludePolicy(model, property, generateJsonIncludeAnnotations, + optionalNonNullPropertyJsonInclude, JsonIncludePolicy.NON_NULL, JsonIncludePolicy.ALWAYS); } + @Override public CodegenModel fromModel(String name, Schema model) { CodegenModel codegenModel = super.fromModel(name, model); @@ -1565,6 +1601,7 @@ public List getSupportedVendorExtensions() { extensions.add(VendorExtension.X_MINIMUM_MESSAGE); extensions.add(VendorExtension.X_MAXIMUM_MESSAGE); extensions.add(VendorExtension.X_SPRING_API_VERSION); + extensions.add(VendorExtension.X_JACKSON_JSON_INCLUDE_POLICY); return extensions; } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/JsonAnnotationPolicyUtils.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/JsonAnnotationPolicyUtils.java new file mode 100644 index 000000000000..aae49411c61c --- /dev/null +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/JsonAnnotationPolicyUtils.java @@ -0,0 +1,247 @@ +/* + * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.openapitools.codegen.utils; + +import org.openapitools.codegen.CodegenConstants; +import org.openapitools.codegen.CodegenModel; +import org.openapitools.codegen.CodegenProperty; +import org.openapitools.codegen.VendorExtension; +import org.slf4j.Logger; + +import java.util.Map; + +/** + * Shared resolution/validation logic for the Jackson {@code @JsonInclude}/{@code @JsonSetter(nulls = ...)} + * config options and the {@code x-jackson-json-include-policy} vendor extension, used by both the + * {@code spring} and {@code kotlin-spring} generators (issue #24401). + */ +public final class JsonAnnotationPolicyUtils { + + /** Shared {@code CliOption} description for {@code optionalNonNullPropertyJsonInclude}. */ + public static final String OPTIONAL_NON_NULL_PROPERTY_JSON_INCLUDE_DESC = + "The Jackson @JsonInclude policy emitted for optional, non-nullable model properties when " + + CodegenConstants.GENERATE_JSON_INCLUDE_ANNOTATIONS + " is true. " + + "NONE emits no annotation, deferring fully to the global ObjectMapper inclusion policy."; + + /** Shared {@code CliOption} description for {@code generateJsonIncludeAnnotations}. */ + public static final String GENERATE_JSON_INCLUDE_ANNOTATIONS_DESC = + "Whether to generate policy @JsonInclude annotations on model properties. When true, emits " + + "spec-honest annotations (required-field protection and the optional non-nullable policy from " + + CodegenConstants.OPTIONAL_NON_NULL_PROPERTY_JSON_INCLUDE + "). When false, none are generated and the global " + + "ObjectMapper owns inclusion. When left unset it defaults to false (7.23.0-equivalent output) and " + + "logs a warning; set it explicitly to silence the warning. A per-property override set via the " + + "`x-jackson-json-include-policy` vendor extension is always honored regardless of this flag."; + + /** Resolved {@code @JsonSetter(nulls = ...)} annotation to emit for a property, if any. */ + public enum JsonSetterNullsMode { + /** No {@code @JsonSetter(nulls = ...)} annotation should be emitted. */ + NONE, + /** Emit {@code @JsonSetter(nulls = Nulls.SKIP)}: silently ignore an explicit JSON null. */ + SKIP, + /** Emit {@code @JsonSetter(nulls = Nulls.FAIL)}: reject an explicit JSON null. */ + FAIL + } + + private JsonAnnotationPolicyUtils() { + } + + /** + * Validate and normalize a manual per-property {@code x-jackson-json-include-policy} override. + * + * @param rawPolicy the raw vendor extension value set directly on the property in the spec + * @param extensionName the vendor extension key, used in the error message (kept generator-agnostic) + * @return the normalized (upper-case) policy name to emit, or {@code null} when the override means + * "emit no annotation" ({@code NONE}/blank), in which case the caller must drop the extension. + * @throws IllegalArgumentException when the override is not a valid {@code JsonInclude.Include} value. + */ + public static String resolveManualJsonIncludePolicy(Object rawPolicy, String extensionName) { + JsonIncludePolicy parsed; + try { + parsed = JsonIncludePolicy.parse(rawPolicy); + } catch (IllegalArgumentException e) { + throw new IllegalArgumentException(extensionName + + " must be a valid com.fasterxml.jackson.annotation.JsonInclude.Include value " + + "(ALWAYS, NON_NULL, NON_ABSENT, NON_EMPTY, NON_DEFAULT, USE_DEFAULTS, CUSTOM), or NONE to emit " + + "no annotation, but was: " + rawPolicy); + } + if (parsed == null || !parsed.isEmitted()) { + return null; + } + return parsed.name(); + } + + /** + * Validate and normalize the {@code optionalNonNullPropertyJsonInclude} config option value. + * + * @param policy the raw config option value (may be {@code null}, in which case the default + * {@code NON_NULL} is returned) + * @param optionName the config option name, used in the error message (kept generator-agnostic) + * @return the normalized (upper-case) policy name: one of {@code NON_NULL}, {@code NON_EMPTY}, + * {@code NON_DEFAULT}, {@code NONE}. + * @throws IllegalArgumentException when the value is not one of the supported policies. + */ + public static String normalizeJsonIncludePolicy(String policy, String optionName) { + if (policy == null) { + return JsonIncludePolicy.NON_NULL.name(); + } + JsonIncludePolicy parsed; + try { + parsed = JsonIncludePolicy.valueOf(policy.trim().toUpperCase(java.util.Locale.ROOT)); + } catch (IllegalArgumentException e) { + parsed = null; + } + if (parsed == null || !parsed.isValidOptionalNonNullPolicy()) { + throw new IllegalArgumentException(optionName + + " must be one of " + JsonIncludePolicy.OPTIONAL_NON_NULL_POLICIES + " but was: " + policy); + } + return parsed.name(); + } + + /** + * Read back the {@code optionalNonNullPropertyJsonInclude} config option from {@code additionalProperties}, + * validating/normalizing it via {@link #normalizeJsonIncludePolicy}. Returns {@code current} unchanged when + * the option was not present in {@code additionalProperties} (i.e. the generator's existing/default value is + * kept). Callers are responsible for writing the resolved value back via their own + * {@code writePropertyBack}/{@code additionalProperties.put} convention. + * + * @param additionalProperties the generator's additional properties map + * @param current the generator's current {@code optionalNonNullPropertyJsonInclude} value + * @return the resolved {@link JsonIncludePolicy} to assign to the generator's field + */ + public static JsonIncludePolicy resolveOptionalNonNullPropertyJsonInclude(Map additionalProperties, JsonIncludePolicy current) { + if (!additionalProperties.containsKey(CodegenConstants.OPTIONAL_NON_NULL_PROPERTY_JSON_INCLUDE)) { + return current; + } + return JsonIncludePolicy.valueOf(normalizeJsonIncludePolicy( + additionalProperties.get(CodegenConstants.OPTIONAL_NON_NULL_PROPERTY_JSON_INCLUDE).toString(), + CodegenConstants.OPTIONAL_NON_NULL_PROPERTY_JSON_INCLUDE)); + } + + /** + * Log the shared "option left unset, defaulting to false" warnings for + * {@code generateJsonIncludeAnnotations}/{@code generateJsonSetterNullsAnnotations} on the caller's own + * {@link Logger}. No-op for each option that is not {@link TriStateBoolean#UNSET}. + * + * @param logger the calling generator's own {@code LOGGER} + * @param generateJsonIncludeAnnotations the resolved {@code generateJsonIncludeAnnotations} state + * @param generateJsonSetterNullsAnnotations the resolved {@code generateJsonSetterNullsAnnotations} state + */ + public static void warnIfUnset(Logger logger, TriStateBoolean generateJsonIncludeAnnotations, TriStateBoolean generateJsonSetterNullsAnnotations) { + if (generateJsonIncludeAnnotations.isUnset()) { + logger.warn("'{}' is not set. Defaulting to false: no @JsonInclude annotations are generated and property " + + "inclusion is governed entirely by the global ObjectMapper (7.23.0-equivalent output). " + + "Set '{}=false' to keep this behavior and silence this warning, or '{}=true' to emit spec-honest " + + "@JsonInclude annotations (see '{}'). Note: before 7.24.0 released output had no field-level " + + "@JsonInclude, so leaving this unset preserves that behavior.", + CodegenConstants.GENERATE_JSON_INCLUDE_ANNOTATIONS, CodegenConstants.GENERATE_JSON_INCLUDE_ANNOTATIONS, + CodegenConstants.GENERATE_JSON_INCLUDE_ANNOTATIONS, CodegenConstants.OPTIONAL_NON_NULL_PROPERTY_JSON_INCLUDE); + } + if (generateJsonSetterNullsAnnotations.isUnset()) { + logger.warn("'{}' is not set. Defaulting to false: no @JsonSetter(nulls = ...) annotations are generated and " + + "deserialization null-handling is governed entirely by the global ObjectMapper (7.23.0-equivalent " + + "output). Set '{}=false' to keep this behavior and silence this warning, or '{}=true' to emit " + + "@JsonSetter(nulls = ...) on optional non-nullable fields.", + CodegenConstants.GENERATE_JSON_SETTER_NULLS_ANNOTATIONS, CodegenConstants.GENERATE_JSON_SETTER_NULLS_ANNOTATIONS, + CodegenConstants.GENERATE_JSON_SETTER_NULLS_ANNOTATIONS); + } + } + + /** + * Resolve the {@code @JsonInclude} policy into the single universal + * {@code x-jackson-json-include-policy} vendor extension the template emits, mutating {@code model.imports} + * and {@code property.vendorExtensions} in place. Precedence: + *
    + *
  1. A value set directly on the property (manual override in the spec) always wins.
  2. + *
  3. Otherwise, when {@code generateJsonIncludeAnnotations=true}, apply the automatic matrix: + *
      + *
    • required & non-nullable → {@code requiredNonNullablePolicy}
    • + *
    • required & nullable → {@code requiredNullablePolicy}
    • + *
    • optional & non-nullable → {@code optionalNonNullPropertyJsonInclude} + * (default {@code NON_NULL}, {@code NONE} = omit)
    • + *
    • optional & nullable → none (JsonNullable module already governs inclusion)
    • + *
    + *
  4. + *
+ * + *

The two "required" policies are supplied by the caller since the spring and kotlin-spring generators + * apply slightly different matrices there: kotlin-spring's non-nullable Kotlin types can never hold null, + * so it always uses {@code ALWAYS} for required properties, whereas spring uses {@code NON_NULL} for + * required-non-nullable (contract protection) and {@code ALWAYS} for required-nullable. + * + * @param model the model owning {@code property}, whose imports may be extended + * @param property the property to resolve the policy for + * @param generateJsonIncludeAnnotations the resolved {@code generateJsonIncludeAnnotations} state + * @param optionalNonNullPropertyJsonInclude the resolved {@code optionalNonNullPropertyJsonInclude} policy + * @param requiredNonNullablePolicy the policy to apply to required, non-nullable properties + * @param requiredNullablePolicy the policy to apply to required, nullable properties + */ + public static void resolveJsonIncludePolicy(CodegenModel model, CodegenProperty property, + TriStateBoolean generateJsonIncludeAnnotations, JsonIncludePolicy optionalNonNullPropertyJsonInclude, + JsonIncludePolicy requiredNonNullablePolicy, JsonIncludePolicy requiredNullablePolicy) { + if (property.vendorExtensions.containsKey(VendorExtension.X_JACKSON_JSON_INCLUDE_POLICY.getName())) { + String manualPolicy = resolveManualJsonIncludePolicy( + property.vendorExtensions.get(VendorExtension.X_JACKSON_JSON_INCLUDE_POLICY.getName()), VendorExtension.X_JACKSON_JSON_INCLUDE_POLICY.getName()); + if (manualPolicy != null) { + property.vendorExtensions.put(VendorExtension.X_JACKSON_JSON_INCLUDE_POLICY.getName(), manualPolicy); + model.imports.add("JsonInclude"); + } else { + // NONE / empty means "emit nothing"; drop the extension so the template renders no annotation. + property.vendorExtensions.remove(VendorExtension.X_JACKSON_JSON_INCLUDE_POLICY.getName()); + } + return; + } + if (!generateJsonIncludeAnnotations.isTrue()) { + return; + } + JsonIncludePolicy policy = null; + if (property.required) { + policy = property.isNullable ? requiredNullablePolicy : requiredNonNullablePolicy; + } else if (!property.isNullable) { + policy = optionalNonNullPropertyJsonInclude; + } + if (policy != null && policy.isEmitted()) { + property.vendorExtensions.put(VendorExtension.X_JACKSON_JSON_INCLUDE_POLICY.getName(), policy.name()); + model.imports.add("JsonInclude"); + } + } + + /** + * Resolve which {@code @JsonSetter(nulls = ...)} annotation, if any, should be emitted for an optional, + * non-nullable property. + * + * @param generateJsonSetterNullsAnnotations the resolved {@code generateJsonSetterNullsAnnotations} state + * @param required whether the property is required + * @param nullable whether the property is nullable + * @param openApiNullable whether the generator's {@code openApiNullable} option is enabled + * @param failModeSupported whether this generator supports {@link JsonSetterNullsMode#FAIL} (kotlin-spring + * does; spring currently only ever emits {@link JsonSetterNullsMode#SKIP}) + * @return {@link JsonSetterNullsMode#NONE} unless the property is optional and non-nullable and + * {@code generateJsonSetterNullsAnnotations} is explicitly enabled; otherwise {@link JsonSetterNullsMode#FAIL} + * when {@code openApiNullable && failModeSupported}, {@link JsonSetterNullsMode#SKIP} when + * {@code !openApiNullable}, or {@link JsonSetterNullsMode#NONE} when {@code openApiNullable && !failModeSupported}. + */ + public static JsonSetterNullsMode resolveJsonSetterNullsMode(TriStateBoolean generateJsonSetterNullsAnnotations, + boolean required, boolean nullable, boolean openApiNullable, boolean failModeSupported) { + if (!generateJsonSetterNullsAnnotations.isTrue() || required || nullable) { + return JsonSetterNullsMode.NONE; + } + if (openApiNullable) { + return failModeSupported ? JsonSetterNullsMode.FAIL : JsonSetterNullsMode.NONE; + } + return JsonSetterNullsMode.SKIP; + } +} diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/JsonIncludePolicy.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/JsonIncludePolicy.java new file mode 100644 index 000000000000..6c10f3f92b10 --- /dev/null +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/JsonIncludePolicy.java @@ -0,0 +1,80 @@ +package org.openapitools.codegen.utils; + +import lombok.Getter; + +import java.util.EnumSet; +import java.util.Locale; +import java.util.Set; + +/** + * Mirrors {@code com.fasterxml.jackson.annotation.JsonInclude.Include} (the set of policies a + * generated {@code @JsonInclude} annotation can be given), plus a {@link #NONE} sentinel meaning + * "emit no {@code @JsonInclude} annotation at all", used by the {@code spring} and + * {@code kotlin-spring} generators (issue #24401) for: + * + *

    + *
  • the {@code optionalNonNullPropertyJsonInclude} config option (restricted to + * {@link #NON_NULL}, {@link #NON_EMPTY}, {@link #NON_DEFAULT}, {@link #NONE} — see + * {@link #OPTIONAL_NON_NULL_POLICIES})
  • + *
  • the resolved {@code x-jackson-json-include-policy} vendor extension value, whether set + * manually on a property in the spec or computed by the automatic required/nullable matrix + * (any value is allowed there)
  • + *
+ */ +@Getter +public enum JsonIncludePolicy { + ALWAYS, + NON_NULL("Omit the property when its value is null (default, spec-safe for non-nullable fields)."), + NON_ABSENT, + NON_EMPTY("Omit the property when its value is null or considered empty."), + NON_DEFAULT("Omit the property when its value equals the default."), + USE_DEFAULTS, + CUSTOM, + /** Sentinel meaning "emit no {@code @JsonInclude} annotation". */ + NONE("Emit no @JsonInclude annotation; defer to the global ObjectMapper."); + + /** + * CLI-facing description, only populated for the values in {@link #OPTIONAL_NON_NULL_POLICIES} + * (the only ones ever offered as a {@code CliOption} enum choice); {@code null} otherwise. + */ + private final String description; + + JsonIncludePolicy() { + this(null); + } + + JsonIncludePolicy(String description) { + this.description = description; + } + + /** The subset of policies accepted for the {@code optionalNonNullPropertyJsonInclude} config option. */ + public static final Set OPTIONAL_NON_NULL_POLICIES = + EnumSet.of(NON_NULL, NON_EMPTY, NON_DEFAULT, NONE); + + /** Whether this policy should result in an emitted {@code @JsonInclude} annotation. */ + public boolean isEmitted() { + return this != NONE; + } + + /** Whether this policy is a valid value for the {@code optionalNonNullPropertyJsonInclude} config option. */ + public boolean isValidOptionalNonNullPolicy() { + return OPTIONAL_NON_NULL_POLICIES.contains(this); + } + + /** + * Parse a raw string (trimmed, case-insensitive) into a {@link JsonIncludePolicy}, or return + * {@code null} if blank/whitespace-only (callers treat that the same as {@link #NONE}). + * + * @throws IllegalArgumentException if non-blank but not a valid {@link JsonIncludePolicy} name + */ + public static JsonIncludePolicy parse(Object rawPolicy) { + if (rawPolicy == null) { + return null; + } + String trimmed = rawPolicy.toString().trim(); + if (trimmed.isEmpty()) { + return null; + } + return JsonIncludePolicy.valueOf(trimmed.toUpperCase(Locale.ROOT)); + } +} diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/TriStateBoolean.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/TriStateBoolean.java new file mode 100644 index 000000000000..c8a07567c0dd --- /dev/null +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/TriStateBoolean.java @@ -0,0 +1,44 @@ +package org.openapitools.codegen.utils; + +/** + * A tri-state toggle for boolean-like config options that need to distinguish "the user never set + * this" from an explicit {@code true}/{@code false}, e.g. so a weak default can be applied along + * with a one-time warning when the option was left unset, while an explicit {@code false} silently + * keeps the same default behavior. + * + *

This replaces the previous convention of using a boxed {@code Boolean} field where + * {@code null} meant "unset", which requires a code comment at every declaration site to be + * understandable. + */ +public enum TriStateBoolean { + /** The option was never explicitly set by the user (neither {@code true} nor {@code false}). */ + UNSET, + /** The option was explicitly set to {@code false}. */ + FALSE, + /** The option was explicitly set to {@code true}. */ + TRUE; + + /** Whether this state represents an explicit, affirmative opt-in ({@link #TRUE}). */ + public boolean isTrue() { + return this == TRUE; + } + + /** Whether the option was never explicitly set ({@link #UNSET}). */ + public boolean isUnset() { + return this == UNSET; + } + + /** + * Convert a nullable {@link Boolean} (the CLI/config-option convention where {@code null} means + * "not present in additionalProperties") into a {@link TriStateBoolean}. + * + * @param value {@code null} for unset, {@code Boolean.TRUE}/{@code Boolean.FALSE} for an explicit value + * @return {@link #UNSET}, {@link #TRUE}, or {@link #FALSE} + */ + public static TriStateBoolean fromNullableBoolean(Boolean value) { + if (value == null) { + return UNSET; + } + return value ? TRUE : FALSE; + } +} diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/pojo.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/pojo.mustache index 6dd2e6da00d2..b7f28efc82e9 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/pojo.mustache @@ -62,14 +62,12 @@ public {{>sealed}}class {{classname}}{{#parent}} extends {{{parent}}}{{/parent}} {{{.}}} {{/vendorExtensions.x-field-extra-annotation}} {{#jackson}} - {{^required}} - {{^isNullable}} - @JsonInclude(JsonInclude.Include.NON_NULL) - {{/isNullable}} - {{/required}} - {{#vendorExtensions.x-is-jackson-optional-nullable}} - @JsonInclude(JsonInclude.Include.NON_ABSENT) - {{/vendorExtensions.x-is-jackson-optional-nullable}} + {{#vendorExtensions.x-jackson-json-include-policy}} + @JsonInclude(JsonInclude.Include.{{{vendorExtensions.x-jackson-json-include-policy}}}) + {{/vendorExtensions.x-jackson-json-include-policy}} + {{#vendorExtensions.x-has-json-setter-nulls-skip}} + @JsonSetter(nulls = Nulls.SKIP) + {{/vendorExtensions.x-has-json-setter-nulls-skip}} {{/jackson}} {{#deprecated}} @Deprecated @@ -252,11 +250,6 @@ public {{>sealed}}class {{classname}}{{#parent}} extends {{{parent}}}{{/parent}} {{#vendorExtensions.x-setter-extra-annotation}} {{{vendorExtensions.x-setter-extra-annotation}}} {{/vendorExtensions.x-setter-extra-annotation}} - {{#jackson}} - {{#vendorExtensions.x-has-json-setter-nulls-skip}} - @JsonSetter(nulls = Nulls.SKIP) - {{/vendorExtensions.x-has-json-setter-nulls-skip}} - {{/jackson}} {{#deprecated}} @Deprecated {{/deprecated}} diff --git a/modules/openapi-generator/src/main/resources/kotlin-spring/dataClassOptVar.mustache b/modules/openapi-generator/src/main/resources/kotlin-spring/dataClassOptVar.mustache index 900c2e3f4662..78380ea41ac9 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-spring/dataClassOptVar.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-spring/dataClassOptVar.mustache @@ -2,9 +2,8 @@ @Schema({{#example}}example = "{{#lambdaRemoveLineBreak}}{{#lambdaEscapeInNormalString}}{{{.}}}{{/lambdaEscapeInNormalString}}{{/lambdaRemoveLineBreak}}", {{/example}}{{#isReadOnly}}readOnly = {{{isReadOnly}}}, {{/isReadOnly}}description = "{{{description}}}"){{/swagger2AnnotationLibrary}}{{#swagger1AnnotationLibrary}} @ApiModelProperty({{#example}}example = "{{#lambdaRemoveLineBreak}}{{#lambdaEscapeInNormalString}}{{{.}}}{{/lambdaEscapeInNormalString}}{{/lambdaRemoveLineBreak}}", {{/example}}{{#isReadOnly}}readOnly = {{{isReadOnly}}}, {{/isReadOnly}}value = "{{{description}}}"){{/swagger1AnnotationLibrary}}{{#deprecated}} @Deprecated(message = ""){{/deprecated}}{{#vendorExtensions.x-field-extra-annotation}} - {{{.}}}{{/vendorExtensions.x-field-extra-annotation}}{{^isNullable}} - @field:JsonInclude(JsonInclude.Include.NON_NULL){{/isNullable}}{{#vendorExtensions.x-is-jackson-optional-nullable}} - @field:JsonInclude(JsonInclude.Include.NON_ABSENT){{/vendorExtensions.x-is-jackson-optional-nullable}}{{#vendorExtensions.x-has-json-setter-nulls-skip}} + {{{.}}}{{/vendorExtensions.x-field-extra-annotation}}{{#vendorExtensions.x-jackson-json-include-policy}} + @field:JsonInclude(JsonInclude.Include.{{{vendorExtensions.x-jackson-json-include-policy}}}){{/vendorExtensions.x-jackson-json-include-policy}}{{#vendorExtensions.x-has-json-setter-nulls-skip}} @field:JsonSetter(nulls = Nulls.SKIP){{/vendorExtensions.x-has-json-setter-nulls-skip}}{{#vendorExtensions.x-has-json-setter-nulls-fail}} @field:JsonSetter(nulls = Nulls.FAIL){{/vendorExtensions.x-has-json-setter-nulls-fail}} @param:JsonProperty("{{{baseName}}}") diff --git a/modules/openapi-generator/src/main/resources/kotlin-spring/dataClassReqVar.mustache b/modules/openapi-generator/src/main/resources/kotlin-spring/dataClassReqVar.mustache index 2f07705c6dd0..e299d4582a3c 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-spring/dataClassReqVar.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-spring/dataClassReqVar.mustache @@ -1,6 +1,7 @@ {{#useBeanValidation}}{{>beanValidation}}{{>beanValidationModel}}{{/useBeanValidation}}{{#swagger2AnnotationLibrary}} @Schema({{#example}}example = "{{#lambdaRemoveLineBreak}}{{#lambdaEscapeInNormalString}}{{{.}}}{{/lambdaEscapeInNormalString}}{{/lambdaRemoveLineBreak}}", {{/example}}required = true, {{#isReadOnly}}readOnly = {{{isReadOnly}}}, {{/isReadOnly}}description = "{{{description}}}"){{/swagger2AnnotationLibrary}}{{#swagger1AnnotationLibrary}} @ApiModelProperty({{#example}}example = "{{#lambdaRemoveLineBreak}}{{#lambdaEscapeInNormalString}}{{{.}}}{{/lambdaEscapeInNormalString}}{{/lambdaRemoveLineBreak}}", {{/example}}required = true, {{#isReadOnly}}readOnly = {{{isReadOnly}}}, {{/isReadOnly}}value = "{{{description}}}"){{/swagger1AnnotationLibrary}}{{#vendorExtensions.x-field-extra-annotation}} - {{{.}}}{{/vendorExtensions.x-field-extra-annotation}} + {{{.}}}{{/vendorExtensions.x-field-extra-annotation}}{{#vendorExtensions.x-jackson-json-include-policy}} + @field:JsonInclude(JsonInclude.Include.{{{vendorExtensions.x-jackson-json-include-policy}}}){{/vendorExtensions.x-jackson-json-include-policy}} @param:JsonProperty("{{{baseName}}}") @get:JsonProperty("{{{baseName}}}", required = true){{#isInherited}} override{{/isInherited}} {{>modelMutable}} {{{name}}}: {{#isEnum}}{{#isArray}}{{baseType}}<{{/isArray}}{{classname}}.{{{nameInPascalCase}}}{{#isArray}}>{{/isArray}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{#isNullable}}?{{/isNullable}}{{#defaultValue}} = {{^isNumber}}{{{defaultValue}}}{{/isNumber}}{{#isNumber}}{{{dataType}}}("{{{defaultValue}}}"){{/isNumber}}{{/defaultValue}} \ No newline at end of file diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java index 2193ee5c9f9f..42ea848788da 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java @@ -8294,57 +8294,333 @@ void issue24003() throws IOException { } /** - * Scenario 4 (openApiNullable=true): optional+nullable field must carry - * {@code @JsonInclude(JsonInclude.Include.NON_ABSENT)} so that Jackson - * excludes {@code JsonNullable.undefined()} from serialized output. + * Issue #24401: the {@code @JsonInclude(NON_ABSENT)} annotation must no longer be emitted for + * {@code JsonNullable} fields, as the JsonNullable module already governs their inclusion. */ @Test - void optionalNullableField_withOpenApiNullable_hasNonAbsentAnnotation() throws IOException { + void optionalNullableField_withOpenApiNullable_hasNoJsonIncludeAnnotation() throws IOException { Map files = generateFromContract( "src/test/resources/3_0/kotlin/required-nullable-4-states.yaml", SPRING_BOOT, Map.of(CodegenConstants.OPENAPI_NULLABLE, "true")); Path modelFile = files.get("TestModel.java").toPath(); - // NON_ABSENT must be present — only optionalNullable (JsonNullable) gets this annotation - assertFileContains(modelFile, "@JsonInclude(JsonInclude.Include.NON_ABSENT)"); - // JsonNullable field must be present - assertFileContains(modelFile, "private JsonNullable optionalNullable"); - // NON_NULL must also be present (for optionalNonNullable fields) - assertFileContains(modelFile, "@JsonInclude(JsonInclude.Include.NON_NULL)"); - assertFileContains(modelFile, "import com.fasterxml.jackson.annotation.JsonInclude"); + assertFileNotContains(modelFile, "@JsonInclude(JsonInclude.Include.NON_ABSENT)"); + JavaFileAssert.assertThat(files.get("TestModel.java")) + .assertProperty("optionalNullable").withType("JsonNullable") + .assertPropertyAnnotations().doesNotContainWithName("JsonInclude"); } /** - * Without openApiNullable the optional+nullable field is a plain nullable type — - * no {@code @JsonInclude(NON_ABSENT)} should be emitted. + * Issue #24401 (safe-but-noisy): with no flags set, the generator defaults to weak/7.23.0 behavior — + * NO policy {@code @JsonInclude} or {@code @JsonSetter(nulls)} annotations are emitted, deferring + * entirely to the global ObjectMapper. */ @Test - void optionalNullableField_withoutOpenApiNullable_hasNoNonAbsentAnnotation() throws IOException { + void jsonInclude_unset_emitsNoPolicyAnnotations() throws IOException { Map files = generateFromContract( "src/test/resources/3_0/kotlin/required-nullable-4-states.yaml", SPRING_BOOT, - Map.of(CodegenConstants.OPENAPI_NULLABLE, "false")); + Map.of(CodegenConstants.OPENAPI_NULLABLE, "true")); Path modelFile = files.get("TestModel.java").toPath(); - // Without openApiNullable the field is String optionalNullable, not JsonNullable - assertFileNotContains(modelFile, "@JsonInclude(JsonInclude.Include.NON_ABSENT)"); + assertFileNotContains(modelFile, "@JsonInclude("); + assertFileNotContains(modelFile, "@JsonSetter("); } /** - * Optional+non-nullable fields must still have {@code @JsonInclude(NON_NULL)} regardless - * of the openApiNullable setting. + * Issue #24401: default matrix for JAVA-SPRING when {@code generateJsonIncludeAnnotations=true} + * (openApiNullable=true). required non-nullable -> NON_NULL, required nullable -> ALWAYS, + * optional non-nullable -> NON_NULL (default policy), optional nullable -> no annotation. */ @Test - void optionalNonNullableField_alwaysHasNonNullAnnotation() throws IOException { + void jsonInclude_defaultMatrix() throws IOException { Map files = generateFromContract( "src/test/resources/3_0/kotlin/required-nullable-4-states.yaml", SPRING_BOOT, - Map.of(CodegenConstants.OPENAPI_NULLABLE, "true")); + Map.of(CodegenConstants.OPENAPI_NULLABLE, "true", + CodegenConstants.GENERATE_JSON_INCLUDE_ANNOTATIONS, "true")); + + JavaFileAssert.assertThat(files.get("TestModel.java")) + .assertProperty("requiredNonNullable").assertPropertyAnnotations() + .containsWithNameAndAttributes("JsonInclude", Map.of("value", "JsonInclude.Include.NON_NULL")).toProperty().toType() + .assertProperty("requiredNullable").assertPropertyAnnotations() + .containsWithNameAndAttributes("JsonInclude", Map.of("value", "JsonInclude.Include.ALWAYS")).toProperty().toType() + .assertProperty("optionalNonNullable").assertPropertyAnnotations() + .containsWithNameAndAttributes("JsonInclude", Map.of("value", "JsonInclude.Include.NON_NULL")).toProperty().toType() + .assertProperty("optionalNullable").assertPropertyAnnotations() + .doesNotContainWithName("JsonInclude"); + } + + /** + * Issue #24401 (safe-but-noisy): {@code generateJsonSetterNullsAnnotations=true} emits + * {@code @JsonSetter(nulls = Nulls.SKIP)} on optional non-nullable fields (openApiNullable=false); + * leaving it unset emits none. + */ + @Test + void jsonSetterNulls_generateFlag_controlsEmission() throws IOException { + Map withFlag = generateFromContract( + "src/test/resources/3_0/spring/issue_24401_json_include_per_schema.yaml", + SPRING_BOOT, + Map.of(CodegenConstants.OPENAPI_NULLABLE, "false", + CodegenConstants.GENERATE_JSON_SETTER_NULLS_ANNOTATIONS, "true")); + assertFileContains(withFlag.get("OptionalNonNullable.java").toPath(), "@JsonSetter(nulls = Nulls.SKIP)"); + + Map unset = generateFromContract( + "src/test/resources/3_0/spring/issue_24401_json_include_per_schema.yaml", + SPRING_BOOT, + Map.of(CodegenConstants.OPENAPI_NULLABLE, "false")); + assertFileNotContains(unset.get("OptionalNonNullable.java").toPath(), "@JsonSetter("); + } + + /** + * Issue #24401 regression: when Lombok generates the setter ({@code lombok.Setter}), the manual + * setter method (and the {@code @JsonSetter} annotation that used to live only on it) is skipped + * entirely. {@code @JsonSetter(nulls = Nulls.SKIP)} must be emitted on the field itself so it is + * still honored by Jackson even though no explicit setter method is generated. + */ + @Test + void jsonSetterNulls_generateFlag_appliesWithLombokSetter() throws IOException { + Map additionalProperties = new HashMap<>(); + additionalProperties.put(CodegenConstants.OPENAPI_NULLABLE, "false"); + additionalProperties.put(CodegenConstants.GENERATE_JSON_SETTER_NULLS_ANNOTATIONS, "true"); + additionalProperties.put(AbstractJavaCodegen.ADDITIONAL_MODEL_TYPE_ANNOTATIONS, "@lombok.Getter;@lombok.Setter"); + + Map files = generateFromContract( + "src/test/resources/3_0/spring/issue_24401_json_include_per_schema.yaml", + SPRING_BOOT, + additionalProperties); + + JavaFileAssert.assertThat(files.get("OptionalNonNullable.java")) + .hasNoMethod("setOptionalNonNullable"); + assertFileContains(files.get("OptionalNonNullable.java").toPath(), "@JsonSetter(nulls = Nulls.SKIP)"); + } + + /** + * Issue #24401: {@code optionalNonNullPropertyJsonInclude} changes the policy emitted for + * optional non-nullable properties (when {@code generateJsonIncludeAnnotations=true}). + */ + @Test + void jsonInclude_optionalNonNullPolicy_nonEmpty() throws IOException { + Map files = generateFromContract( + "src/test/resources/3_0/kotlin/required-nullable-4-states.yaml", + SPRING_BOOT, + Map.of(CodegenConstants.OPENAPI_NULLABLE, "true", + CodegenConstants.GENERATE_JSON_INCLUDE_ANNOTATIONS, "true", + CodegenConstants.OPTIONAL_NON_NULL_PROPERTY_JSON_INCLUDE, "NON_EMPTY")); + + JavaFileAssert.assertThat(files.get("TestModel.java")) + .assertProperty("optionalNonNullable").assertPropertyAnnotations() + .containsWithNameAndAttributes("JsonInclude", Map.of("value", "JsonInclude.Include.NON_EMPTY")).toProperty().toType() + // required-field protection is unaffected by the optional policy + .assertProperty("requiredNonNullable").assertPropertyAnnotations() + .containsWithNameAndAttributes("JsonInclude", Map.of("value", "JsonInclude.Include.NON_NULL")); + } + + /** + * Issue #24401: {@code optionalNonNullPropertyJsonInclude=NONE} emits no annotation on optional + * non-nullable properties, deferring to the global ObjectMapper. Required-field protection stays. + */ + @Test + void jsonInclude_optionalNonNullPolicy_none() throws IOException { + Map files = generateFromContract( + "src/test/resources/3_0/kotlin/required-nullable-4-states.yaml", + SPRING_BOOT, + Map.of(CodegenConstants.OPENAPI_NULLABLE, "true", + CodegenConstants.GENERATE_JSON_INCLUDE_ANNOTATIONS, "true", + CodegenConstants.OPTIONAL_NON_NULL_PROPERTY_JSON_INCLUDE, "NONE")); + + JavaFileAssert.assertThat(files.get("TestModel.java")) + .assertProperty("optionalNonNullable").assertPropertyAnnotations() + .doesNotContainWithName("JsonInclude").toProperty().toType() + .assertProperty("requiredNonNullable").assertPropertyAnnotations() + .containsWithNameAndAttributes("JsonInclude", Map.of("value", "JsonInclude.Include.NON_NULL")); + } + + /** + * Issue #24401: {@code generateJsonIncludeAnnotations=false} removes ALL policy @JsonInclude + * annotations, including the required-field protection, letting the global ObjectMapper win. + */ + @Test + void jsonInclude_generateJsonIncludeAnnotations_false() throws IOException { + Map files = generateFromContract( + "src/test/resources/3_0/kotlin/required-nullable-4-states.yaml", + SPRING_BOOT, + Map.of(CodegenConstants.OPENAPI_NULLABLE, "true", + CodegenConstants.GENERATE_JSON_INCLUDE_ANNOTATIONS, "false")); Path modelFile = files.get("TestModel.java").toPath(); - assertFileContains(modelFile, "@JsonInclude(JsonInclude.Include.NON_NULL)"); - assertFileContains(modelFile, "private String optionalNonNullable"); + assertFileNotContains(modelFile, "@JsonInclude("); + } + + /** + * Issue #24401: a manual per-property {@code x-jackson-json-include-policy} vendor extension + * always overrides the automatic behavior, even when {@code generateJsonIncludeAnnotations=false}. + */ + @Test + void jsonInclude_manualOverride_winsOverGenerateFlag() throws IOException { + Map files = generateFromContract( + "src/test/resources/3_0/spring/issue_24401_json_include_override.yaml", + SPRING_BOOT, + Map.of(CodegenConstants.GENERATE_JSON_INCLUDE_ANNOTATIONS, "false")); + + JavaFileAssert.assertThat(files.get("TestModel.java")) + .assertProperty("overridden").assertPropertyAnnotations() + .containsWithNameAndAttributes("JsonInclude", Map.of("value", "JsonInclude.Include.NON_EMPTY")).toProperty().toType() + // no automatic annotation on the non-overridden optional field + .assertProperty("plain").assertPropertyAnnotations() + .doesNotContainWithName("JsonInclude"); + } + + /** + * Issue #24401: with one property per schema, each generated model must import exactly the + * Jackson annotations its single property needs — no more, no less. + */ + @Test + void jsonInclude_perSchemaImports() throws IOException { + final String jsonInclude = "com.fasterxml.jackson.annotation.JsonInclude"; + final String jsonSetter = "com.fasterxml.jackson.annotation.JsonSetter"; + final String nulls = "com.fasterxml.jackson.annotation.Nulls"; + final String jsonNullable = "org.openapitools.jackson.nullable.JsonNullable"; + + Map files = generateFromContract( + "src/test/resources/3_0/spring/issue_24401_json_include_per_schema.yaml", + SPRING_BOOT, + Map.of(CodegenConstants.OPENAPI_NULLABLE, "true", + CodegenConstants.GENERATE_JSON_INCLUDE_ANNOTATIONS, "true")); + + // required non-nullable -> @JsonInclude(NON_NULL); no setter machinery + JavaFileAssert.assertThat(files.get("RequiredNonNullable.java")) + .hasImports(jsonInclude).hasNoImports(jsonSetter, nulls); + // required nullable -> @JsonInclude(ALWAYS) + JavaFileAssert.assertThat(files.get("RequiredNullable.java")) + .hasImports(jsonInclude).hasNoImports(jsonSetter, nulls); + // optional non-nullable with openApiNullable=true -> @JsonInclude(NON_NULL), no @JsonSetter + JavaFileAssert.assertThat(files.get("OptionalNonNullable.java")) + .hasImports(jsonInclude).hasNoImports(jsonSetter, nulls); + // optional nullable with openApiNullable=true -> JsonNullable, NO @JsonInclude + JavaFileAssert.assertThat(files.get("OptionalNullable.java")) + .hasImports(jsonNullable).hasNoImports(jsonInclude, jsonSetter, nulls); + } + + /** + * Issue #24401: with openApiNullable=false, optional non-nullable adds @JsonSetter(Nulls.SKIP); + * optional nullable is a plain type needing none of the Jackson import machinery. + */ + @Test + void jsonInclude_perSchemaImports_withoutOpenApiNullable() throws IOException { + final String jsonInclude = "com.fasterxml.jackson.annotation.JsonInclude"; + final String jsonSetter = "com.fasterxml.jackson.annotation.JsonSetter"; + final String nulls = "com.fasterxml.jackson.annotation.Nulls"; + final String jsonNullable = "org.openapitools.jackson.nullable.JsonNullable"; + + Map files = generateFromContract( + "src/test/resources/3_0/spring/issue_24401_json_include_per_schema.yaml", + SPRING_BOOT, + Map.of(CodegenConstants.OPENAPI_NULLABLE, "false", + CodegenConstants.GENERATE_JSON_INCLUDE_ANNOTATIONS, "true", + CodegenConstants.GENERATE_JSON_SETTER_NULLS_ANNOTATIONS, "true")); + + // optional non-nullable -> @JsonInclude(NON_NULL) + @JsonSetter(Nulls.SKIP) + JavaFileAssert.assertThat(files.get("OptionalNonNullable.java")) + .hasImports(jsonInclude, jsonSetter, nulls).hasNoImports(jsonNullable); + // optional nullable (plain String) -> no policy annotation, no import machinery + JavaFileAssert.assertThat(files.get("OptionalNullable.java")) + .hasNoImports(jsonInclude, jsonSetter, nulls, jsonNullable); + } + + /** + * Issue #24401: even with {@code generateJsonIncludeAnnotations=false}, a manual per-property + * vendor extension must still emit its annotation AND the JsonInclude import must be present. + */ + @Test + void jsonInclude_manualOverride_emitsImport_whenAnnotationsDisabled() throws IOException { + final String jsonInclude = "com.fasterxml.jackson.annotation.JsonInclude"; + + Map files = generateFromContract( + "src/test/resources/3_0/spring/issue_24401_json_include_per_schema.yaml", + SPRING_BOOT, + Map.of(CodegenConstants.GENERATE_JSON_INCLUDE_ANNOTATIONS, "false")); + + JavaFileAssert.assertThat(files.get("ManualOverride.java")) + .hasImports(jsonInclude) + .assertProperty("value").assertPropertyAnnotations() + .containsWithNameAndAttributes("JsonInclude", Map.of("value", "JsonInclude.Include.NON_EMPTY")); + // A schema without the override must not import JsonInclude when annotations are disabled + JavaFileAssert.assertThat(files.get("OptionalNonNullable.java")).hasNoImports(jsonInclude); + } + + /** + * Issue #24401: a forced override on an optional+nullable ({@code JsonNullable}) property must be + * respected — the annotation is emitted and the JsonInclude import is added, even though the + * automatic path emits nothing for JsonNullable fields. + */ + @Test + void jsonInclude_forcedOverride_onJsonNullable_emitsAnnotationAndImport() throws IOException { + final String jsonInclude = "com.fasterxml.jackson.annotation.JsonInclude"; + + Map files = generateFromContract( + "src/test/resources/3_0/spring/issue_24401_json_include_per_schema.yaml", + SPRING_BOOT, + Map.of(CodegenConstants.OPENAPI_NULLABLE, "true")); + + JavaFileAssert.assertThat(files.get("ForcedOnJsonNullable.java")) + .hasImports(jsonInclude) + .assertProperty("value").withType("JsonNullable").assertPropertyAnnotations() + .containsWithNameAndAttributes("JsonInclude", Map.of("value", "JsonInclude.Include.NON_NULL")); + } + + /** + * Issue #24401: a manual per-property override of {@code NONE} means "emit no annotation". Neither the + * {@code @JsonInclude} annotation nor its import may be generated, otherwise the output fails to compile. + */ + @Test + void jsonInclude_manualOverride_none_emitsNoAnnotationOrImport() throws IOException { + final String jsonInclude = "com.fasterxml.jackson.annotation.JsonInclude"; + + Map files = generateFromContract( + "src/test/resources/3_0/spring/issue_24401_json_include_per_schema.yaml", + SPRING_BOOT, + Map.of(CodegenConstants.GENERATE_JSON_INCLUDE_ANNOTATIONS, "true")); + + JavaFileAssert.assertThat(files.get("ManualNone.java")) + .hasNoImports(jsonInclude) + .assertProperty("value").assertPropertyAnnotations() + .doesNotContainWithName("JsonInclude"); + } + + /** + * Issue #24401: a whitespace-padded {@code NONE} override must be treated identically to a bare + * {@code NONE} — the sentinel comparison must trim before checking, otherwise it falls through to + * validation and generation fails for a value that should simply suppress the annotation. + */ + @Test + void jsonInclude_manualOverride_paddedNone_emitsNoAnnotationOrImport() throws IOException { + final String jsonInclude = "com.fasterxml.jackson.annotation.JsonInclude"; + + Map files = generateFromContract( + "src/test/resources/3_0/spring/issue_24401_json_include_per_schema.yaml", + SPRING_BOOT, + Map.of(CodegenConstants.GENERATE_JSON_INCLUDE_ANNOTATIONS, "true")); + + JavaFileAssert.assertThat(files.get("ManualNonePadded.java")) + .hasNoImports(jsonInclude) + .assertProperty("value").assertPropertyAnnotations() + .doesNotContainWithName("JsonInclude"); + } + + /** + * Issue #24401: an invalid manual per-property override must fail fast with an actionable error + * during generation rather than emitting uncompilable Java. + */ + @Test + void jsonInclude_manualOverride_invalid_failsWithActionableError() { + org.assertj.core.api.Assertions.assertThatThrownBy(() -> generateFromContract( + "src/test/resources/3_0/spring/issue_24401_json_include_invalid_override.yaml", + SPRING_BOOT, + Map.of(CodegenConstants.GENERATE_JSON_INCLUDE_ANNOTATIONS, "true"))) + .hasStackTraceContaining("x-jackson-json-include-policy") + .hasStackTraceContaining("NOT_A_REAL_POLICY"); } @Test diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/kotlin/spring/KotlinSpringServerCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/kotlin/spring/KotlinSpringServerCodegenTest.java index e8d9e69d1468..5f912aab61cc 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/kotlin/spring/KotlinSpringServerCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/kotlin/spring/KotlinSpringServerCodegenTest.java @@ -6629,7 +6629,8 @@ public void requiredNullable_scenario2_requiredNullable() throws IOException { public void requiredNullable_scenario3_optionalNonNullable() throws IOException { Map files = generateFromContract( "src/test/resources/3_0/kotlin/required-nullable-4-states.yaml", - new HashMap<>()); + Map.of(CodegenConstants.GENERATE_JSON_INCLUDE_ANNOTATIONS, "true", + CodegenConstants.GENERATE_JSON_SETTER_NULLS_ANNOTATIONS, "true")); Path modelFile = files.get("TestModel.kt").toPath(); String content = Files.readString(modelFile); @@ -6659,7 +6660,9 @@ public void requiredNullable_scenario3_optionalNonNullable() throws IOException public void requiredNullable_scenario3_optionalNonNullable_withOpenApiNullable() throws IOException { Map files = generateFromContract( "src/test/resources/3_0/kotlin/required-nullable-4-states.yaml", - Map.of(CodegenConstants.OPENAPI_NULLABLE, "true")); + Map.of(CodegenConstants.OPENAPI_NULLABLE, "true", + CodegenConstants.GENERATE_JSON_INCLUDE_ANNOTATIONS, "true", + CodegenConstants.GENERATE_JSON_SETTER_NULLS_ANNOTATIONS, "true")); Path modelFile = files.get("TestModel.kt").toPath(); String content = Files.readString(modelFile); @@ -6687,7 +6690,8 @@ public void requiredNullable_scenario3_optionalNonNullable_withOpenApiNullable() public void requiredNullable_scenario3_optionalNonNullable_withDefault() throws IOException { Map files = generateFromContract( "src/test/resources/3_0/kotlin/required-nullable-4-states.yaml", - new HashMap<>()); + Map.of(CodegenConstants.GENERATE_JSON_INCLUDE_ANNOTATIONS, "true", + CodegenConstants.GENERATE_JSON_SETTER_NULLS_ANNOTATIONS, "true")); Path modelFile = files.get("TestModel.kt").toPath(); String content = Files.readString(modelFile); @@ -6763,6 +6767,7 @@ public void requiredNullable_scenario3_optionalNonNullable_withJackson3() throws Map props = new HashMap<>(); props.put(KotlinSpringServerCodegen.USE_SPRING_BOOT4, "true"); props.put(CodegenConstants.OPENAPI_NULLABLE, "true"); + props.put(CodegenConstants.GENERATE_JSON_SETTER_NULLS_ANNOTATIONS, "true"); Map files = generateFromContract( "src/test/resources/3_0/kotlin/required-nullable-4-states.yaml", props); @@ -6779,28 +6784,245 @@ public void requiredNullable_scenario3_optionalNonNullable_withJackson3() throws } /** - * Scenario 4 (openApiNullable=true): optional+nullable field must carry - * {@code @field:JsonInclude(JsonInclude.Include.NON_ABSENT)} so that Jackson - * excludes {@code JsonNullable.undefined()} from serialized output. + * Issue #24401: optional+nullable ({@code JsonNullable}) fields must no longer carry + * {@code @field:JsonInclude(NON_ABSENT)} — the JsonNullable module already governs their inclusion. */ - @Test(description = "Scenario 4 – optional+nullable with openApiNullable=true: @JsonInclude(NON_ABSENT) guards undefined from serialization") - public void requiredNullable_scenario4_optionalNullable_hasNonAbsentAnnotation() throws IOException { + @Test(description = "Issue #24401 – optional+nullable with openApiNullable=true: no @JsonInclude annotation") + public void requiredNullable_scenario4_optionalNullable_hasNoJsonIncludeAnnotation() throws IOException { Map files = generateFromContract( "src/test/resources/3_0/kotlin/required-nullable-4-states.yaml", Map.of(CodegenConstants.OPENAPI_NULLABLE, "true")); Path modelFile = files.get("TestModel.kt").toPath(); - String content = Files.readString(modelFile); - int idx = content.indexOf("val optionalNullable:"); - Assert.assertTrue(idx >= 0, "optionalNullable property must exist"); - // Annotations appear before the val declaration - String context = content.substring(Math.max(0, idx - 300), idx); - Assert.assertTrue(context.contains("@field:JsonInclude(JsonInclude.Include.NON_ABSENT)"), - "optionalNullable must have @field:JsonInclude(NON_ABSENT) to suppress JsonNullable.undefined() from output"); - // Must NOT have NON_NULL — that annotation is only for non-nullable optional fields - Assert.assertFalse(context.contains("@field:JsonInclude(JsonInclude.Include.NON_NULL)"), - "optionalNullable must NOT have @field:JsonInclude(NON_NULL); only non-nullable optionals use NON_NULL"); - assertFileContains(modelFile, "import com.fasterxml.jackson.annotation.JsonInclude"); + // NON_ABSENT must no longer be emitted anywhere + assertFileNotContains(modelFile, "@field:JsonInclude(JsonInclude.Include.NON_ABSENT)"); + // optionalNullable must still be a JsonNullable wrapper + assertFileContains(modelFile, "JsonNullable"); + } + + /** + * Issue #24401 (safe-but-noisy): with no flags set, kotlin-spring defaults to weak/7.23.0 behavior — + * NO policy {@code @field:JsonInclude} or {@code @field:JsonSetter(nulls)} annotations are emitted. + */ + @Test(description = "Issue #24401 – unset flags emit no policy annotations (kotlin-spring)") + public void jsonInclude_unset_emitsNoPolicyAnnotations() throws IOException { + Map files = generateFromContract( + "src/test/resources/3_0/kotlin/required-nullable-4-states.yaml", + Map.of(CodegenConstants.OPENAPI_NULLABLE, "true")); + + Path modelFile = files.get("TestModel.kt").toPath(); + assertFileNotContains(modelFile, "@field:JsonInclude("); + assertFileNotContains(modelFile, "@field:JsonSetter("); + } + + /** + * Issue #24401: default matrix for kotlin-spring. required fields -> ALWAYS, + * optional non-nullable -> NON_NULL (default policy), optional nullable -> no annotation. + */ + @Test(description = "Issue #24401 – default @JsonInclude matrix (kotlin-spring)") + public void jsonInclude_kotlinMatrix_default() throws IOException { + Map files = generateFromContract( + "src/test/resources/3_0/kotlin/required-nullable-4-states.yaml", + Map.of(CodegenConstants.GENERATE_JSON_INCLUDE_ANNOTATIONS, "true")); + + String content = Files.readString(files.get("TestModel.kt").toPath()); + Assert.assertTrue(jsonIncludeBlockFor(content, "requiredNonNullable").contains("@field:JsonInclude(JsonInclude.Include.ALWAYS)"), + "required non-nullable must be ALWAYS"); + Assert.assertTrue(jsonIncludeBlockFor(content, "requiredNullable").contains("@field:JsonInclude(JsonInclude.Include.ALWAYS)"), + "required nullable must be ALWAYS"); + Assert.assertTrue(jsonIncludeBlockFor(content, "optionalNonNullable").contains("@field:JsonInclude(JsonInclude.Include.NON_NULL)"), + "optional non-nullable must be NON_NULL by default"); + Assert.assertFalse(jsonIncludeBlockFor(content, "optionalNullable").contains("@field:JsonInclude"), + "optional nullable must have no @JsonInclude annotation"); + } + + /** + * Issue #24401: {@code optionalNonNullPropertyJsonInclude=NONE} omits the annotation on optional + * non-nullable properties while keeping the required-field protection. + */ + @Test(description = "Issue #24401 – optionalNonNullPropertyJsonInclude=NONE (kotlin-spring)") + public void jsonInclude_optionalNonNullPolicy_none() throws IOException { + Map files = generateFromContract( + "src/test/resources/3_0/kotlin/required-nullable-4-states.yaml", + Map.of(CodegenConstants.GENERATE_JSON_INCLUDE_ANNOTATIONS, "true", + CodegenConstants.OPTIONAL_NON_NULL_PROPERTY_JSON_INCLUDE, "NONE")); + + String content = Files.readString(files.get("TestModel.kt").toPath()); + Assert.assertFalse(jsonIncludeBlockFor(content, "optionalNonNullable").contains("@field:JsonInclude"), + "optional non-nullable must have no annotation when policy is NONE"); + Assert.assertTrue(jsonIncludeBlockFor(content, "requiredNonNullable").contains("@field:JsonInclude(JsonInclude.Include.ALWAYS)"), + "required-field protection must still be present"); + } + + /** + * Issue #24401: {@code generateJsonIncludeAnnotations=false} removes ALL policy @JsonInclude + * annotations, including required-field protection. + */ + @Test(description = "Issue #24401 – generateJsonIncludeAnnotations=false removes all policy annotations (kotlin-spring)") + public void jsonInclude_generateJsonIncludeAnnotations_false() throws IOException { + Map files = generateFromContract( + "src/test/resources/3_0/kotlin/required-nullable-4-states.yaml", + Map.of(CodegenConstants.GENERATE_JSON_INCLUDE_ANNOTATIONS, "false")); + + assertFileNotContains(files.get("TestModel.kt").toPath(), "@field:JsonInclude("); + } + + /** + * Issue #24401: a manual per-property {@code x-jackson-json-include-policy} vendor extension always + * overrides the automatic behavior, even when {@code generateJsonIncludeAnnotations=false}. + */ + @Test(description = "Issue #24401 – manual vendor-extension override wins (kotlin-spring)") + public void jsonInclude_manualOverride_winsOverGenerateFlag() throws IOException { + Map files = generateFromContract( + "src/test/resources/3_0/spring/issue_24401_json_include_override.yaml", + Map.of(CodegenConstants.GENERATE_JSON_INCLUDE_ANNOTATIONS, "false")); + + String content = Files.readString(files.get("TestModel.kt").toPath()); + Assert.assertTrue(jsonIncludeBlockFor(content, "overridden").contains("@field:JsonInclude(JsonInclude.Include.NON_EMPTY)"), + "manual override must be honored even with generateJsonIncludeAnnotations=false"); + Assert.assertFalse(jsonIncludeBlockFor(content, "plain").contains("@field:JsonInclude"), + "non-overridden field must have no annotation when generateJsonIncludeAnnotations=false"); + } + + /** + * Returns the source region isolating a single property's annotations, bounded by the previous + * property's {@code @get:JsonProperty} marker, so @field:JsonInclude checks are property-specific. + */ + private static String jsonIncludeBlockFor(String content, String propName) { + int end = content.indexOf("@get:JsonProperty(\"" + propName + "\""); + Assert.assertTrue(end >= 0, propName + " property must exist"); + int prev = content.lastIndexOf("@get:JsonProperty(", end - 1); + return content.substring(Math.max(0, prev), end); + } + + /** + * Issue #24401: with one property per schema, each generated model must import exactly the Jackson + * annotations its single property needs. openApiNullable=true so optional nullable uses JsonNullable. + */ + @Test(description = "Issue #24401 – per-schema import isolation (kotlin-spring)") + public void jsonInclude_perSchemaImports() throws IOException { + final String jsonInclude = "import com.fasterxml.jackson.annotation.JsonInclude"; + final String jsonSetter = "import com.fasterxml.jackson.annotation.JsonSetter"; + final String nulls = "import com.fasterxml.jackson.annotation.Nulls"; + final String jsonNullable = "import org.openapitools.jackson.nullable.JsonNullable"; + + Map files = generateFromContract( + "src/test/resources/3_0/spring/issue_24401_json_include_per_schema.yaml", + Map.of(CodegenConstants.OPENAPI_NULLABLE, "true", + CodegenConstants.GENERATE_JSON_INCLUDE_ANNOTATIONS, "true", + CodegenConstants.GENERATE_JSON_SETTER_NULLS_ANNOTATIONS, "true")); + + // required non-nullable -> @field:JsonInclude(ALWAYS); no setter/nullable machinery + Path requiredNonNullable = files.get("RequiredNonNullable.kt").toPath(); + assertFileContains(requiredNonNullable, jsonInclude); + assertFileNotContains(requiredNonNullable, jsonSetter, nulls, jsonNullable); + // required nullable -> @field:JsonInclude(ALWAYS) + Path requiredNullable = files.get("RequiredNullable.kt").toPath(); + assertFileContains(requiredNullable, jsonInclude); + assertFileNotContains(requiredNullable, jsonSetter, nulls, jsonNullable); + // optional non-nullable -> @field:JsonInclude(NON_NULL) + @field:JsonSetter(Nulls.FAIL) + Path optionalNonNullable = files.get("OptionalNonNullable.kt").toPath(); + assertFileContains(optionalNonNullable, jsonInclude, jsonSetter, nulls); + assertFileNotContains(optionalNonNullable, jsonNullable); + // optional nullable with openApiNullable=true -> JsonNullable, NO @field:JsonInclude + Path optionalNullable = files.get("OptionalNullable.kt").toPath(); + assertFileContains(optionalNullable, jsonNullable); + assertFileNotContains(optionalNullable, jsonInclude, jsonSetter, nulls); + } + + /** + * Issue #24401: even with {@code generateJsonIncludeAnnotations=false}, a manual per-property vendor + * extension must still emit its annotation AND the JsonInclude import must be present. + */ + @Test(description = "Issue #24401 – manual override emits import even when annotations disabled (kotlin-spring)") + public void jsonInclude_manualOverride_emitsImport_whenAnnotationsDisabled() throws IOException { + final String jsonInclude = "import com.fasterxml.jackson.annotation.JsonInclude"; + + Map files = generateFromContract( + "src/test/resources/3_0/spring/issue_24401_json_include_per_schema.yaml", + Map.of(CodegenConstants.GENERATE_JSON_INCLUDE_ANNOTATIONS, "false")); + + Path manualOverride = files.get("ManualOverride.kt").toPath(); + assertFileContains(manualOverride, jsonInclude); + Assert.assertTrue(jsonIncludeBlockFor(Files.readString(manualOverride), "value") + .contains("@field:JsonInclude(JsonInclude.Include.NON_EMPTY)"), + "manual override must be emitted even when generateJsonIncludeAnnotations=false"); + // A schema without the override must not import JsonInclude when annotations are disabled + assertFileNotContains(files.get("OptionalNonNullable.kt").toPath(), jsonInclude); + } + + /** + * Issue #24401: a forced override on an optional+nullable ({@code JsonNullable}) property must be + * respected — the annotation is emitted and the JsonInclude import is added. + */ + @Test(description = "Issue #24401 – forced override on JsonNullable emits annotation and import (kotlin-spring)") + public void jsonInclude_forcedOverride_onJsonNullable_emitsAnnotationAndImport() throws IOException { + final String jsonInclude = "import com.fasterxml.jackson.annotation.JsonInclude"; + final String jsonNullable = "import org.openapitools.jackson.nullable.JsonNullable"; + + Map files = generateFromContract( + "src/test/resources/3_0/spring/issue_24401_json_include_per_schema.yaml", + Map.of(CodegenConstants.OPENAPI_NULLABLE, "true")); + + Path forced = files.get("ForcedOnJsonNullable.kt").toPath(); + assertFileContains(forced, jsonInclude, jsonNullable, "JsonNullable"); + Assert.assertTrue(jsonIncludeBlockFor(Files.readString(forced), "value") + .contains("@field:JsonInclude(JsonInclude.Include.NON_NULL)"), + "forced override on JsonNullable field must be emitted"); + } + + /** + * Issue #24401: a manual per-property override of {@code NONE} means "emit no annotation". Neither the + * {@code @field:JsonInclude} annotation nor its import may be generated, otherwise the output fails to compile. + */ + @Test(description = "Issue #24401 – manual NONE override emits no annotation or import (kotlin-spring)") + public void jsonInclude_manualOverride_none_emitsNoAnnotationOrImport() throws IOException { + final String jsonInclude = "import com.fasterxml.jackson.annotation.JsonInclude"; + + Map files = generateFromContract( + "src/test/resources/3_0/spring/issue_24401_json_include_per_schema.yaml", + Map.of(CodegenConstants.GENERATE_JSON_INCLUDE_ANNOTATIONS, "true")); + + Path manualNone = files.get("ManualNone.kt").toPath(); + assertFileNotContains(manualNone, jsonInclude); + Assert.assertFalse(Files.readString(manualNone).contains("@field:JsonInclude"), + "manual NONE override must emit no @field:JsonInclude annotation"); + } + + /** + * Issue #24401: a whitespace-padded {@code NONE} override must be treated identically to a bare + * {@code NONE} — the sentinel comparison must trim before checking, otherwise it falls through to + * validation and generation fails for a value that should simply suppress the annotation. + */ + @Test(description = "Issue #24401 – padded NONE override emits no annotation or import (kotlin-spring)") + public void jsonInclude_manualOverride_paddedNone_emitsNoAnnotationOrImport() throws IOException { + final String jsonInclude = "import com.fasterxml.jackson.annotation.JsonInclude"; + + Map files = generateFromContract( + "src/test/resources/3_0/spring/issue_24401_json_include_per_schema.yaml", + Map.of(CodegenConstants.GENERATE_JSON_INCLUDE_ANNOTATIONS, "true")); + + Path manualNonePadded = files.get("ManualNonePadded.kt").toPath(); + assertFileNotContains(manualNonePadded, jsonInclude); + Assert.assertFalse(Files.readString(manualNonePadded).contains("@field:JsonInclude"), + "padded NONE override must emit no @field:JsonInclude annotation"); + } + + /** + * Issue #24401: an invalid manual per-property override must fail fast with an actionable error + * during generation rather than emitting uncompilable Kotlin. + */ + @Test(description = "Issue #24401 – invalid manual override fails fast (kotlin-spring)") + public void jsonInclude_manualOverride_invalid_failsWithActionableError() { + Throwable thrown = Assert.expectThrows(Throwable.class, () -> generateFromContract( + "src/test/resources/3_0/spring/issue_24401_json_include_invalid_override.yaml", + Map.of(CodegenConstants.GENERATE_JSON_INCLUDE_ANNOTATIONS, "true"))); + + java.io.StringWriter sw = new java.io.StringWriter(); + thrown.printStackTrace(new java.io.PrintWriter(sw)); + String trace = sw.toString(); + Assert.assertTrue(trace.contains("x-jackson-json-include-policy") && trace.contains("NOT_A_REAL_POLICY"), + "expected an actionable error naming the invalid policy, but got: " + trace); } /** @@ -7087,6 +7309,7 @@ public void testIssue24139NullableRefNoJsonSetterNullsFail() throws IOException Map additionalProperties = new HashMap<>(); additionalProperties.put("useBeanValidation", true); additionalProperties.put("openApiNullable", "true"); + additionalProperties.put(CodegenConstants.GENERATE_JSON_SETTER_NULLS_ANNOTATIONS, "true"); Map files = generateFromContract( "src/test/resources/3_1/issue_24139.yaml", diff --git a/modules/openapi-generator/src/test/resources/3_0/spring/issue_24401_json_include_invalid_override.yaml b/modules/openapi-generator/src/test/resources/3_0/spring/issue_24401_json_include_invalid_override.yaml new file mode 100644 index 000000000000..39d6b3ed12eb --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/spring/issue_24401_json_include_invalid_override.yaml @@ -0,0 +1,28 @@ +openapi: 3.0.0 +info: + title: JsonInclude invalid manual override test + version: 1.0.0 + description: > + A single schema whose property carries an invalid x-jackson-json-include-policy value. + Generation must fail fast with an actionable error rather than emitting uncompilable output. +paths: + /test: + post: + operationId: testPost + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/InvalidOverride' + responses: + '200': + description: OK +components: + schemas: + InvalidOverride: + type: object + properties: + value: + type: string + nullable: false + x-jackson-json-include-policy: NOT_A_REAL_POLICY diff --git a/modules/openapi-generator/src/test/resources/3_0/spring/issue_24401_json_include_override.yaml b/modules/openapi-generator/src/test/resources/3_0/spring/issue_24401_json_include_override.yaml new file mode 100644 index 000000000000..c39028982365 --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/spring/issue_24401_json_include_override.yaml @@ -0,0 +1,30 @@ +openapi: 3.0.0 +info: + title: JsonInclude manual override test + version: 1.0.0 +paths: + /test: + post: + operationId: testPost + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/TestModel' + responses: + '200': + description: OK +components: + schemas: + TestModel: + type: object + properties: + # Manual per-property override via the universal vendor extension. + overridden: + type: string + nullable: false + x-jackson-json-include-policy: NON_EMPTY + # No override: with generateJsonIncludeAnnotations=false this must get no annotation. + plain: + type: string + nullable: false diff --git a/modules/openapi-generator/src/test/resources/3_0/spring/issue_24401_json_include_per_schema.yaml b/modules/openapi-generator/src/test/resources/3_0/spring/issue_24401_json_include_per_schema.yaml new file mode 100644 index 000000000000..5e10c8cf438e --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/spring/issue_24401_json_include_per_schema.yaml @@ -0,0 +1,99 @@ +openapi: 3.0.0 +info: + title: JsonInclude per-schema import isolation test + version: 1.0.0 + description: > + Each schema holds exactly one property covering one required/optional x + nullable/non-nullable combination. Isolating a single case per model ensures the + generated imports (JsonInclude, JsonSetter, Nulls, JsonNullable) are correct for + every case on their own, without another property masking a missing import. +paths: + /test: + post: + operationId: testPost + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RequiredNonNullable' + responses: + '200': + description: OK +components: + schemas: + # required + non-nullable + RequiredNonNullable: + type: object + required: + - value + properties: + value: + type: string + nullable: false + # required + nullable + RequiredNullable: + type: object + required: + - value + properties: + value: + type: string + nullable: true + # optional + non-nullable + OptionalNonNullable: + type: object + properties: + value: + type: string + nullable: false + # optional + non-nullable with a default value + OptionalNonNullableWithDefault: + type: object + properties: + value: + type: string + nullable: false + default: "defaultValue" + # optional + nullable + OptionalNullable: + type: object + properties: + value: + type: string + nullable: true + # manual per-property override: even with generateJsonIncludeAnnotations=false the + # annotation (and its import) must still be emitted from the vendor extension. + ManualOverride: + type: object + properties: + value: + type: string + nullable: false + x-jackson-json-include-policy: NON_EMPTY + # forced override on an optional + nullable (JsonNullable) property: the automatic path emits + # nothing here, but an explicit vendor extension must be respected and its import added. + ForcedOnJsonNullable: + type: object + properties: + value: + type: string + nullable: true + x-jackson-json-include-policy: NON_NULL + # manual per-property override of NONE: the sentinel means "emit no annotation", so neither the + # @JsonInclude annotation nor its import must be generated (otherwise the output fails to compile). + ManualNone: + type: object + properties: + value: + type: string + nullable: false + x-jackson-json-include-policy: NONE + # manual per-property override of NONE padded with whitespace: must be treated identically to a + # bare NONE (normalization must trim before comparing), i.e. emit no annotation, no validation error. + ManualNonePadded: + type: object + properties: + value: + type: string + nullable: false + x-jackson-json-include-policy: " NONE " diff --git a/samples/client/petstore/spring-cloud-date-time/src/main/java/org/openapitools/model/Pet.java b/samples/client/petstore/spring-cloud-date-time/src/main/java/org/openapitools/model/Pet.java index 4aa4e0f36117..83c89d9c9800 100644 --- a/samples/client/petstore/spring-cloud-date-time/src/main/java/org/openapitools/model/Pet.java +++ b/samples/client/petstore/spring-cloud-date-time/src/main/java/org/openapitools/model/Pet.java @@ -29,6 +29,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class Pet { + @JsonInclude(JsonInclude.Include.NON_NULL) private String atType = "Pet"; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/client/petstore/spring-cloud-deprecated/src/main/java/org/openapitools/model/Pet.java b/samples/client/petstore/spring-cloud-deprecated/src/main/java/org/openapitools/model/Pet.java index 0d9d99f20e09..53b64044c6e3 100644 --- a/samples/client/petstore/spring-cloud-deprecated/src/main/java/org/openapitools/model/Pet.java +++ b/samples/client/petstore/spring-cloud-deprecated/src/main/java/org/openapitools/model/Pet.java @@ -36,8 +36,10 @@ public class Pet { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Category category; + @JsonInclude(JsonInclude.Include.ALWAYS) private JsonNullable name = JsonNullable.undefined(); + @JsonInclude(JsonInclude.Include.NON_NULL) @Deprecated private List photoUrls = new ArrayList<>(); diff --git a/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/model/Pet.java b/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/model/Pet.java index 37d29c32b8da..c16ac8affc4e 100644 --- a/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/model/Pet.java +++ b/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/model/Pet.java @@ -36,8 +36,10 @@ public class Pet { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Category category; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name; + @JsonInclude(JsonInclude.Include.NON_NULL) private List photoUrls = new ArrayList<>(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/client/petstore/spring-cloud-tags/src/main/java/org/openapitools/model/Pet.java b/samples/client/petstore/spring-cloud-tags/src/main/java/org/openapitools/model/Pet.java index f655d26b20a7..141ad532407c 100644 --- a/samples/client/petstore/spring-cloud-tags/src/main/java/org/openapitools/model/Pet.java +++ b/samples/client/petstore/spring-cloud-tags/src/main/java/org/openapitools/model/Pet.java @@ -36,8 +36,10 @@ public class Pet { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Category category; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name; + @JsonInclude(JsonInclude.Include.NON_NULL) private List photoUrls = new ArrayList<>(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Pet.java b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Pet.java index 37d29c32b8da..c16ac8affc4e 100644 --- a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Pet.java +++ b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Pet.java @@ -36,8 +36,10 @@ public class Pet { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Category category; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name; + @JsonInclude(JsonInclude.Include.NON_NULL) private List photoUrls = new ArrayList<>(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/model/AdditionalPropertiesClassDto.java b/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/model/AdditionalPropertiesClassDto.java index 46a16d7fe21d..fb95071ae45f 100644 --- a/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/model/AdditionalPropertiesClassDto.java +++ b/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/model/AdditionalPropertiesClassDto.java @@ -58,7 +58,6 @@ public class AdditionalPropertiesClassDto { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Object anytype1; - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable anytype2 = JsonNullable.undefined(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/model/AnimalDto.java b/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/model/AnimalDto.java index c724049e493b..ccfe65d189e1 100644 --- a/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/model/AnimalDto.java +++ b/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/model/AnimalDto.java @@ -37,6 +37,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class AnimalDto { + @JsonInclude(JsonInclude.Include.NON_NULL) private String className; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/model/CategoryDto.java b/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/model/CategoryDto.java index 20129cb89013..44a1a1ea0b01 100644 --- a/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/model/CategoryDto.java +++ b/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/model/CategoryDto.java @@ -27,6 +27,7 @@ public class CategoryDto { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Long id; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name = "default-name"; public CategoryDto() { diff --git a/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/model/ContainerDefaultValueDto.java b/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/model/ContainerDefaultValueDto.java index ccb8f5a5647f..d88271c2bf46 100644 --- a/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/model/ContainerDefaultValueDto.java +++ b/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/model/ContainerDefaultValueDto.java @@ -29,14 +29,14 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class ContainerDefaultValueDto { - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> nullableArray = JsonNullable.>undefined(); + @JsonInclude(JsonInclude.Include.ALWAYS) private JsonNullable> nullableRequiredArray = JsonNullable.>undefined(); + @JsonInclude(JsonInclude.Include.NON_NULL) private List requiredArray = new ArrayList<>(); - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> nullableArrayWithDefault = JsonNullable.>undefined(); public ContainerDefaultValueDto() { diff --git a/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/model/EnumTestDto.java b/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/model/EnumTestDto.java index 9c39a7569a81..250a8a7fa9fb 100644 --- a/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/model/EnumTestDto.java +++ b/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/model/EnumTestDto.java @@ -103,6 +103,7 @@ public static EnumStringRequiredEnum fromValue(String value) { } } + @JsonInclude(JsonInclude.Include.NON_NULL) private EnumStringRequiredEnum enumStringRequired; /** diff --git a/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/model/FormatTestDto.java b/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/model/FormatTestDto.java index ac2ef6be7859..0db61103ab8a 100644 --- a/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/model/FormatTestDto.java +++ b/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/model/FormatTestDto.java @@ -39,6 +39,7 @@ public class FormatTestDto { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Long int64; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal number; @JsonInclude(JsonInclude.Include.NON_NULL) @@ -50,11 +51,13 @@ public class FormatTestDto { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable String string; + @JsonInclude(JsonInclude.Include.NON_NULL) private byte[] _byte; @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable org.springframework.core.io.Resource binary; + @JsonInclude(JsonInclude.Include.NON_NULL) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) private LocalDate date; @@ -65,6 +68,7 @@ public class FormatTestDto { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable UUID uuid; + @JsonInclude(JsonInclude.Include.NON_NULL) private String password; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/model/NameDto.java b/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/model/NameDto.java index e11dd113cbc2..9dcea8d6c27b 100644 --- a/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/model/NameDto.java +++ b/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/model/NameDto.java @@ -24,6 +24,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class NameDto { + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer name; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/model/NullableMapPropertyDto.java b/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/model/NullableMapPropertyDto.java index 350b970a945d..f84d9d21f9cf 100644 --- a/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/model/NullableMapPropertyDto.java +++ b/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/model/NullableMapPropertyDto.java @@ -2,7 +2,6 @@ import java.net.URI; import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -29,7 +28,6 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class NullableMapPropertyDto { - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> languageValues = JsonNullable.>undefined(); public NullableMapPropertyDto languageValues(Map languageValues) { diff --git a/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/model/ParentWithNullableDto.java b/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/model/ParentWithNullableDto.java index 1d18853e2e2e..cb3f764522a6 100644 --- a/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/model/ParentWithNullableDto.java +++ b/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/model/ParentWithNullableDto.java @@ -75,7 +75,6 @@ public static TypeEnum fromValue(String value) { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable TypeEnum type; - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable nullableProperty = JsonNullable.undefined(); public ParentWithNullableDto type(@Nullable TypeEnum type) { diff --git a/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/model/PetDto.java b/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/model/PetDto.java index 2052979417f7..b4eda9e7f9c4 100644 --- a/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/model/PetDto.java +++ b/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/model/PetDto.java @@ -39,8 +39,10 @@ public class PetDto { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable CategoryDto category; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name; + @JsonInclude(JsonInclude.Include.NON_NULL) private Set photoUrls = new LinkedHashSet<>(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/model/TypeHolderDefaultDto.java b/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/model/TypeHolderDefaultDto.java index 99d18a336d78..a1c213eb40de 100644 --- a/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/model/TypeHolderDefaultDto.java +++ b/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/model/TypeHolderDefaultDto.java @@ -2,6 +2,7 @@ import java.net.URI; import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -27,14 +28,19 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class TypeHolderDefaultDto { + @JsonInclude(JsonInclude.Include.NON_NULL) private String stringItem = "what"; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal numberItem = new BigDecimal("1.234"); + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer integerItem = -2; + @JsonInclude(JsonInclude.Include.NON_NULL) private Boolean boolItem = true; + @JsonInclude(JsonInclude.Include.NON_NULL) private List arrayItem = new ArrayList<>(Arrays.asList(0, 1, 2, 3)); public TypeHolderDefaultDto() { diff --git a/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/model/TypeHolderExampleDto.java b/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/model/TypeHolderExampleDto.java index b0faf5aaa9ae..b0f401268821 100644 --- a/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/model/TypeHolderExampleDto.java +++ b/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/model/TypeHolderExampleDto.java @@ -2,6 +2,7 @@ import java.net.URI; import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -27,16 +28,22 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class TypeHolderExampleDto { + @JsonInclude(JsonInclude.Include.NON_NULL) private String stringItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal numberItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Float floatItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer integerItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Boolean boolItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private List arrayItem = new ArrayList<>(); public TypeHolderExampleDto() { diff --git a/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/model/AdditionalPropertiesClassDto.java b/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/model/AdditionalPropertiesClassDto.java index b893bb4ec7c6..613b36dd183c 100644 --- a/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/model/AdditionalPropertiesClassDto.java +++ b/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/model/AdditionalPropertiesClassDto.java @@ -57,7 +57,6 @@ public class AdditionalPropertiesClassDto { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Object anytype1; - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable anytype2 = JsonNullable.undefined(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/model/AnimalDto.java b/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/model/AnimalDto.java index e301cd61dba3..67474f01ec05 100644 --- a/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/model/AnimalDto.java +++ b/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/model/AnimalDto.java @@ -36,6 +36,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class AnimalDto { + @JsonInclude(JsonInclude.Include.NON_NULL) private String className; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/model/CategoryDto.java b/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/model/CategoryDto.java index 5c51fa54cc0a..ca80887aed58 100644 --- a/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/model/CategoryDto.java +++ b/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/model/CategoryDto.java @@ -26,6 +26,7 @@ public class CategoryDto { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Long id; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name = "default-name"; public CategoryDto() { diff --git a/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/model/ContainerDefaultValueDto.java b/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/model/ContainerDefaultValueDto.java index af2b07f95d73..fe0be24e229d 100644 --- a/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/model/ContainerDefaultValueDto.java +++ b/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/model/ContainerDefaultValueDto.java @@ -28,14 +28,14 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class ContainerDefaultValueDto { - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> nullableArray = JsonNullable.>undefined(); + @JsonInclude(JsonInclude.Include.ALWAYS) private JsonNullable> nullableRequiredArray = JsonNullable.>undefined(); + @JsonInclude(JsonInclude.Include.NON_NULL) private List requiredArray = new ArrayList<>(); - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> nullableArrayWithDefault = JsonNullable.>undefined(); public ContainerDefaultValueDto() { diff --git a/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/model/EnumTestDto.java b/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/model/EnumTestDto.java index 5263a4e2bc96..5069a1a9acbb 100644 --- a/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/model/EnumTestDto.java +++ b/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/model/EnumTestDto.java @@ -102,6 +102,7 @@ public static EnumStringRequiredEnum fromValue(String value) { } } + @JsonInclude(JsonInclude.Include.NON_NULL) private EnumStringRequiredEnum enumStringRequired; /** diff --git a/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/model/FormatTestDto.java b/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/model/FormatTestDto.java index 18101da678fa..c68a2728bcb1 100644 --- a/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/model/FormatTestDto.java +++ b/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/model/FormatTestDto.java @@ -38,6 +38,7 @@ public class FormatTestDto { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Long int64; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal number; @JsonInclude(JsonInclude.Include.NON_NULL) @@ -49,11 +50,13 @@ public class FormatTestDto { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable String string; + @JsonInclude(JsonInclude.Include.NON_NULL) private byte[] _byte; @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable org.springframework.core.io.Resource binary; + @JsonInclude(JsonInclude.Include.NON_NULL) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) private LocalDate date; @@ -64,6 +67,7 @@ public class FormatTestDto { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable UUID uuid; + @JsonInclude(JsonInclude.Include.NON_NULL) private String password; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/model/NameDto.java b/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/model/NameDto.java index 0d4be7ac8140..b6b48d488ede 100644 --- a/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/model/NameDto.java +++ b/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/model/NameDto.java @@ -23,6 +23,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class NameDto { + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer name; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/model/NullableMapPropertyDto.java b/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/model/NullableMapPropertyDto.java index f93832a65c98..d9edf72050f1 100644 --- a/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/model/NullableMapPropertyDto.java +++ b/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/model/NullableMapPropertyDto.java @@ -2,7 +2,6 @@ import java.net.URI; import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -28,7 +27,6 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class NullableMapPropertyDto { - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> languageValues = JsonNullable.>undefined(); public NullableMapPropertyDto languageValues(Map languageValues) { diff --git a/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/model/ParentWithNullableDto.java b/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/model/ParentWithNullableDto.java index 2300afd143a4..af08c71fb48f 100644 --- a/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/model/ParentWithNullableDto.java +++ b/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/model/ParentWithNullableDto.java @@ -74,7 +74,6 @@ public static TypeEnum fromValue(String value) { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable TypeEnum type; - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable nullableProperty = JsonNullable.undefined(); public ParentWithNullableDto type(@Nullable TypeEnum type) { diff --git a/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/model/PetDto.java b/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/model/PetDto.java index 0ce2b93a2b0f..791eea25f843 100644 --- a/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/model/PetDto.java +++ b/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/model/PetDto.java @@ -38,8 +38,10 @@ public class PetDto { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable CategoryDto category; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name; + @JsonInclude(JsonInclude.Include.NON_NULL) private Set photoUrls = new LinkedHashSet<>(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/model/TypeHolderDefaultDto.java b/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/model/TypeHolderDefaultDto.java index 987983e43451..8ca218f8c704 100644 --- a/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/model/TypeHolderDefaultDto.java +++ b/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/model/TypeHolderDefaultDto.java @@ -2,6 +2,7 @@ import java.net.URI; import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -26,14 +27,19 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class TypeHolderDefaultDto { + @JsonInclude(JsonInclude.Include.NON_NULL) private String stringItem = "what"; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal numberItem = new BigDecimal("1.234"); + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer integerItem = -2; + @JsonInclude(JsonInclude.Include.NON_NULL) private Boolean boolItem = true; + @JsonInclude(JsonInclude.Include.NON_NULL) private List arrayItem = new ArrayList<>(Arrays.asList(0, 1, 2, 3)); public TypeHolderDefaultDto() { diff --git a/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/model/TypeHolderExampleDto.java b/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/model/TypeHolderExampleDto.java index 4db40f3db382..eea548352cc7 100644 --- a/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/model/TypeHolderExampleDto.java +++ b/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/model/TypeHolderExampleDto.java @@ -2,6 +2,7 @@ import java.net.URI; import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -26,16 +27,22 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class TypeHolderExampleDto { + @JsonInclude(JsonInclude.Include.NON_NULL) private String stringItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal numberItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Float floatItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer integerItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Boolean boolItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private List arrayItem = new ArrayList<>(); public TypeHolderExampleDto() { diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/CategoryDto.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/CategoryDto.java index 457dd9ab011f..60c38d69c87f 100644 --- a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/CategoryDto.java +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/CategoryDto.java @@ -25,9 +25,11 @@ public class CategoryDto { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Long id; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String name; public CategoryDto id(@Nullable Long id) { @@ -45,7 +47,6 @@ public CategoryDto id(@Nullable Long id) { return id; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("id") public void setId(@Nullable Long id) { this.id = id; @@ -66,7 +67,6 @@ public CategoryDto name(@Nullable String name) { return name; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("name") public void setName(@Nullable String name) { this.name = name; diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/PetDto.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/PetDto.java index 2bec6c231fc2..6a6e87714952 100644 --- a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/PetDto.java +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/PetDto.java @@ -31,16 +31,21 @@ public class PetDto { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Long id; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable CategoryDto category; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name; + @JsonInclude(JsonInclude.Include.NON_NULL) private List photoUrls = new ArrayList<>(); @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private List tags = new ArrayList<>(); /** @@ -81,6 +86,7 @@ public static StatusEnum fromValue(String value) { } @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) @Deprecated private @Nullable StatusEnum status; @@ -103,7 +109,6 @@ public PetDto id(@Nullable Long id) { return id; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("id") public void setId(@Nullable Long id) { this.id = id; @@ -124,7 +129,6 @@ public PetDto category(@Nullable CategoryDto category) { return category; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("category") public void setCategory(@Nullable CategoryDto category) { this.category = category; @@ -201,7 +205,6 @@ public List getTags() { return tags; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("tags") public void setTags(List tags) { this.tags = tags; @@ -227,7 +230,6 @@ public PetDto status(@Nullable StatusEnum status) { /** * @deprecated */ - @JsonSetter(nulls = Nulls.SKIP) @Deprecated @JsonProperty("status") public void setStatus(@Nullable StatusEnum status) { diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/TagDto.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/TagDto.java index 453c993f1953..9f054df0c7c2 100644 --- a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/TagDto.java +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/TagDto.java @@ -25,9 +25,11 @@ public class TagDto { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Long id; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String name; public TagDto id(@Nullable Long id) { @@ -45,7 +47,6 @@ public TagDto id(@Nullable Long id) { return id; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("id") public void setId(@Nullable Long id) { this.id = id; @@ -66,7 +67,6 @@ public TagDto name(@Nullable String name) { return name; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("name") public void setName(@Nullable String name) { this.name = name; diff --git a/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index 0cd4c4edbd58..d143dbf68f9c 100644 --- a/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -56,7 +56,6 @@ public class AdditionalPropertiesClass { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Object anytype1; - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable anytype2 = JsonNullable.undefined(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/model/Animal.java b/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/model/Animal.java index 282ca2ce689b..fe52d0aa116a 100644 --- a/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/model/Animal.java +++ b/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/model/Animal.java @@ -36,6 +36,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class Animal { + @JsonInclude(JsonInclude.Include.NON_NULL) private String className; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/model/Category.java b/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/model/Category.java index 6778a62dfd5e..a606369f1c61 100644 --- a/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/model/Category.java +++ b/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/model/Category.java @@ -25,6 +25,7 @@ public class Category { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Long id; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name = "default-name"; public Category() { diff --git a/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/model/ContainerDefaultValue.java b/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/model/ContainerDefaultValue.java index 16f74d8223aa..ca932fee5f0f 100644 --- a/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/model/ContainerDefaultValue.java +++ b/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/model/ContainerDefaultValue.java @@ -27,14 +27,14 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class ContainerDefaultValue { - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> nullableArray = JsonNullable.>undefined(); + @JsonInclude(JsonInclude.Include.ALWAYS) private JsonNullable> nullableRequiredArray = JsonNullable.>undefined(); + @JsonInclude(JsonInclude.Include.NON_NULL) private List requiredArray = new ArrayList<>(); - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> nullableArrayWithDefault = JsonNullable.>undefined(); public ContainerDefaultValue() { diff --git a/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/model/EnumTest.java b/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/model/EnumTest.java index 54c2c98f7fe4..58945182bd97 100644 --- a/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/model/EnumTest.java @@ -103,6 +103,7 @@ public static EnumStringRequiredEnum fromValue(String value) { } } + @JsonInclude(JsonInclude.Include.NON_NULL) private EnumStringRequiredEnum enumStringRequired; /** diff --git a/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/model/FormatTest.java b/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/model/FormatTest.java index c2dc9d17f0b8..fe3df02f9da4 100644 --- a/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/model/FormatTest.java @@ -39,6 +39,7 @@ public class FormatTest { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Long int64; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal number; @JsonInclude(JsonInclude.Include.NON_NULL) @@ -50,11 +51,13 @@ public class FormatTest { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable String string; + @JsonInclude(JsonInclude.Include.NON_NULL) private byte[] _byte; @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable org.springframework.core.io.Resource binary; + @JsonInclude(JsonInclude.Include.NON_NULL) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) private LocalDate date; @@ -65,6 +68,7 @@ public class FormatTest { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable UUID uuid; + @JsonInclude(JsonInclude.Include.NON_NULL) private String password; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/model/Name.java b/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/model/Name.java index 07be2f99663a..1edf0813d0b5 100644 --- a/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/model/Name.java +++ b/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/model/Name.java @@ -22,6 +22,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class Name { + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer name; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/model/NullableMapProperty.java b/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/model/NullableMapProperty.java index 3abb813498f2..dff5aa4523f8 100644 --- a/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/model/NullableMapProperty.java +++ b/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/model/NullableMapProperty.java @@ -2,7 +2,6 @@ import java.net.URI; import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Arrays; @@ -27,7 +26,6 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class NullableMapProperty { - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> languageValues = JsonNullable.>undefined(); public NullableMapProperty languageValues(Map languageValues) { diff --git a/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/model/ParentWithNullable.java b/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/model/ParentWithNullable.java index 79e274840817..9b895427687b 100644 --- a/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/model/ParentWithNullable.java +++ b/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/model/ParentWithNullable.java @@ -74,7 +74,6 @@ public static TypeEnum fromValue(String value) { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable TypeEnum type; - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable nullableProperty = JsonNullable.undefined(); public ParentWithNullable type(@Nullable TypeEnum type) { diff --git a/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/model/Pet.java b/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/model/Pet.java index be762175a56b..2e84df56c536 100644 --- a/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/model/Pet.java +++ b/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/model/Pet.java @@ -37,8 +37,10 @@ public class Pet { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Category category; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name; + @JsonInclude(JsonInclude.Include.NON_NULL) private Set photoUrls = new LinkedHashSet<>(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/model/TypeHolderDefault.java index 1f8e4dc3d890..7aedd82ea28e 100644 --- a/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -2,6 +2,7 @@ import java.net.URI; import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.math.BigDecimal; @@ -25,14 +26,19 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class TypeHolderDefault { + @JsonInclude(JsonInclude.Include.NON_NULL) private String stringItem = "what"; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal numberItem = new BigDecimal("1.234"); + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer integerItem = -2; + @JsonInclude(JsonInclude.Include.NON_NULL) private Boolean boolItem = true; + @JsonInclude(JsonInclude.Include.NON_NULL) private List arrayItem = new ArrayList<>(Arrays.asList(0, 1, 2, 3)); public TypeHolderDefault() { diff --git a/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/model/TypeHolderExample.java index d37cdc713ec3..f1609752ba2f 100644 --- a/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -2,6 +2,7 @@ import java.net.URI; import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.math.BigDecimal; @@ -25,16 +26,22 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class TypeHolderExample { + @JsonInclude(JsonInclude.Include.NON_NULL) private String stringItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal numberItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Float floatItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer integerItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Boolean boolItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private List arrayItem = new ArrayList<>(); public TypeHolderExample() { diff --git a/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index 120027d72686..b266f37f4576 100644 --- a/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -55,7 +55,6 @@ public class AdditionalPropertiesClass { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Object anytype1; - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable anytype2 = JsonNullable.undefined(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/model/Animal.java b/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/model/Animal.java index f5d220bc1b43..29ecd6ae4724 100644 --- a/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/model/Animal.java +++ b/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/model/Animal.java @@ -35,6 +35,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class Animal { + @JsonInclude(JsonInclude.Include.NON_NULL) private String className; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/model/Category.java b/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/model/Category.java index bcd733ba06d7..dd15acc4171f 100644 --- a/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/model/Category.java +++ b/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/model/Category.java @@ -24,6 +24,7 @@ public class Category { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Long id; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name = "default-name"; public Category() { diff --git a/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/model/ContainerDefaultValue.java b/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/model/ContainerDefaultValue.java index a348b064c179..31a8133cb94f 100644 --- a/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/model/ContainerDefaultValue.java +++ b/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/model/ContainerDefaultValue.java @@ -26,14 +26,14 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class ContainerDefaultValue { - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> nullableArray = JsonNullable.>undefined(); + @JsonInclude(JsonInclude.Include.ALWAYS) private JsonNullable> nullableRequiredArray = JsonNullable.>undefined(); + @JsonInclude(JsonInclude.Include.NON_NULL) private List requiredArray = new ArrayList<>(); - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> nullableArrayWithDefault = JsonNullable.>undefined(); public ContainerDefaultValue() { diff --git a/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/model/EnumTest.java b/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/model/EnumTest.java index c62cf18d0eee..07926663552d 100644 --- a/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/model/EnumTest.java @@ -102,6 +102,7 @@ public static EnumStringRequiredEnum fromValue(String value) { } } + @JsonInclude(JsonInclude.Include.NON_NULL) private EnumStringRequiredEnum enumStringRequired; /** diff --git a/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/model/FormatTest.java b/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/model/FormatTest.java index c0831401197a..f4aea008dfa3 100644 --- a/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/model/FormatTest.java @@ -38,6 +38,7 @@ public class FormatTest { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Long int64; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal number; @JsonInclude(JsonInclude.Include.NON_NULL) @@ -49,11 +50,13 @@ public class FormatTest { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable String string; + @JsonInclude(JsonInclude.Include.NON_NULL) private byte[] _byte; @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable org.springframework.core.io.Resource binary; + @JsonInclude(JsonInclude.Include.NON_NULL) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) private LocalDate date; @@ -64,6 +67,7 @@ public class FormatTest { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable UUID uuid; + @JsonInclude(JsonInclude.Include.NON_NULL) private String password; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/model/Name.java b/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/model/Name.java index f237f6637dd5..5be398a7e1c9 100644 --- a/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/model/Name.java +++ b/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/model/Name.java @@ -21,6 +21,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class Name { + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer name; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/model/NullableMapProperty.java b/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/model/NullableMapProperty.java index d5fda5613396..5e0395f3fd34 100644 --- a/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/model/NullableMapProperty.java +++ b/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/model/NullableMapProperty.java @@ -2,7 +2,6 @@ import java.net.URI; import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Arrays; @@ -26,7 +25,6 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class NullableMapProperty { - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> languageValues = JsonNullable.>undefined(); public NullableMapProperty languageValues(Map languageValues) { diff --git a/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/model/ParentWithNullable.java b/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/model/ParentWithNullable.java index 40350659ae78..a2e4fd94701a 100644 --- a/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/model/ParentWithNullable.java +++ b/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/model/ParentWithNullable.java @@ -73,7 +73,6 @@ public static TypeEnum fromValue(String value) { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable TypeEnum type; - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable nullableProperty = JsonNullable.undefined(); public ParentWithNullable type(@Nullable TypeEnum type) { diff --git a/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/model/Pet.java b/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/model/Pet.java index 89685de90050..906fa96ae1ee 100644 --- a/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/model/Pet.java +++ b/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/model/Pet.java @@ -36,8 +36,10 @@ public class Pet { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Category category; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name; + @JsonInclude(JsonInclude.Include.NON_NULL) private Set photoUrls = new LinkedHashSet<>(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/model/TypeHolderDefault.java index 4bf6cba777df..e8978ec83178 100644 --- a/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -2,6 +2,7 @@ import java.net.URI; import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.math.BigDecimal; @@ -24,14 +25,19 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class TypeHolderDefault { + @JsonInclude(JsonInclude.Include.NON_NULL) private String stringItem = "what"; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal numberItem = new BigDecimal("1.234"); + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer integerItem = -2; + @JsonInclude(JsonInclude.Include.NON_NULL) private Boolean boolItem = true; + @JsonInclude(JsonInclude.Include.NON_NULL) private List arrayItem = new ArrayList<>(Arrays.asList(0, 1, 2, 3)); public TypeHolderDefault() { diff --git a/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/model/TypeHolderExample.java index 5e77ca347711..4caccae69640 100644 --- a/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -2,6 +2,7 @@ import java.net.URI; import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.math.BigDecimal; @@ -24,16 +25,22 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class TypeHolderExample { + @JsonInclude(JsonInclude.Include.NON_NULL) private String stringItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal numberItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Float floatItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer integerItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Boolean boolItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private List arrayItem = new ArrayList<>(); public TypeHolderExample() { diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index 120027d72686..b266f37f4576 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -55,7 +55,6 @@ public class AdditionalPropertiesClass { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Object anytype1; - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable anytype2 = JsonNullable.undefined(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/Animal.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/Animal.java index f5d220bc1b43..29ecd6ae4724 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/Animal.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/Animal.java @@ -35,6 +35,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class Animal { + @JsonInclude(JsonInclude.Include.NON_NULL) private String className; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/Category.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/Category.java index bcd733ba06d7..dd15acc4171f 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/Category.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/Category.java @@ -24,6 +24,7 @@ public class Category { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Long id; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name = "default-name"; public Category() { diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/ContainerDefaultValue.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/ContainerDefaultValue.java index a348b064c179..31a8133cb94f 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/ContainerDefaultValue.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/ContainerDefaultValue.java @@ -26,14 +26,14 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class ContainerDefaultValue { - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> nullableArray = JsonNullable.>undefined(); + @JsonInclude(JsonInclude.Include.ALWAYS) private JsonNullable> nullableRequiredArray = JsonNullable.>undefined(); + @JsonInclude(JsonInclude.Include.NON_NULL) private List requiredArray = new ArrayList<>(); - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> nullableArrayWithDefault = JsonNullable.>undefined(); public ContainerDefaultValue() { diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/EnumTest.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/EnumTest.java index c62cf18d0eee..07926663552d 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/EnumTest.java @@ -102,6 +102,7 @@ public static EnumStringRequiredEnum fromValue(String value) { } } + @JsonInclude(JsonInclude.Include.NON_NULL) private EnumStringRequiredEnum enumStringRequired; /** diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/FormatTest.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/FormatTest.java index c0831401197a..f4aea008dfa3 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/FormatTest.java @@ -38,6 +38,7 @@ public class FormatTest { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Long int64; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal number; @JsonInclude(JsonInclude.Include.NON_NULL) @@ -49,11 +50,13 @@ public class FormatTest { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable String string; + @JsonInclude(JsonInclude.Include.NON_NULL) private byte[] _byte; @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable org.springframework.core.io.Resource binary; + @JsonInclude(JsonInclude.Include.NON_NULL) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) private LocalDate date; @@ -64,6 +67,7 @@ public class FormatTest { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable UUID uuid; + @JsonInclude(JsonInclude.Include.NON_NULL) private String password; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/Name.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/Name.java index f237f6637dd5..5be398a7e1c9 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/Name.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/Name.java @@ -21,6 +21,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class Name { + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer name; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/NullableMapProperty.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/NullableMapProperty.java index d5fda5613396..5e0395f3fd34 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/NullableMapProperty.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/NullableMapProperty.java @@ -2,7 +2,6 @@ import java.net.URI; import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Arrays; @@ -26,7 +25,6 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class NullableMapProperty { - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> languageValues = JsonNullable.>undefined(); public NullableMapProperty languageValues(Map languageValues) { diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/ParentWithNullable.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/ParentWithNullable.java index 40350659ae78..a2e4fd94701a 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/ParentWithNullable.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/ParentWithNullable.java @@ -73,7 +73,6 @@ public static TypeEnum fromValue(String value) { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable TypeEnum type; - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable nullableProperty = JsonNullable.undefined(); public ParentWithNullable type(@Nullable TypeEnum type) { diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/Pet.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/Pet.java index 89685de90050..906fa96ae1ee 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/Pet.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/Pet.java @@ -36,8 +36,10 @@ public class Pet { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Category category; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name; + @JsonInclude(JsonInclude.Include.NON_NULL) private Set photoUrls = new LinkedHashSet<>(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/TypeHolderDefault.java index 4bf6cba777df..e8978ec83178 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -2,6 +2,7 @@ import java.net.URI; import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.math.BigDecimal; @@ -24,14 +25,19 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class TypeHolderDefault { + @JsonInclude(JsonInclude.Include.NON_NULL) private String stringItem = "what"; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal numberItem = new BigDecimal("1.234"); + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer integerItem = -2; + @JsonInclude(JsonInclude.Include.NON_NULL) private Boolean boolItem = true; + @JsonInclude(JsonInclude.Include.NON_NULL) private List arrayItem = new ArrayList<>(Arrays.asList(0, 1, 2, 3)); public TypeHolderDefault() { diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/TypeHolderExample.java index 5e77ca347711..4caccae69640 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -2,6 +2,7 @@ import java.net.URI; import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.math.BigDecimal; @@ -24,16 +25,22 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class TypeHolderExample { + @JsonInclude(JsonInclude.Include.NON_NULL) private String stringItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal numberItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Float floatItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer integerItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Boolean boolItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private List arrayItem = new ArrayList<>(); public TypeHolderExample() { diff --git a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/AdditionalPropertiesAnyTypeDto.java b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/AdditionalPropertiesAnyTypeDto.java index 1cb856bede0d..295d6b496a00 100644 --- a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/AdditionalPropertiesAnyTypeDto.java +++ b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/AdditionalPropertiesAnyTypeDto.java @@ -31,6 +31,7 @@ public class AdditionalPropertiesAnyTypeDto { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String name; public AdditionalPropertiesAnyTypeDto name(@Nullable String name) { @@ -48,7 +49,6 @@ public AdditionalPropertiesAnyTypeDto name(@Nullable String name) { return name; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("name") public void setName(@Nullable String name) { this.name = name; diff --git a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/AdditionalPropertiesArrayDto.java b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/AdditionalPropertiesArrayDto.java index 0676ea4382d6..1af5c4e3e427 100644 --- a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/AdditionalPropertiesArrayDto.java +++ b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/AdditionalPropertiesArrayDto.java @@ -32,6 +32,7 @@ public class AdditionalPropertiesArrayDto { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String name; public AdditionalPropertiesArrayDto name(@Nullable String name) { @@ -49,7 +50,6 @@ public AdditionalPropertiesArrayDto name(@Nullable String name) { return name; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("name") public void setName(@Nullable String name) { this.name = name; diff --git a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/AdditionalPropertiesBooleanDto.java b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/AdditionalPropertiesBooleanDto.java index 2241c7d959f3..5186257ff7e9 100644 --- a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/AdditionalPropertiesBooleanDto.java +++ b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/AdditionalPropertiesBooleanDto.java @@ -31,6 +31,7 @@ public class AdditionalPropertiesBooleanDto { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String name; public AdditionalPropertiesBooleanDto name(@Nullable String name) { @@ -48,7 +49,6 @@ public AdditionalPropertiesBooleanDto name(@Nullable String name) { return name; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("name") public void setName(@Nullable String name) { this.name = name; diff --git a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/AdditionalPropertiesClassDto.java b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/AdditionalPropertiesClassDto.java index 2ea6bd2cd002..a8a585b40488 100644 --- a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/AdditionalPropertiesClassDto.java +++ b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/AdditionalPropertiesClassDto.java @@ -31,35 +31,45 @@ public class AdditionalPropertiesClassDto { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private Map mapString = new HashMap<>(); @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private Map mapNumber = new HashMap<>(); @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private Map mapInteger = new HashMap<>(); @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private Map mapBoolean = new HashMap<>(); @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private Map> mapArrayInteger = new HashMap<>(); @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private Map> mapArrayAnytype = new HashMap<>(); @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private Map> mapMapString = new HashMap<>(); @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private Map> mapMapAnytype = new HashMap<>(); @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Object anytype1; private @Nullable Object anytype2 = null; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Object anytype3; public AdditionalPropertiesClassDto mapString(Map mapString) { @@ -85,7 +95,6 @@ public Map getMapString() { return mapString; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("map_string") public void setMapString(Map mapString) { this.mapString = mapString; @@ -114,7 +123,6 @@ public Map getMapNumber() { return mapNumber; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("map_number") public void setMapNumber(Map mapNumber) { this.mapNumber = mapNumber; @@ -143,7 +151,6 @@ public Map getMapInteger() { return mapInteger; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("map_integer") public void setMapInteger(Map mapInteger) { this.mapInteger = mapInteger; @@ -172,7 +179,6 @@ public Map getMapBoolean() { return mapBoolean; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("map_boolean") public void setMapBoolean(Map mapBoolean) { this.mapBoolean = mapBoolean; @@ -201,7 +207,6 @@ public Map> getMapArrayInteger() { return mapArrayInteger; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("map_array_integer") public void setMapArrayInteger(Map> mapArrayInteger) { this.mapArrayInteger = mapArrayInteger; @@ -230,7 +235,6 @@ public Map> getMapArrayAnytype() { return mapArrayAnytype; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("map_array_anytype") public void setMapArrayAnytype(Map> mapArrayAnytype) { this.mapArrayAnytype = mapArrayAnytype; @@ -259,7 +263,6 @@ public Map> getMapMapString() { return mapMapString; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("map_map_string") public void setMapMapString(Map> mapMapString) { this.mapMapString = mapMapString; @@ -288,7 +291,6 @@ public Map> getMapMapAnytype() { return mapMapAnytype; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("map_map_anytype") public void setMapMapAnytype(Map> mapMapAnytype) { this.mapMapAnytype = mapMapAnytype; @@ -309,7 +311,6 @@ public AdditionalPropertiesClassDto anytype1(@Nullable Object anytype1) { return anytype1; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("anytype_1") public void setAnytype1(@Nullable Object anytype1) { this.anytype1 = anytype1; @@ -350,7 +351,6 @@ public AdditionalPropertiesClassDto anytype3(@Nullable Object anytype3) { return anytype3; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("anytype_3") public void setAnytype3(@Nullable Object anytype3) { this.anytype3 = anytype3; diff --git a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/AdditionalPropertiesIntegerDto.java b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/AdditionalPropertiesIntegerDto.java index b316d3c81cda..5953b7ef4a6f 100644 --- a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/AdditionalPropertiesIntegerDto.java +++ b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/AdditionalPropertiesIntegerDto.java @@ -31,6 +31,7 @@ public class AdditionalPropertiesIntegerDto { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String name; public AdditionalPropertiesIntegerDto name(@Nullable String name) { @@ -48,7 +49,6 @@ public AdditionalPropertiesIntegerDto name(@Nullable String name) { return name; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("name") public void setName(@Nullable String name) { this.name = name; diff --git a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/AdditionalPropertiesNumberDto.java b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/AdditionalPropertiesNumberDto.java index d5cc7439d547..5e1fd8bb52cb 100644 --- a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/AdditionalPropertiesNumberDto.java +++ b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/AdditionalPropertiesNumberDto.java @@ -32,6 +32,7 @@ public class AdditionalPropertiesNumberDto { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String name; public AdditionalPropertiesNumberDto name(@Nullable String name) { @@ -49,7 +50,6 @@ public AdditionalPropertiesNumberDto name(@Nullable String name) { return name; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("name") public void setName(@Nullable String name) { this.name = name; diff --git a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/AdditionalPropertiesObjectDto.java b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/AdditionalPropertiesObjectDto.java index 5ba2d44f1289..e074be7e9fc1 100644 --- a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/AdditionalPropertiesObjectDto.java +++ b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/AdditionalPropertiesObjectDto.java @@ -32,6 +32,7 @@ public class AdditionalPropertiesObjectDto { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String name; public AdditionalPropertiesObjectDto name(@Nullable String name) { @@ -49,7 +50,6 @@ public AdditionalPropertiesObjectDto name(@Nullable String name) { return name; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("name") public void setName(@Nullable String name) { this.name = name; diff --git a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/AdditionalPropertiesStringDto.java b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/AdditionalPropertiesStringDto.java index 1d2c057c67f8..7f2716e810b8 100644 --- a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/AdditionalPropertiesStringDto.java +++ b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/AdditionalPropertiesStringDto.java @@ -31,6 +31,7 @@ public class AdditionalPropertiesStringDto { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String name; public AdditionalPropertiesStringDto name(@Nullable String name) { @@ -48,7 +49,6 @@ public AdditionalPropertiesStringDto name(@Nullable String name) { return name; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("name") public void setName(@Nullable String name) { this.name = name; diff --git a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/AnimalDto.java b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/AnimalDto.java index 79eb758c01f0..4accd0918d94 100644 --- a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/AnimalDto.java +++ b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/AnimalDto.java @@ -39,9 +39,11 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class AnimalDto { + @JsonInclude(JsonInclude.Include.NON_NULL) private String className; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private String color = "red"; public AnimalDto() { @@ -83,7 +85,6 @@ public String getColor() { return color; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("color") public void setColor(String color) { this.color = color; diff --git a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/ApiResponseDto.java b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/ApiResponseDto.java index 816907e58b6a..1a2565b3fd59 100644 --- a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/ApiResponseDto.java +++ b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/ApiResponseDto.java @@ -27,12 +27,15 @@ public class ApiResponseDto { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Integer code; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String type; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String message; public ApiResponseDto code(@Nullable Integer code) { @@ -50,7 +53,6 @@ public ApiResponseDto code(@Nullable Integer code) { return code; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("code") public void setCode(@Nullable Integer code) { this.code = code; @@ -71,7 +73,6 @@ public ApiResponseDto type(@Nullable String type) { return type; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("type") public void setType(@Nullable String type) { this.type = type; @@ -92,7 +93,6 @@ public ApiResponseDto message(@Nullable String message) { return message; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("message") public void setMessage(@Nullable String message) { this.message = message; diff --git a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnlyDto.java b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnlyDto.java index fa600276dd17..5ffe266b5d11 100644 --- a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnlyDto.java +++ b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnlyDto.java @@ -31,6 +31,7 @@ public class ArrayOfArrayOfNumberOnlyDto { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private List> arrayArrayNumber = new ArrayList<>(); public ArrayOfArrayOfNumberOnlyDto arrayArrayNumber(List> arrayArrayNumber) { @@ -56,7 +57,6 @@ public List> getArrayArrayNumber() { return arrayArrayNumber; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("ArrayArrayNumber") public void setArrayArrayNumber(List> arrayArrayNumber) { this.arrayArrayNumber = arrayArrayNumber; diff --git a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/ArrayOfNumberOnlyDto.java b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/ArrayOfNumberOnlyDto.java index 59a9a5cf1f8f..e2e197848a86 100644 --- a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/ArrayOfNumberOnlyDto.java +++ b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/ArrayOfNumberOnlyDto.java @@ -31,6 +31,7 @@ public class ArrayOfNumberOnlyDto { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private List arrayNumber = new ArrayList<>(); public ArrayOfNumberOnlyDto arrayNumber(List arrayNumber) { @@ -56,7 +57,6 @@ public List getArrayNumber() { return arrayNumber; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("ArrayNumber") public void setArrayNumber(List arrayNumber) { this.arrayNumber = arrayNumber; diff --git a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/ArrayTestDto.java b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/ArrayTestDto.java index 9d892b04ccdb..9f9cd29a27ce 100644 --- a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/ArrayTestDto.java +++ b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/ArrayTestDto.java @@ -31,12 +31,15 @@ public class ArrayTestDto { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private List arrayOfString = new ArrayList<>(); @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private List> arrayArrayOfInteger = new ArrayList<>(); @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private List> arrayArrayOfModel = new ArrayList<>(); public ArrayTestDto arrayOfString(List arrayOfString) { @@ -62,7 +65,6 @@ public List getArrayOfString() { return arrayOfString; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("array_of_string") public void setArrayOfString(List arrayOfString) { this.arrayOfString = arrayOfString; @@ -91,7 +93,6 @@ public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("array_array_of_integer") public void setArrayArrayOfInteger(List> arrayArrayOfInteger) { this.arrayArrayOfInteger = arrayArrayOfInteger; @@ -120,7 +121,6 @@ public ArrayTestDto addArrayArrayOfModelItem(List<@Valid ReadOnlyFirstDto> array return arrayArrayOfModel; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("array_array_of_model") public void setArrayArrayOfModel(List> arrayArrayOfModel) { this.arrayArrayOfModel = arrayArrayOfModel; diff --git a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/BigCatDto.java b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/BigCatDto.java index d6dbc67f2d23..0157f3f90a5e 100644 --- a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/BigCatDto.java +++ b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/BigCatDto.java @@ -72,6 +72,7 @@ public static KindEnum fromValue(String value) { } @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable KindEnum kind; public BigCatDto() { @@ -93,7 +94,6 @@ public BigCatDto kind(@Nullable KindEnum kind) { return kind; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("kind") public void setKind(@Nullable KindEnum kind) { this.kind = kind; diff --git a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/CapitalizationDto.java b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/CapitalizationDto.java index 3e334c63cc44..b8cd114ab05d 100644 --- a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/CapitalizationDto.java +++ b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/CapitalizationDto.java @@ -27,21 +27,27 @@ public class CapitalizationDto { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String smallCamel; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String capitalCamel; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String smallSnake; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String capitalSnake; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String scAETHFlowPoints; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String ATT_NAME; public CapitalizationDto smallCamel(@Nullable String smallCamel) { @@ -59,7 +65,6 @@ public CapitalizationDto smallCamel(@Nullable String smallCamel) { return smallCamel; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("smallCamel") public void setSmallCamel(@Nullable String smallCamel) { this.smallCamel = smallCamel; @@ -80,7 +85,6 @@ public CapitalizationDto capitalCamel(@Nullable String capitalCamel) { return capitalCamel; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("CapitalCamel") public void setCapitalCamel(@Nullable String capitalCamel) { this.capitalCamel = capitalCamel; @@ -101,7 +105,6 @@ public CapitalizationDto smallSnake(@Nullable String smallSnake) { return smallSnake; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("small_Snake") public void setSmallSnake(@Nullable String smallSnake) { this.smallSnake = smallSnake; @@ -122,7 +125,6 @@ public CapitalizationDto capitalSnake(@Nullable String capitalSnake) { return capitalSnake; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("Capital_Snake") public void setCapitalSnake(@Nullable String capitalSnake) { this.capitalSnake = capitalSnake; @@ -143,7 +145,6 @@ public CapitalizationDto scAETHFlowPoints(@Nullable String scAETHFlowPoints) { return scAETHFlowPoints; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("SCA_ETH_Flow_Points") public void setScAETHFlowPoints(@Nullable String scAETHFlowPoints) { this.scAETHFlowPoints = scAETHFlowPoints; @@ -164,7 +165,6 @@ public CapitalizationDto ATT_NAME(@Nullable String ATT_NAME) { return ATT_NAME; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("ATT_NAME") public void setATTNAME(@Nullable String ATT_NAME) { this.ATT_NAME = ATT_NAME; diff --git a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/CatDto.java b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/CatDto.java index cdad439483f3..8cc3ac72727a 100644 --- a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/CatDto.java +++ b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/CatDto.java @@ -39,6 +39,7 @@ public class CatDto extends AnimalDto { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Boolean declawed; public CatDto() { @@ -60,7 +61,6 @@ public CatDto declawed(@Nullable Boolean declawed) { return declawed; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("declawed") public void setDeclawed(@Nullable Boolean declawed) { this.declawed = declawed; diff --git a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/CategoryDto.java b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/CategoryDto.java index a7974b8569f2..d594d20b7040 100644 --- a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/CategoryDto.java +++ b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/CategoryDto.java @@ -27,8 +27,10 @@ public class CategoryDto { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Long id; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name = "default-name"; public CategoryDto() { @@ -50,7 +52,6 @@ public CategoryDto id(@Nullable Long id) { return id; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("id") public void setId(@Nullable Long id) { this.id = id; diff --git a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/ChildWithNullableDto.java b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/ChildWithNullableDto.java index f51abf8ece42..e8052ff73150 100644 --- a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/ChildWithNullableDto.java +++ b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/ChildWithNullableDto.java @@ -33,6 +33,7 @@ public class ChildWithNullableDto extends ParentWithNullableDto { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String otherProperty; public ChildWithNullableDto otherProperty(@Nullable String otherProperty) { @@ -50,7 +51,6 @@ public ChildWithNullableDto otherProperty(@Nullable String otherProperty) { return otherProperty; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("otherProperty") public void setOtherProperty(@Nullable String otherProperty) { this.otherProperty = otherProperty; diff --git a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/ClassModelDto.java b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/ClassModelDto.java index 224945aa2097..4946321f4ff8 100644 --- a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/ClassModelDto.java +++ b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/ClassModelDto.java @@ -27,6 +27,7 @@ public class ClassModelDto { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String propertyClass; public ClassModelDto propertyClass(@Nullable String propertyClass) { @@ -44,7 +45,6 @@ public ClassModelDto propertyClass(@Nullable String propertyClass) { return propertyClass; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("_class") public void setPropertyClass(@Nullable String propertyClass) { this.propertyClass = propertyClass; diff --git a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/ClientDto.java b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/ClientDto.java index d56f7d0b101d..d1e32d687f45 100644 --- a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/ClientDto.java +++ b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/ClientDto.java @@ -27,6 +27,7 @@ public class ClientDto { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String client; public ClientDto client(@Nullable String client) { @@ -44,7 +45,6 @@ public ClientDto client(@Nullable String client) { return client; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("client") public void setClient(@Nullable String client) { this.client = client; diff --git a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/ContainerDefaultValueDto.java b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/ContainerDefaultValueDto.java index b28ffec6be94..b5627e929b6b 100644 --- a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/ContainerDefaultValueDto.java +++ b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/ContainerDefaultValueDto.java @@ -2,6 +2,7 @@ import java.net.URI; import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -28,8 +29,10 @@ public class ContainerDefaultValueDto { private @Nullable List nullableArray; + @JsonInclude(JsonInclude.Include.ALWAYS) private List nullableRequiredArray; + @JsonInclude(JsonInclude.Include.NON_NULL) private List requiredArray = new ArrayList<>(); private @Nullable List nullableArrayWithDefault = new ArrayList<>(Arrays.asList("foo", "bar")); diff --git a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/DogDto.java b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/DogDto.java index 24cf4c298157..f5208d6b9613 100644 --- a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/DogDto.java +++ b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/DogDto.java @@ -32,6 +32,7 @@ public class DogDto extends AnimalDto { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String breed; public DogDto() { @@ -53,7 +54,6 @@ public DogDto breed(@Nullable String breed) { return breed; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("breed") public void setBreed(@Nullable String breed) { this.breed = breed; diff --git a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/EnumArraysDto.java b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/EnumArraysDto.java index 77c896e6f7bb..1a573e6b8d0e 100644 --- a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/EnumArraysDto.java +++ b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/EnumArraysDto.java @@ -66,6 +66,7 @@ public static JustSymbolEnum fromValue(String value) { } @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable JustSymbolEnum justSymbol; /** @@ -104,6 +105,7 @@ public static ArrayEnumEnum fromValue(String value) { } @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private List arrayEnum = new ArrayList<>(); public EnumArraysDto justSymbol(@Nullable JustSymbolEnum justSymbol) { @@ -121,7 +123,6 @@ public EnumArraysDto justSymbol(@Nullable JustSymbolEnum justSymbol) { return justSymbol; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("just_symbol") public void setJustSymbol(@Nullable JustSymbolEnum justSymbol) { this.justSymbol = justSymbol; @@ -150,7 +151,6 @@ public List getArrayEnum() { return arrayEnum; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("array_enum") public void setArrayEnum(List arrayEnum) { this.arrayEnum = arrayEnum; diff --git a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/EnumTestDto.java b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/EnumTestDto.java index f94de0c9c545..875ed5bc644b 100644 --- a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/EnumTestDto.java +++ b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/EnumTestDto.java @@ -66,6 +66,7 @@ public static EnumStringEnum fromValue(String value) { } @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable EnumStringEnum enumString; /** @@ -105,6 +106,7 @@ public static EnumStringRequiredEnum fromValue(String value) { } } + @JsonInclude(JsonInclude.Include.NON_NULL) private EnumStringRequiredEnum enumStringRequired; /** @@ -143,6 +145,7 @@ public static EnumIntegerEnum fromValue(Integer value) { } @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable EnumIntegerEnum enumInteger; /** @@ -181,9 +184,11 @@ public static EnumNumberEnum fromValue(Double value) { } @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable EnumNumberEnum enumNumber; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable OuterEnumDto outerEnum; public EnumTestDto() { @@ -205,7 +210,6 @@ public EnumTestDto enumString(@Nullable EnumStringEnum enumString) { return enumString; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("enum_string") public void setEnumString(@Nullable EnumStringEnum enumString) { this.enumString = enumString; @@ -246,7 +250,6 @@ public EnumTestDto enumInteger(@Nullable EnumIntegerEnum enumInteger) { return enumInteger; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("enum_integer") public void setEnumInteger(@Nullable EnumIntegerEnum enumInteger) { this.enumInteger = enumInteger; @@ -267,7 +270,6 @@ public EnumTestDto enumNumber(@Nullable EnumNumberEnum enumNumber) { return enumNumber; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("enum_number") public void setEnumNumber(@Nullable EnumNumberEnum enumNumber) { this.enumNumber = enumNumber; @@ -288,7 +290,6 @@ public EnumTestDto outerEnum(@Nullable OuterEnumDto outerEnum) { return outerEnum; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("outerEnum") public void setOuterEnum(@Nullable OuterEnumDto outerEnum) { this.outerEnum = outerEnum; diff --git a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/FileDto.java b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/FileDto.java index 8d754b6d329e..aa14224caf89 100644 --- a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/FileDto.java +++ b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/FileDto.java @@ -27,6 +27,7 @@ public class FileDto { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String sourceURI; public FileDto sourceURI(@Nullable String sourceURI) { @@ -44,7 +45,6 @@ public FileDto sourceURI(@Nullable String sourceURI) { return sourceURI; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("sourceURI") public void setSourceURI(@Nullable String sourceURI) { this.sourceURI = sourceURI; diff --git a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/FileSchemaTestClassDto.java b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/FileSchemaTestClassDto.java index e64265eb2f4c..158f346707f0 100644 --- a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/FileSchemaTestClassDto.java +++ b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/FileSchemaTestClassDto.java @@ -31,9 +31,11 @@ public class FileSchemaTestClassDto { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable FileDto file; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private List<@Valid FileDto> files = new ArrayList<>(); public FileSchemaTestClassDto file(@Nullable FileDto file) { @@ -51,7 +53,6 @@ public FileSchemaTestClassDto file(@Nullable FileDto file) { return file; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("file") public void setFile(@Nullable FileDto file) { this.file = file; @@ -80,7 +81,6 @@ public FileSchemaTestClassDto addFilesItem(FileDto filesItem) { return files; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("files") public void setFiles(List<@Valid FileDto> files) { this.files = files; diff --git a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/FormatTestDto.java b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/FormatTestDto.java index e6c0613fa656..841e6c4ff31c 100644 --- a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/FormatTestDto.java +++ b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/FormatTestDto.java @@ -33,43 +33,57 @@ public class FormatTestDto { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Integer integer; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Integer int32; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Long int64; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal number; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Float _float; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Double _double; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String string; + @JsonInclude(JsonInclude.Include.NON_NULL) private byte[] _byte; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable org.springframework.core.io.Resource binary; + @JsonInclude(JsonInclude.Include.NON_NULL) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) private LocalDate date; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private @Nullable OffsetDateTime dateTime; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable UUID uuid; + @JsonInclude(JsonInclude.Include.NON_NULL) private String password; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable BigDecimal bigDecimal; public FormatTestDto() { @@ -93,7 +107,6 @@ public FormatTestDto integer(@Nullable Integer integer) { return integer; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("integer") public void setInteger(@Nullable Integer integer) { this.integer = integer; @@ -116,7 +129,6 @@ public FormatTestDto int32(@Nullable Integer int32) { return int32; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("int32") public void setInt32(@Nullable Integer int32) { this.int32 = int32; @@ -137,7 +149,6 @@ public FormatTestDto int64(@Nullable Long int64) { return int64; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("int64") public void setInt64(@Nullable Long int64) { this.int64 = int64; @@ -182,7 +193,6 @@ public FormatTestDto _float(@Nullable Float _float) { return _float; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("float") public void setFloat(@Nullable Float _float) { this._float = _float; @@ -205,7 +215,6 @@ public FormatTestDto _double(@Nullable Double _double) { return _double; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("double") public void setDouble(@Nullable Double _double) { this._double = _double; @@ -226,7 +235,6 @@ public FormatTestDto string(@Nullable String string) { return string; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("string") public void setString(@Nullable String string) { this.string = string; @@ -267,7 +275,6 @@ public FormatTestDto binary(@Nullable org.springframework.core.io.Resource binar return binary; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("binary") public void setBinary(@Nullable org.springframework.core.io.Resource binary) { this.binary = binary; @@ -308,7 +315,6 @@ public FormatTestDto dateTime(@Nullable OffsetDateTime dateTime) { return dateTime; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("dateTime") public void setDateTime(@Nullable OffsetDateTime dateTime) { this.dateTime = dateTime; @@ -329,7 +335,6 @@ public FormatTestDto uuid(@Nullable UUID uuid) { return uuid; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("uuid") public void setUuid(@Nullable UUID uuid) { this.uuid = uuid; @@ -370,7 +375,6 @@ public FormatTestDto bigDecimal(@Nullable BigDecimal bigDecimal) { return bigDecimal; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("BigDecimal") public void setBigDecimal(@Nullable BigDecimal bigDecimal) { this.bigDecimal = bigDecimal; diff --git a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/HasOnlyReadOnlyDto.java b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/HasOnlyReadOnlyDto.java index 7f1ec148d734..a4d5ad3f5be1 100644 --- a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/HasOnlyReadOnlyDto.java +++ b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/HasOnlyReadOnlyDto.java @@ -27,9 +27,11 @@ public class HasOnlyReadOnlyDto { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String bar; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String foo; public HasOnlyReadOnlyDto bar(@Nullable String bar) { @@ -47,7 +49,6 @@ public HasOnlyReadOnlyDto bar(@Nullable String bar) { return bar; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("bar") public void setBar(@Nullable String bar) { this.bar = bar; @@ -68,7 +69,6 @@ public HasOnlyReadOnlyDto foo(@Nullable String foo) { return foo; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("foo") public void setFoo(@Nullable String foo) { this.foo = foo; diff --git a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/ListDto.java b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/ListDto.java index f81d7e91fa7a..6d00c022246a 100644 --- a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/ListDto.java +++ b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/ListDto.java @@ -27,6 +27,7 @@ public class ListDto { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String _123list; public ListDto _123list(@Nullable String _123list) { @@ -44,7 +45,6 @@ public ListDto _123list(@Nullable String _123list) { return _123list; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("123-list") public void set123list(@Nullable String _123list) { this._123list = _123list; diff --git a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/MapTestDto.java b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/MapTestDto.java index 09940c4522d0..5cf480833005 100644 --- a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/MapTestDto.java +++ b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/MapTestDto.java @@ -30,6 +30,7 @@ public class MapTestDto { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private Map> mapMapOfString = new HashMap<>(); /** @@ -68,12 +69,15 @@ public static InnerEnum fromValue(String value) { } @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private Map mapOfEnumString = new HashMap<>(); @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private Map directMap = new HashMap<>(); @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private Map indirectMap = new HashMap<>(); public MapTestDto mapMapOfString(Map> mapMapOfString) { @@ -99,7 +103,6 @@ public Map> getMapMapOfString() { return mapMapOfString; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("map_map_of_string") public void setMapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; @@ -128,7 +131,6 @@ public Map getMapOfEnumString() { return mapOfEnumString; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("map_of_enum_string") public void setMapOfEnumString(Map mapOfEnumString) { this.mapOfEnumString = mapOfEnumString; @@ -157,7 +159,6 @@ public Map getDirectMap() { return directMap; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("direct_map") public void setDirectMap(Map directMap) { this.directMap = directMap; @@ -186,7 +187,6 @@ public Map getIndirectMap() { return indirectMap; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("indirect_map") public void setIndirectMap(Map indirectMap) { this.indirectMap = indirectMap; diff --git a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClassDto.java b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClassDto.java index e3ffa8984cf9..900a1ee469b4 100644 --- a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClassDto.java +++ b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClassDto.java @@ -33,13 +33,16 @@ public class MixedPropertiesAndAdditionalPropertiesClassDto { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable UUID uuid; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private @Nullable OffsetDateTime dateTime; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private Map map = new HashMap<>(); public MixedPropertiesAndAdditionalPropertiesClassDto uuid(@Nullable UUID uuid) { @@ -57,7 +60,6 @@ public MixedPropertiesAndAdditionalPropertiesClassDto uuid(@Nullable UUID uuid) return uuid; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("uuid") public void setUuid(@Nullable UUID uuid) { this.uuid = uuid; @@ -78,7 +80,6 @@ public MixedPropertiesAndAdditionalPropertiesClassDto dateTime(@Nullable OffsetD return dateTime; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("dateTime") public void setDateTime(@Nullable OffsetDateTime dateTime) { this.dateTime = dateTime; @@ -107,7 +108,6 @@ public Map getMap() { return map; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("map") public void setMap(Map map) { this.map = map; diff --git a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/Model200ResponseDto.java b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/Model200ResponseDto.java index 68ab43312e9a..f88e19f2aa90 100644 --- a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/Model200ResponseDto.java +++ b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/Model200ResponseDto.java @@ -27,9 +27,11 @@ public class Model200ResponseDto { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Integer name; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String propertyClass; public Model200ResponseDto name(@Nullable Integer name) { @@ -47,7 +49,6 @@ public Model200ResponseDto name(@Nullable Integer name) { return name; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("name") public void setName(@Nullable Integer name) { this.name = name; @@ -68,7 +69,6 @@ public Model200ResponseDto propertyClass(@Nullable String propertyClass) { return propertyClass; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("class") public void setPropertyClass(@Nullable String propertyClass) { this.propertyClass = propertyClass; diff --git a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/NameDto.java b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/NameDto.java index 809f87f431c2..3ef8f8bb33c2 100644 --- a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/NameDto.java +++ b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/NameDto.java @@ -26,15 +26,19 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class NameDto { + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer name; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Integer snakeCase; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String property; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Integer _123number; public NameDto() { @@ -76,7 +80,6 @@ public NameDto snakeCase(@Nullable Integer snakeCase) { return snakeCase; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("snake_case") public void setSnakeCase(@Nullable Integer snakeCase) { this.snakeCase = snakeCase; @@ -97,7 +100,6 @@ public NameDto property(@Nullable String property) { return property; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("property") public void setProperty(@Nullable String property) { this.property = property; @@ -118,7 +120,6 @@ public NameDto _123number(@Nullable Integer _123number) { return _123number; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("123Number") public void set123number(@Nullable Integer _123number) { this._123number = _123number; diff --git a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/NumberOnlyDto.java b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/NumberOnlyDto.java index 38d2fe30ad04..34b93588f32c 100644 --- a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/NumberOnlyDto.java +++ b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/NumberOnlyDto.java @@ -28,6 +28,7 @@ public class NumberOnlyDto { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable BigDecimal justNumber; public NumberOnlyDto justNumber(@Nullable BigDecimal justNumber) { @@ -45,7 +46,6 @@ public NumberOnlyDto justNumber(@Nullable BigDecimal justNumber) { return justNumber; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("JustNumber") public void setJustNumber(@Nullable BigDecimal justNumber) { this.justNumber = justNumber; diff --git a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/OrderDto.java b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/OrderDto.java index 10749eefcf28..08c1defb229f 100644 --- a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/OrderDto.java +++ b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/OrderDto.java @@ -30,15 +30,19 @@ public class OrderDto { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Long id; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Long petId; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Integer quantity; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private @Nullable OffsetDateTime shipDate; @@ -80,9 +84,11 @@ public static StatusEnum fromValue(String value) { } @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable StatusEnum status; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private Boolean complete = false; public OrderDto id(@Nullable Long id) { @@ -100,7 +106,6 @@ public OrderDto id(@Nullable Long id) { return id; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("id") public void setId(@Nullable Long id) { this.id = id; @@ -121,7 +126,6 @@ public OrderDto petId(@Nullable Long petId) { return petId; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("petId") public void setPetId(@Nullable Long petId) { this.petId = petId; @@ -142,7 +146,6 @@ public OrderDto quantity(@Nullable Integer quantity) { return quantity; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("quantity") public void setQuantity(@Nullable Integer quantity) { this.quantity = quantity; @@ -163,7 +166,6 @@ public OrderDto shipDate(@Nullable OffsetDateTime shipDate) { return shipDate; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("shipDate") public void setShipDate(@Nullable OffsetDateTime shipDate) { this.shipDate = shipDate; @@ -184,7 +186,6 @@ public OrderDto status(@Nullable StatusEnum status) { return status; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("status") public void setStatus(@Nullable StatusEnum status) { this.status = status; @@ -205,7 +206,6 @@ public Boolean getComplete() { return complete; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("complete") public void setComplete(Boolean complete) { this.complete = complete; diff --git a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/OuterCompositeDto.java b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/OuterCompositeDto.java index ef36d8f2150d..ec6558982ce0 100644 --- a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/OuterCompositeDto.java +++ b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/OuterCompositeDto.java @@ -28,12 +28,15 @@ public class OuterCompositeDto { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable BigDecimal myNumber; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String myString; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Boolean myBoolean; public OuterCompositeDto myNumber(@Nullable BigDecimal myNumber) { @@ -51,7 +54,6 @@ public OuterCompositeDto myNumber(@Nullable BigDecimal myNumber) { return myNumber; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("my_number") public void setMyNumber(@Nullable BigDecimal myNumber) { this.myNumber = myNumber; @@ -72,7 +74,6 @@ public OuterCompositeDto myString(@Nullable String myString) { return myString; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("my_string") public void setMyString(@Nullable String myString) { this.myString = myString; @@ -93,7 +94,6 @@ public OuterCompositeDto myBoolean(@Nullable Boolean myBoolean) { return myBoolean; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("my_boolean") public void setMyBoolean(@Nullable Boolean myBoolean) { this.myBoolean = myBoolean; diff --git a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/ParentWithNullableDto.java b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/ParentWithNullableDto.java index 624aa64de1f3..e28ac8d9ab82 100644 --- a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/ParentWithNullableDto.java +++ b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/ParentWithNullableDto.java @@ -72,6 +72,7 @@ public static TypeEnum fromValue(String value) { } @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable TypeEnum type; private @Nullable String nullableProperty = null; @@ -91,7 +92,6 @@ public ParentWithNullableDto type(@Nullable TypeEnum type) { return type; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("type") public void setType(@Nullable TypeEnum type) { this.type = type; diff --git a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/PetDto.java b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/PetDto.java index 30524a3fe8d0..9131504ef497 100644 --- a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/PetDto.java +++ b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/PetDto.java @@ -36,16 +36,21 @@ public class PetDto { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Long id; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable CategoryDto category; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name; + @JsonInclude(JsonInclude.Include.NON_NULL) private Set photoUrls = new LinkedHashSet<>(); @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private List<@Valid TagDto> tags = new ArrayList<>(); /** @@ -86,6 +91,7 @@ public static StatusEnum fromValue(String value) { } @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) @Deprecated private @Nullable StatusEnum status; @@ -108,7 +114,6 @@ public PetDto id(@Nullable Long id) { return id; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("id") public void setId(@Nullable Long id) { this.id = id; @@ -129,7 +134,6 @@ public PetDto category(@Nullable CategoryDto category) { return category; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("category") public void setCategory(@Nullable CategoryDto category) { this.category = category; @@ -207,7 +211,6 @@ public PetDto addTagsItem(TagDto tagsItem) { return tags; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("tags") public void setTags(List<@Valid TagDto> tags) { this.tags = tags; @@ -233,7 +236,6 @@ public PetDto status(@Nullable StatusEnum status) { /** * @deprecated */ - @JsonSetter(nulls = Nulls.SKIP) @Deprecated @JsonProperty("status") public void setStatus(@Nullable StatusEnum status) { diff --git a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/ReadOnlyFirstDto.java b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/ReadOnlyFirstDto.java index d2e84b1d47e6..0038c0006934 100644 --- a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/ReadOnlyFirstDto.java +++ b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/ReadOnlyFirstDto.java @@ -27,9 +27,11 @@ public class ReadOnlyFirstDto { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String bar; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String baz; public ReadOnlyFirstDto bar(@Nullable String bar) { @@ -47,7 +49,6 @@ public ReadOnlyFirstDto bar(@Nullable String bar) { return bar; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("bar") public void setBar(@Nullable String bar) { this.bar = bar; @@ -68,7 +69,6 @@ public ReadOnlyFirstDto baz(@Nullable String baz) { return baz; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("baz") public void setBaz(@Nullable String baz) { this.baz = baz; diff --git a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNamesDto.java b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNamesDto.java index faa3512a89df..540124366238 100644 --- a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNamesDto.java +++ b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNamesDto.java @@ -27,15 +27,19 @@ public class ResponseObjectWithDifferentFieldNamesDto { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String normalPropertyName; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String UPPER_CASE_PROPERTY_SNAKE; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String lowerCasePropertyDashes; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String propertyNameWithSpaces; public ResponseObjectWithDifferentFieldNamesDto normalPropertyName(@Nullable String normalPropertyName) { @@ -53,7 +57,6 @@ public ResponseObjectWithDifferentFieldNamesDto normalPropertyName(@Nullable Str return normalPropertyName; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("normalPropertyName") public void setNormalPropertyName(@Nullable String normalPropertyName) { this.normalPropertyName = normalPropertyName; @@ -74,7 +77,6 @@ public ResponseObjectWithDifferentFieldNamesDto UPPER_CASE_PROPERTY_SNAKE(@Nulla return UPPER_CASE_PROPERTY_SNAKE; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("UPPER_CASE_PROPERTY_SNAKE") public void setUPPERCASEPROPERTYSNAKE(@Nullable String UPPER_CASE_PROPERTY_SNAKE) { this.UPPER_CASE_PROPERTY_SNAKE = UPPER_CASE_PROPERTY_SNAKE; @@ -95,7 +97,6 @@ public ResponseObjectWithDifferentFieldNamesDto lowerCasePropertyDashes(@Nullabl return lowerCasePropertyDashes; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("lower-case-property-dashes") public void setLowerCasePropertyDashes(@Nullable String lowerCasePropertyDashes) { this.lowerCasePropertyDashes = lowerCasePropertyDashes; @@ -116,7 +117,6 @@ public ResponseObjectWithDifferentFieldNamesDto propertyNameWithSpaces(@Nullable return propertyNameWithSpaces; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("property name with spaces") public void setPropertyNameWithSpaces(@Nullable String propertyNameWithSpaces) { this.propertyNameWithSpaces = propertyNameWithSpaces; diff --git a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/ReturnDto.java b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/ReturnDto.java index 9d4d479f06ab..d5cca17c65a9 100644 --- a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/ReturnDto.java +++ b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/ReturnDto.java @@ -27,6 +27,7 @@ public class ReturnDto { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Integer _return; public ReturnDto _return(@Nullable Integer _return) { @@ -44,7 +45,6 @@ public ReturnDto _return(@Nullable Integer _return) { return _return; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("return") public void setReturn(@Nullable Integer _return) { this._return = _return; diff --git a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/SpecialModelNameDto.java b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/SpecialModelNameDto.java index 46736897a1ac..bed961337881 100644 --- a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/SpecialModelNameDto.java +++ b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/SpecialModelNameDto.java @@ -27,6 +27,7 @@ public class SpecialModelNameDto { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Long $specialPropertyName; public SpecialModelNameDto $specialPropertyName(@Nullable Long $specialPropertyName) { @@ -44,7 +45,6 @@ public class SpecialModelNameDto { return $specialPropertyName; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("$special[property.name]") public void set$SpecialPropertyName(@Nullable Long $specialPropertyName) { this.$specialPropertyName = $specialPropertyName; diff --git a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/TagDto.java b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/TagDto.java index 0580a3e0b343..a3bed1aa2cab 100644 --- a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/TagDto.java +++ b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/TagDto.java @@ -27,9 +27,11 @@ public class TagDto { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Long id; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String name; public TagDto id(@Nullable Long id) { @@ -47,7 +49,6 @@ public TagDto id(@Nullable Long id) { return id; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("id") public void setId(@Nullable Long id) { this.id = id; @@ -68,7 +69,6 @@ public TagDto name(@Nullable String name) { return name; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("name") public void setName(@Nullable String name) { this.name = name; diff --git a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/TypeHolderDefaultDto.java b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/TypeHolderDefaultDto.java index e92f8c79ef5f..c0325225555f 100644 --- a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/TypeHolderDefaultDto.java +++ b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/TypeHolderDefaultDto.java @@ -2,6 +2,7 @@ import java.net.URI; import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -27,14 +28,19 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class TypeHolderDefaultDto { + @JsonInclude(JsonInclude.Include.NON_NULL) private String stringItem = "what"; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal numberItem = new BigDecimal("1.234"); + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer integerItem = -2; + @JsonInclude(JsonInclude.Include.NON_NULL) private Boolean boolItem = true; + @JsonInclude(JsonInclude.Include.NON_NULL) private List arrayItem = new ArrayList<>(Arrays.asList(0, 1, 2, 3)); public TypeHolderDefaultDto() { diff --git a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/TypeHolderExampleDto.java b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/TypeHolderExampleDto.java index 0400294f91bc..522e6a5f3520 100644 --- a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/TypeHolderExampleDto.java +++ b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/TypeHolderExampleDto.java @@ -2,6 +2,7 @@ import java.net.URI; import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -27,16 +28,22 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class TypeHolderExampleDto { + @JsonInclude(JsonInclude.Include.NON_NULL) private String stringItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal numberItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Float floatItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer integerItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Boolean boolItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private List arrayItem = new ArrayList<>(); public TypeHolderExampleDto() { diff --git a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/UserDto.java b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/UserDto.java index 815716c0500e..8f158989a646 100644 --- a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/UserDto.java +++ b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/UserDto.java @@ -27,27 +27,35 @@ public class UserDto { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Long id; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String username; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String firstName; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String lastName; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String email; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String password; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String phone; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Integer userStatus; public UserDto id(@Nullable Long id) { @@ -65,7 +73,6 @@ public UserDto id(@Nullable Long id) { return id; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("id") public void setId(@Nullable Long id) { this.id = id; @@ -86,7 +93,6 @@ public UserDto username(@Nullable String username) { return username; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("username") public void setUsername(@Nullable String username) { this.username = username; @@ -107,7 +113,6 @@ public UserDto firstName(@Nullable String firstName) { return firstName; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("firstName") public void setFirstName(@Nullable String firstName) { this.firstName = firstName; @@ -128,7 +133,6 @@ public UserDto lastName(@Nullable String lastName) { return lastName; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("lastName") public void setLastName(@Nullable String lastName) { this.lastName = lastName; @@ -149,7 +153,6 @@ public UserDto email(@Nullable String email) { return email; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("email") public void setEmail(@Nullable String email) { this.email = email; @@ -170,7 +173,6 @@ public UserDto password(@Nullable String password) { return password; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("password") public void setPassword(@Nullable String password) { this.password = password; @@ -191,7 +193,6 @@ public UserDto phone(@Nullable String phone) { return phone; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("phone") public void setPhone(@Nullable String phone) { this.phone = phone; @@ -212,7 +213,6 @@ public UserDto userStatus(@Nullable Integer userStatus) { return userStatus; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("userStatus") public void setUserStatus(@Nullable Integer userStatus) { this.userStatus = userStatus; diff --git a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/XmlItemDto.java b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/XmlItemDto.java index d018521c12a3..4f0e84c89802 100644 --- a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/XmlItemDto.java +++ b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/XmlItemDto.java @@ -31,90 +31,119 @@ public class XmlItemDto { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String attributeString; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable BigDecimal attributeNumber; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Integer attributeInteger; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Boolean attributeBoolean; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private List wrappedArray = new ArrayList<>(); @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String nameString; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable BigDecimal nameNumber; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Integer nameInteger; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Boolean nameBoolean; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private List nameArray = new ArrayList<>(); @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private List nameWrappedArray = new ArrayList<>(); @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String prefixString; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable BigDecimal prefixNumber; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Integer prefixInteger; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Boolean prefixBoolean; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private List prefixArray = new ArrayList<>(); @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private List prefixWrappedArray = new ArrayList<>(); @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String namespaceString; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable BigDecimal namespaceNumber; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Integer namespaceInteger; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Boolean namespaceBoolean; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private List namespaceArray = new ArrayList<>(); @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private List namespaceWrappedArray = new ArrayList<>(); @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String prefixNsString; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable BigDecimal prefixNsNumber; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Integer prefixNsInteger; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Boolean prefixNsBoolean; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private List prefixNsArray = new ArrayList<>(); @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private List prefixNsWrappedArray = new ArrayList<>(); public XmlItemDto attributeString(@Nullable String attributeString) { @@ -132,7 +161,6 @@ public XmlItemDto attributeString(@Nullable String attributeString) { return attributeString; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("attribute_string") public void setAttributeString(@Nullable String attributeString) { this.attributeString = attributeString; @@ -153,7 +181,6 @@ public XmlItemDto attributeNumber(@Nullable BigDecimal attributeNumber) { return attributeNumber; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("attribute_number") public void setAttributeNumber(@Nullable BigDecimal attributeNumber) { this.attributeNumber = attributeNumber; @@ -174,7 +201,6 @@ public XmlItemDto attributeInteger(@Nullable Integer attributeInteger) { return attributeInteger; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("attribute_integer") public void setAttributeInteger(@Nullable Integer attributeInteger) { this.attributeInteger = attributeInteger; @@ -195,7 +221,6 @@ public XmlItemDto attributeBoolean(@Nullable Boolean attributeBoolean) { return attributeBoolean; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("attribute_boolean") public void setAttributeBoolean(@Nullable Boolean attributeBoolean) { this.attributeBoolean = attributeBoolean; @@ -224,7 +249,6 @@ public List getWrappedArray() { return wrappedArray; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("wrapped_array") public void setWrappedArray(List wrappedArray) { this.wrappedArray = wrappedArray; @@ -245,7 +269,6 @@ public XmlItemDto nameString(@Nullable String nameString) { return nameString; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("name_string") public void setNameString(@Nullable String nameString) { this.nameString = nameString; @@ -266,7 +289,6 @@ public XmlItemDto nameNumber(@Nullable BigDecimal nameNumber) { return nameNumber; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("name_number") public void setNameNumber(@Nullable BigDecimal nameNumber) { this.nameNumber = nameNumber; @@ -287,7 +309,6 @@ public XmlItemDto nameInteger(@Nullable Integer nameInteger) { return nameInteger; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("name_integer") public void setNameInteger(@Nullable Integer nameInteger) { this.nameInteger = nameInteger; @@ -308,7 +329,6 @@ public XmlItemDto nameBoolean(@Nullable Boolean nameBoolean) { return nameBoolean; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("name_boolean") public void setNameBoolean(@Nullable Boolean nameBoolean) { this.nameBoolean = nameBoolean; @@ -337,7 +357,6 @@ public List getNameArray() { return nameArray; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("name_array") public void setNameArray(List nameArray) { this.nameArray = nameArray; @@ -366,7 +385,6 @@ public List getNameWrappedArray() { return nameWrappedArray; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("name_wrapped_array") public void setNameWrappedArray(List nameWrappedArray) { this.nameWrappedArray = nameWrappedArray; @@ -387,7 +405,6 @@ public XmlItemDto prefixString(@Nullable String prefixString) { return prefixString; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("prefix_string") public void setPrefixString(@Nullable String prefixString) { this.prefixString = prefixString; @@ -408,7 +425,6 @@ public XmlItemDto prefixNumber(@Nullable BigDecimal prefixNumber) { return prefixNumber; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("prefix_number") public void setPrefixNumber(@Nullable BigDecimal prefixNumber) { this.prefixNumber = prefixNumber; @@ -429,7 +445,6 @@ public XmlItemDto prefixInteger(@Nullable Integer prefixInteger) { return prefixInteger; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("prefix_integer") public void setPrefixInteger(@Nullable Integer prefixInteger) { this.prefixInteger = prefixInteger; @@ -450,7 +465,6 @@ public XmlItemDto prefixBoolean(@Nullable Boolean prefixBoolean) { return prefixBoolean; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("prefix_boolean") public void setPrefixBoolean(@Nullable Boolean prefixBoolean) { this.prefixBoolean = prefixBoolean; @@ -479,7 +493,6 @@ public List getPrefixArray() { return prefixArray; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("prefix_array") public void setPrefixArray(List prefixArray) { this.prefixArray = prefixArray; @@ -508,7 +521,6 @@ public List getPrefixWrappedArray() { return prefixWrappedArray; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("prefix_wrapped_array") public void setPrefixWrappedArray(List prefixWrappedArray) { this.prefixWrappedArray = prefixWrappedArray; @@ -529,7 +541,6 @@ public XmlItemDto namespaceString(@Nullable String namespaceString) { return namespaceString; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("namespace_string") public void setNamespaceString(@Nullable String namespaceString) { this.namespaceString = namespaceString; @@ -550,7 +561,6 @@ public XmlItemDto namespaceNumber(@Nullable BigDecimal namespaceNumber) { return namespaceNumber; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("namespace_number") public void setNamespaceNumber(@Nullable BigDecimal namespaceNumber) { this.namespaceNumber = namespaceNumber; @@ -571,7 +581,6 @@ public XmlItemDto namespaceInteger(@Nullable Integer namespaceInteger) { return namespaceInteger; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("namespace_integer") public void setNamespaceInteger(@Nullable Integer namespaceInteger) { this.namespaceInteger = namespaceInteger; @@ -592,7 +601,6 @@ public XmlItemDto namespaceBoolean(@Nullable Boolean namespaceBoolean) { return namespaceBoolean; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("namespace_boolean") public void setNamespaceBoolean(@Nullable Boolean namespaceBoolean) { this.namespaceBoolean = namespaceBoolean; @@ -621,7 +629,6 @@ public List getNamespaceArray() { return namespaceArray; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("namespace_array") public void setNamespaceArray(List namespaceArray) { this.namespaceArray = namespaceArray; @@ -650,7 +657,6 @@ public List getNamespaceWrappedArray() { return namespaceWrappedArray; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("namespace_wrapped_array") public void setNamespaceWrappedArray(List namespaceWrappedArray) { this.namespaceWrappedArray = namespaceWrappedArray; @@ -671,7 +677,6 @@ public XmlItemDto prefixNsString(@Nullable String prefixNsString) { return prefixNsString; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("prefix_ns_string") public void setPrefixNsString(@Nullable String prefixNsString) { this.prefixNsString = prefixNsString; @@ -692,7 +697,6 @@ public XmlItemDto prefixNsNumber(@Nullable BigDecimal prefixNsNumber) { return prefixNsNumber; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("prefix_ns_number") public void setPrefixNsNumber(@Nullable BigDecimal prefixNsNumber) { this.prefixNsNumber = prefixNsNumber; @@ -713,7 +717,6 @@ public XmlItemDto prefixNsInteger(@Nullable Integer prefixNsInteger) { return prefixNsInteger; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("prefix_ns_integer") public void setPrefixNsInteger(@Nullable Integer prefixNsInteger) { this.prefixNsInteger = prefixNsInteger; @@ -734,7 +737,6 @@ public XmlItemDto prefixNsBoolean(@Nullable Boolean prefixNsBoolean) { return prefixNsBoolean; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("prefix_ns_boolean") public void setPrefixNsBoolean(@Nullable Boolean prefixNsBoolean) { this.prefixNsBoolean = prefixNsBoolean; @@ -763,7 +765,6 @@ public List getPrefixNsArray() { return prefixNsArray; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("prefix_ns_array") public void setPrefixNsArray(List prefixNsArray) { this.prefixNsArray = prefixNsArray; @@ -792,7 +793,6 @@ public List getPrefixNsWrappedArray() { return prefixNsWrappedArray; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("prefix_ns_wrapped_array") public void setPrefixNsWrappedArray(List prefixNsWrappedArray) { this.prefixNsWrappedArray = prefixNsWrappedArray; diff --git a/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index 5daca86cbb74..a3e051349288 100644 --- a/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -57,7 +57,6 @@ public class AdditionalPropertiesClass { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Object anytype1; - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable anytype2 = JsonNullable.undefined(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/model/Animal.java b/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/model/Animal.java index 2e8e804a79d3..e4e0790b3e92 100644 --- a/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/model/Animal.java +++ b/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/model/Animal.java @@ -37,6 +37,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class Animal { + @JsonInclude(JsonInclude.Include.NON_NULL) private String className; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/model/Category.java b/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/model/Category.java index 08c3a1d9091a..3455dcf8b80b 100644 --- a/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/model/Category.java +++ b/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/model/Category.java @@ -26,6 +26,7 @@ public class Category { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Long id; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name = "default-name"; public Category() { diff --git a/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/model/ContainerDefaultValue.java b/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/model/ContainerDefaultValue.java index 09216052292e..219aeb0cd0ed 100644 --- a/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/model/ContainerDefaultValue.java +++ b/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/model/ContainerDefaultValue.java @@ -28,14 +28,14 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class ContainerDefaultValue { - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> nullableArray = JsonNullable.>undefined(); + @JsonInclude(JsonInclude.Include.ALWAYS) private JsonNullable> nullableRequiredArray = JsonNullable.>undefined(); + @JsonInclude(JsonInclude.Include.NON_NULL) private List requiredArray = new ArrayList<>(); - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> nullableArrayWithDefault = JsonNullable.>undefined(); public ContainerDefaultValue() { diff --git a/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/model/EnumTest.java b/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/model/EnumTest.java index bab57721b404..671101c3ca77 100644 --- a/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/model/EnumTest.java @@ -104,6 +104,7 @@ public static EnumStringRequiredEnum fromValue(String value) { } } + @JsonInclude(JsonInclude.Include.NON_NULL) private EnumStringRequiredEnum enumStringRequired; /** diff --git a/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/model/FormatTest.java b/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/model/FormatTest.java index 6c85cd100777..17566a89eeda 100644 --- a/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/model/FormatTest.java @@ -40,6 +40,7 @@ public class FormatTest { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Long int64; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal number; @JsonInclude(JsonInclude.Include.NON_NULL) @@ -51,11 +52,13 @@ public class FormatTest { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable String string; + @JsonInclude(JsonInclude.Include.NON_NULL) private byte[] _byte; @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable org.springframework.core.io.Resource binary; + @JsonInclude(JsonInclude.Include.NON_NULL) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) private LocalDate date; @@ -66,6 +69,7 @@ public class FormatTest { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable UUID uuid; + @JsonInclude(JsonInclude.Include.NON_NULL) private String password; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/model/Name.java b/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/model/Name.java index 9b15554afbc6..aa4b273b332e 100644 --- a/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/model/Name.java +++ b/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/model/Name.java @@ -23,6 +23,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class Name { + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer name; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/model/NullableMapProperty.java b/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/model/NullableMapProperty.java index d606c62a8fcf..c25a2eaa55bf 100644 --- a/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/model/NullableMapProperty.java +++ b/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/model/NullableMapProperty.java @@ -2,7 +2,6 @@ import java.net.URI; import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Arrays; @@ -28,7 +27,6 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class NullableMapProperty { - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> languageValues = JsonNullable.>undefined(); public NullableMapProperty languageValues(Map languageValues) { diff --git a/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/model/ParentWithNullable.java b/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/model/ParentWithNullable.java index d6a067cca4e5..fde0586fa40c 100644 --- a/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/model/ParentWithNullable.java +++ b/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/model/ParentWithNullable.java @@ -75,7 +75,6 @@ public static TypeEnum fromValue(String value) { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable TypeEnum type; - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable nullableProperty = JsonNullable.undefined(); public ParentWithNullable type(@Nullable TypeEnum type) { diff --git a/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/model/Pet.java b/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/model/Pet.java index f4272d0f6c80..a879f5ebd770 100644 --- a/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/model/Pet.java +++ b/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/model/Pet.java @@ -38,8 +38,10 @@ public class Pet { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Category category; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name; + @JsonInclude(JsonInclude.Include.NON_NULL) private Set photoUrls = new LinkedHashSet<>(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/model/TypeHolderDefault.java index a3fc75dcc4f8..ac5a2fd1272b 100644 --- a/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -2,6 +2,7 @@ import java.net.URI; import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.math.BigDecimal; @@ -26,14 +27,19 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class TypeHolderDefault { + @JsonInclude(JsonInclude.Include.NON_NULL) private String stringItem = "what"; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal numberItem = new BigDecimal("1.234"); + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer integerItem = -2; + @JsonInclude(JsonInclude.Include.NON_NULL) private Boolean boolItem = true; + @JsonInclude(JsonInclude.Include.NON_NULL) private List arrayItem = new ArrayList<>(Arrays.asList(0, 1, 2, 3)); public TypeHolderDefault() { diff --git a/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/model/TypeHolderExample.java index 4171f01f6aed..faf1e1ff30ef 100644 --- a/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -2,6 +2,7 @@ import java.net.URI; import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.math.BigDecimal; @@ -26,16 +27,22 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class TypeHolderExample { + @JsonInclude(JsonInclude.Include.NON_NULL) private String stringItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal numberItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Float floatItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer integerItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Boolean boolItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private List arrayItem = new ArrayList<>(); public TypeHolderExample() { diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/AdditionalPropertiesClassDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/AdditionalPropertiesClassDto.java index b893bb4ec7c6..613b36dd183c 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/AdditionalPropertiesClassDto.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/AdditionalPropertiesClassDto.java @@ -57,7 +57,6 @@ public class AdditionalPropertiesClassDto { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Object anytype1; - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable anytype2 = JsonNullable.undefined(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/AnimalDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/AnimalDto.java index e301cd61dba3..67474f01ec05 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/AnimalDto.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/AnimalDto.java @@ -36,6 +36,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class AnimalDto { + @JsonInclude(JsonInclude.Include.NON_NULL) private String className; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/CategoryDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/CategoryDto.java index 5c51fa54cc0a..ca80887aed58 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/CategoryDto.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/CategoryDto.java @@ -26,6 +26,7 @@ public class CategoryDto { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Long id; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name = "default-name"; public CategoryDto() { diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/ContainerDefaultValueDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/ContainerDefaultValueDto.java index af2b07f95d73..fe0be24e229d 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/ContainerDefaultValueDto.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/ContainerDefaultValueDto.java @@ -28,14 +28,14 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class ContainerDefaultValueDto { - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> nullableArray = JsonNullable.>undefined(); + @JsonInclude(JsonInclude.Include.ALWAYS) private JsonNullable> nullableRequiredArray = JsonNullable.>undefined(); + @JsonInclude(JsonInclude.Include.NON_NULL) private List requiredArray = new ArrayList<>(); - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> nullableArrayWithDefault = JsonNullable.>undefined(); public ContainerDefaultValueDto() { diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/EnumTestDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/EnumTestDto.java index 5263a4e2bc96..5069a1a9acbb 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/EnumTestDto.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/EnumTestDto.java @@ -102,6 +102,7 @@ public static EnumStringRequiredEnum fromValue(String value) { } } + @JsonInclude(JsonInclude.Include.NON_NULL) private EnumStringRequiredEnum enumStringRequired; /** diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/FormatTestDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/FormatTestDto.java index 18101da678fa..c68a2728bcb1 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/FormatTestDto.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/FormatTestDto.java @@ -38,6 +38,7 @@ public class FormatTestDto { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Long int64; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal number; @JsonInclude(JsonInclude.Include.NON_NULL) @@ -49,11 +50,13 @@ public class FormatTestDto { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable String string; + @JsonInclude(JsonInclude.Include.NON_NULL) private byte[] _byte; @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable org.springframework.core.io.Resource binary; + @JsonInclude(JsonInclude.Include.NON_NULL) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) private LocalDate date; @@ -64,6 +67,7 @@ public class FormatTestDto { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable UUID uuid; + @JsonInclude(JsonInclude.Include.NON_NULL) private String password; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/NameDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/NameDto.java index 0d4be7ac8140..b6b48d488ede 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/NameDto.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/NameDto.java @@ -23,6 +23,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class NameDto { + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer name; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/NullableMapPropertyDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/NullableMapPropertyDto.java index f93832a65c98..d9edf72050f1 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/NullableMapPropertyDto.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/NullableMapPropertyDto.java @@ -2,7 +2,6 @@ import java.net.URI; import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -28,7 +27,6 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class NullableMapPropertyDto { - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> languageValues = JsonNullable.>undefined(); public NullableMapPropertyDto languageValues(Map languageValues) { diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/ParentWithNullableDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/ParentWithNullableDto.java index 2300afd143a4..af08c71fb48f 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/ParentWithNullableDto.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/ParentWithNullableDto.java @@ -74,7 +74,6 @@ public static TypeEnum fromValue(String value) { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable TypeEnum type; - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable nullableProperty = JsonNullable.undefined(); public ParentWithNullableDto type(@Nullable TypeEnum type) { diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/PetDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/PetDto.java index 0ce2b93a2b0f..791eea25f843 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/PetDto.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/PetDto.java @@ -38,8 +38,10 @@ public class PetDto { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable CategoryDto category; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name; + @JsonInclude(JsonInclude.Include.NON_NULL) private Set photoUrls = new LinkedHashSet<>(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/TypeHolderDefaultDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/TypeHolderDefaultDto.java index 987983e43451..8ca218f8c704 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/TypeHolderDefaultDto.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/TypeHolderDefaultDto.java @@ -2,6 +2,7 @@ import java.net.URI; import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -26,14 +27,19 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class TypeHolderDefaultDto { + @JsonInclude(JsonInclude.Include.NON_NULL) private String stringItem = "what"; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal numberItem = new BigDecimal("1.234"); + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer integerItem = -2; + @JsonInclude(JsonInclude.Include.NON_NULL) private Boolean boolItem = true; + @JsonInclude(JsonInclude.Include.NON_NULL) private List arrayItem = new ArrayList<>(Arrays.asList(0, 1, 2, 3)); public TypeHolderDefaultDto() { diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/TypeHolderExampleDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/TypeHolderExampleDto.java index 4db40f3db382..eea548352cc7 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/TypeHolderExampleDto.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/TypeHolderExampleDto.java @@ -2,6 +2,7 @@ import java.net.URI; import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -26,16 +27,22 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class TypeHolderExampleDto { + @JsonInclude(JsonInclude.Include.NON_NULL) private String stringItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal numberItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Float floatItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer integerItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Boolean boolItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private List arrayItem = new ArrayList<>(); public TypeHolderExampleDto() { diff --git a/samples/openapi3/client/petstore/spring-cloud-3-with-optional/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/client/petstore/spring-cloud-3-with-optional/src/main/java/org/openapitools/model/Pet.java index 819444909ebb..590fef4efc14 100644 --- a/samples/openapi3/client/petstore/spring-cloud-3-with-optional/src/main/java/org/openapitools/model/Pet.java +++ b/samples/openapi3/client/petstore/spring-cloud-3-with-optional/src/main/java/org/openapitools/model/Pet.java @@ -34,8 +34,10 @@ public class Pet { @JsonInclude(JsonInclude.Include.NON_NULL) private Optional category = Optional.empty(); + @JsonInclude(JsonInclude.Include.NON_NULL) private String name; + @JsonInclude(JsonInclude.Include.NON_NULL) private List photoUrls = new ArrayList<>(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/openapi3/client/petstore/spring-cloud-3/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/client/petstore/spring-cloud-3/src/main/java/org/openapitools/model/Pet.java index 37d29c32b8da..c16ac8affc4e 100644 --- a/samples/openapi3/client/petstore/spring-cloud-3/src/main/java/org/openapitools/model/Pet.java +++ b/samples/openapi3/client/petstore/spring-cloud-3/src/main/java/org/openapitools/model/Pet.java @@ -36,8 +36,10 @@ public class Pet { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Category category; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name; + @JsonInclude(JsonInclude.Include.NON_NULL) private List photoUrls = new ArrayList<>(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/openapi3/client/petstore/spring-cloud-4-with-optional/src/main/java/org/openapitools/model/Category.java b/samples/openapi3/client/petstore/spring-cloud-4-with-optional/src/main/java/org/openapitools/model/Category.java index 379ef08836f8..4928b88af0da 100644 --- a/samples/openapi3/client/petstore/spring-cloud-4-with-optional/src/main/java/org/openapitools/model/Category.java +++ b/samples/openapi3/client/petstore/spring-cloud-4-with-optional/src/main/java/org/openapitools/model/Category.java @@ -24,9 +24,11 @@ public class Category { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private Long id; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private String name; public Category id(Long id) { @@ -44,7 +46,6 @@ public Long getId() { return id; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("id") public void setId(Long id) { this.id = id; @@ -65,7 +66,6 @@ public String getName() { return name; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("name") public void setName(String name) { this.name = name; diff --git a/samples/openapi3/client/petstore/spring-cloud-4-with-optional/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/openapi3/client/petstore/spring-cloud-4-with-optional/src/main/java/org/openapitools/model/ModelApiResponse.java index 1822b26b00b8..55b4059d5d90 100644 --- a/samples/openapi3/client/petstore/spring-cloud-4-with-optional/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/openapi3/client/petstore/spring-cloud-4-with-optional/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -26,12 +26,15 @@ public class ModelApiResponse { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private Integer code; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private String type; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private String message; public ModelApiResponse code(Integer code) { @@ -49,7 +52,6 @@ public Integer getCode() { return code; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("code") public void setCode(Integer code) { this.code = code; @@ -70,7 +72,6 @@ public String getType() { return type; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("type") public void setType(String type) { this.type = type; @@ -91,7 +92,6 @@ public String getMessage() { return message; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("message") public void setMessage(String message) { this.message = message; diff --git a/samples/openapi3/client/petstore/spring-cloud-4-with-optional/src/main/java/org/openapitools/model/Order.java b/samples/openapi3/client/petstore/spring-cloud-4-with-optional/src/main/java/org/openapitools/model/Order.java index cd1bb401520a..717aa283298e 100644 --- a/samples/openapi3/client/petstore/spring-cloud-4-with-optional/src/main/java/org/openapitools/model/Order.java +++ b/samples/openapi3/client/petstore/spring-cloud-4-with-optional/src/main/java/org/openapitools/model/Order.java @@ -27,15 +27,19 @@ public class Order { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private Long id; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private Long petId; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private Integer quantity; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime shipDate; @@ -77,9 +81,11 @@ public static StatusEnum fromValue(String value) { } @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private StatusEnum status; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private Boolean complete = false; public Order id(Long id) { @@ -97,7 +103,6 @@ public Long getId() { return id; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("id") public void setId(Long id) { this.id = id; @@ -118,7 +123,6 @@ public Long getPetId() { return petId; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("petId") public void setPetId(Long petId) { this.petId = petId; @@ -139,7 +143,6 @@ public Integer getQuantity() { return quantity; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("quantity") public void setQuantity(Integer quantity) { this.quantity = quantity; @@ -160,7 +163,6 @@ public OffsetDateTime getShipDate() { return shipDate; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("shipDate") public void setShipDate(OffsetDateTime shipDate) { this.shipDate = shipDate; @@ -181,7 +183,6 @@ public StatusEnum getStatus() { return status; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("status") public void setStatus(StatusEnum status) { this.status = status; @@ -202,7 +203,6 @@ public Boolean getComplete() { return complete; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("complete") public void setComplete(Boolean complete) { this.complete = complete; diff --git a/samples/openapi3/client/petstore/spring-cloud-4-with-optional/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/client/petstore/spring-cloud-4-with-optional/src/main/java/org/openapitools/model/Pet.java index e7ed1e26b8fa..f1c2b29bb129 100644 --- a/samples/openapi3/client/petstore/spring-cloud-4-with-optional/src/main/java/org/openapitools/model/Pet.java +++ b/samples/openapi3/client/petstore/spring-cloud-4-with-optional/src/main/java/org/openapitools/model/Pet.java @@ -30,16 +30,21 @@ public class Pet { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private Long id; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private Category category; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name; + @JsonInclude(JsonInclude.Include.NON_NULL) private List photoUrls = new ArrayList<>(); @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private List<@Valid Tag> tags = new ArrayList<>(); /** @@ -80,6 +85,7 @@ public static StatusEnum fromValue(String value) { } @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) @Deprecated private StatusEnum status; @@ -110,7 +116,6 @@ public Long getId() { return id; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("id") public void setId(Long id) { this.id = id; @@ -131,7 +136,6 @@ public Category getCategory() { return category; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("category") public void setCategory(Category category) { this.category = category; @@ -208,7 +212,6 @@ public Pet addTagsItem(Tag tagsItem) { return tags; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("tags") public void setTags(List<@Valid Tag> tags) { this.tags = tags; @@ -234,7 +237,6 @@ public StatusEnum getStatus() { /** * @deprecated */ - @JsonSetter(nulls = Nulls.SKIP) @Deprecated @JsonProperty("status") public void setStatus(StatusEnum status) { diff --git a/samples/openapi3/client/petstore/spring-cloud-4-with-optional/src/main/java/org/openapitools/model/Tag.java b/samples/openapi3/client/petstore/spring-cloud-4-with-optional/src/main/java/org/openapitools/model/Tag.java index 3a5389dc75b8..cf54ccead568 100644 --- a/samples/openapi3/client/petstore/spring-cloud-4-with-optional/src/main/java/org/openapitools/model/Tag.java +++ b/samples/openapi3/client/petstore/spring-cloud-4-with-optional/src/main/java/org/openapitools/model/Tag.java @@ -24,9 +24,11 @@ public class Tag { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private Long id; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private String name; public Tag id(Long id) { @@ -44,7 +46,6 @@ public Long getId() { return id; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("id") public void setId(Long id) { this.id = id; @@ -65,7 +66,6 @@ public String getName() { return name; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("name") public void setName(String name) { this.name = name; diff --git a/samples/openapi3/client/petstore/spring-cloud-4-with-optional/src/main/java/org/openapitools/model/User.java b/samples/openapi3/client/petstore/spring-cloud-4-with-optional/src/main/java/org/openapitools/model/User.java index d7384260b257..b98a0b4dd692 100644 --- a/samples/openapi3/client/petstore/spring-cloud-4-with-optional/src/main/java/org/openapitools/model/User.java +++ b/samples/openapi3/client/petstore/spring-cloud-4-with-optional/src/main/java/org/openapitools/model/User.java @@ -24,27 +24,35 @@ public class User { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private Long id; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private String username; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private String firstName; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private String lastName; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private String email; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private String password; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private String phone; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private Integer userStatus; public User id(Long id) { @@ -62,7 +70,6 @@ public Long getId() { return id; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("id") public void setId(Long id) { this.id = id; @@ -83,7 +90,6 @@ public String getUsername() { return username; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("username") public void setUsername(String username) { this.username = username; @@ -104,7 +110,6 @@ public String getFirstName() { return firstName; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("firstName") public void setFirstName(String firstName) { this.firstName = firstName; @@ -125,7 +130,6 @@ public String getLastName() { return lastName; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("lastName") public void setLastName(String lastName) { this.lastName = lastName; @@ -146,7 +150,6 @@ public String getEmail() { return email; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("email") public void setEmail(String email) { this.email = email; @@ -167,7 +170,6 @@ public String getPassword() { return password; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("password") public void setPassword(String password) { this.password = password; @@ -188,7 +190,6 @@ public String getPhone() { return phone; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("phone") public void setPhone(String phone) { this.phone = phone; @@ -209,7 +210,6 @@ public Integer getUserStatus() { return userStatus; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("userStatus") public void setUserStatus(Integer userStatus) { this.userStatus = userStatus; diff --git a/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Pet.java index 37d29c32b8da..c16ac8affc4e 100644 --- a/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Pet.java +++ b/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Pet.java @@ -36,8 +36,10 @@ public class Pet { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Category category; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name; + @JsonInclude(JsonInclude.Include.NON_NULL) private List photoUrls = new ArrayList<>(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/openapi3/client/petstore/spring-cloud-date-time/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/client/petstore/spring-cloud-date-time/src/main/java/org/openapitools/model/Pet.java index 4aa4e0f36117..83c89d9c9800 100644 --- a/samples/openapi3/client/petstore/spring-cloud-date-time/src/main/java/org/openapitools/model/Pet.java +++ b/samples/openapi3/client/petstore/spring-cloud-date-time/src/main/java/org/openapitools/model/Pet.java @@ -29,6 +29,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class Pet { + @JsonInclude(JsonInclude.Include.NON_NULL) private String atType = "Pet"; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/openapi3/client/petstore/spring-cloud-http-basic/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/client/petstore/spring-cloud-http-basic/src/main/java/org/openapitools/model/Pet.java index 37d29c32b8da..c16ac8affc4e 100644 --- a/samples/openapi3/client/petstore/spring-cloud-http-basic/src/main/java/org/openapitools/model/Pet.java +++ b/samples/openapi3/client/petstore/spring-cloud-http-basic/src/main/java/org/openapitools/model/Pet.java @@ -36,8 +36,10 @@ public class Pet { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Category category; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name; + @JsonInclude(JsonInclude.Include.NON_NULL) private List photoUrls = new ArrayList<>(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index 4798bc0c028d..fc4f770ac1d9 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -57,7 +57,6 @@ public class AdditionalPropertiesClass { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Object anytype1; - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable anytype2 = JsonNullable.undefined(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Animal.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Animal.java index d5f2df7bca2b..56776316e18b 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Animal.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Animal.java @@ -37,6 +37,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class Animal { + @JsonInclude(JsonInclude.Include.NON_NULL) private String className; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Category.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Category.java index 212def45ba53..cf8d702378be 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Category.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Category.java @@ -26,6 +26,7 @@ public class Category { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Long id; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name = "default-name"; public Category() { diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ContainerDefaultValue.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ContainerDefaultValue.java index 9fcdefe1da2e..5e934e643224 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ContainerDefaultValue.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ContainerDefaultValue.java @@ -28,14 +28,14 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class ContainerDefaultValue { - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> nullableArray = JsonNullable.>undefined(); + @JsonInclude(JsonInclude.Include.ALWAYS) private JsonNullable> nullableRequiredArray = JsonNullable.>undefined(); + @JsonInclude(JsonInclude.Include.NON_NULL) private List requiredArray = new ArrayList<>(); - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> nullableArrayWithDefault = JsonNullable.>undefined(); public ContainerDefaultValue() { diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/EnumTest.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/EnumTest.java index aeb76fdcd3b2..65e0ceefa324 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/EnumTest.java @@ -104,6 +104,7 @@ public static EnumStringRequiredEnum fromValue(String value) { } } + @JsonInclude(JsonInclude.Include.NON_NULL) private EnumStringRequiredEnum enumStringRequired; /** diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/FormatTest.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/FormatTest.java index 526aa66a1882..3f9be180fd12 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/FormatTest.java @@ -40,6 +40,7 @@ public class FormatTest { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Long int64; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal number; @JsonInclude(JsonInclude.Include.NON_NULL) @@ -51,11 +52,13 @@ public class FormatTest { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable String string; + @JsonInclude(JsonInclude.Include.NON_NULL) private byte[] _byte; @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable org.springframework.core.io.Resource binary; + @JsonInclude(JsonInclude.Include.NON_NULL) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) private LocalDate date; @@ -66,6 +69,7 @@ public class FormatTest { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable UUID uuid; + @JsonInclude(JsonInclude.Include.NON_NULL) private String password; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Name.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Name.java index 87c1af437ed4..ad228020783e 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Name.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Name.java @@ -24,6 +24,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class Name { + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer name; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/NullableMapProperty.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/NullableMapProperty.java index 7330185d2021..31127013b739 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/NullableMapProperty.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/NullableMapProperty.java @@ -2,7 +2,6 @@ import java.net.URI; import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Arrays; @@ -28,7 +27,6 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class NullableMapProperty { - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> languageValues = JsonNullable.>undefined(); public NullableMapProperty languageValues(Map languageValues) { diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ParentWithNullable.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ParentWithNullable.java index d095e6659db9..d394b3e38431 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ParentWithNullable.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ParentWithNullable.java @@ -75,7 +75,6 @@ public static TypeEnum fromValue(String value) { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable TypeEnum type; - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable nullableProperty = JsonNullable.undefined(); public ParentWithNullable type(@Nullable TypeEnum type) { diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Pet.java index ab6a00effad0..2905cdf83cf0 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Pet.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Pet.java @@ -38,8 +38,10 @@ public class Pet { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Category category; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name; + @JsonInclude(JsonInclude.Include.NON_NULL) private Set photoUrls = new LinkedHashSet<>(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/TypeHolderDefault.java index 56da244f404e..8eb2ebe70171 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -2,6 +2,7 @@ import java.net.URI; import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.math.BigDecimal; @@ -26,14 +27,19 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class TypeHolderDefault { + @JsonInclude(JsonInclude.Include.NON_NULL) private String stringItem = "what"; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal numberItem = new BigDecimal("1.234"); + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer integerItem = -2; + @JsonInclude(JsonInclude.Include.NON_NULL) private Boolean boolItem = true; + @JsonInclude(JsonInclude.Include.NON_NULL) private List arrayItem = new ArrayList<>(Arrays.asList(0, 1, 2, 3)); public TypeHolderDefault() { diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/TypeHolderExample.java index 2796a8f8c4ec..7547cfb95047 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -2,6 +2,7 @@ import java.net.URI; import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.math.BigDecimal; @@ -26,16 +27,22 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class TypeHolderExample { + @JsonInclude(JsonInclude.Include.NON_NULL) private String stringItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal numberItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Float floatItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer integerItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Boolean boolItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private List arrayItem = new ArrayList<>(); public TypeHolderExample() { diff --git a/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/Pet.java index f655d26b20a7..141ad532407c 100644 --- a/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/Pet.java +++ b/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/Pet.java @@ -36,8 +36,10 @@ public class Pet { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Category category; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name; + @JsonInclude(JsonInclude.Include.NON_NULL) private List photoUrls = new ArrayList<>(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Pet.java index 37d29c32b8da..c16ac8affc4e 100644 --- a/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Pet.java +++ b/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Pet.java @@ -36,8 +36,10 @@ public class Pet { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Category category; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name; + @JsonInclude(JsonInclude.Include.NON_NULL) private List photoUrls = new ArrayList<>(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/model/Pet.java index 37d29c32b8da..c16ac8affc4e 100644 --- a/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/model/Pet.java +++ b/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/model/Pet.java @@ -36,8 +36,10 @@ public class Pet { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Category category; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name; + @JsonInclude(JsonInclude.Include.NON_NULL) private List photoUrls = new ArrayList<>(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/model/Pet.java index 37d29c32b8da..c16ac8affc4e 100644 --- a/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/model/Pet.java +++ b/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/model/Pet.java @@ -36,8 +36,10 @@ public class Pet { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Category category; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name; + @JsonInclude(JsonInclude.Include.NON_NULL) private List photoUrls = new ArrayList<>(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/openapi3/server/petstore/spring-boot-oneof-interface/src/main/java/org/openapitools/model/Apple.java b/samples/openapi3/server/petstore/spring-boot-oneof-interface/src/main/java/org/openapitools/model/Apple.java index 3ea2af2720cd..0f2566549e46 100644 --- a/samples/openapi3/server/petstore/spring-boot-oneof-interface/src/main/java/org/openapitools/model/Apple.java +++ b/samples/openapi3/server/petstore/spring-boot-oneof-interface/src/main/java/org/openapitools/model/Apple.java @@ -2,6 +2,7 @@ import java.net.URI; import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import org.springframework.lang.Nullable; @@ -26,8 +27,10 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class Apple implements Fruit { + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer seeds; + @JsonInclude(JsonInclude.Include.NON_NULL) private FruitType fruitType; public Apple() { diff --git a/samples/openapi3/server/petstore/spring-boot-oneof-interface/src/main/java/org/openapitools/model/Banana.java b/samples/openapi3/server/petstore/spring-boot-oneof-interface/src/main/java/org/openapitools/model/Banana.java index 8b42e4bccec3..d6f893866d1e 100644 --- a/samples/openapi3/server/petstore/spring-boot-oneof-interface/src/main/java/org/openapitools/model/Banana.java +++ b/samples/openapi3/server/petstore/spring-boot-oneof-interface/src/main/java/org/openapitools/model/Banana.java @@ -2,6 +2,7 @@ import java.net.URI; import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import org.springframework.lang.Nullable; @@ -26,8 +27,10 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class Banana implements Fruit { + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer length; + @JsonInclude(JsonInclude.Include.NON_NULL) private FruitType fruitType; public Banana() { diff --git a/samples/openapi3/server/petstore/spring-boot-oneof-interface/src/main/java/org/openapitools/model/Bar.java b/samples/openapi3/server/petstore/spring-boot-oneof-interface/src/main/java/org/openapitools/model/Bar.java index 93a0bdb89f2a..183cf2f6e604 100644 --- a/samples/openapi3/server/petstore/spring-boot-oneof-interface/src/main/java/org/openapitools/model/Bar.java +++ b/samples/openapi3/server/petstore/spring-boot-oneof-interface/src/main/java/org/openapitools/model/Bar.java @@ -29,6 +29,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class Bar extends Entity implements BarRefOrValue { + @JsonInclude(JsonInclude.Include.NON_NULL) private String id; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/openapi3/server/petstore/spring-boot-oneof-interface/src/main/java/org/openapitools/model/Entity.java b/samples/openapi3/server/petstore/spring-boot-oneof-interface/src/main/java/org/openapitools/model/Entity.java index c6bff315d94c..d3b3476145d6 100644 --- a/samples/openapi3/server/petstore/spring-boot-oneof-interface/src/main/java/org/openapitools/model/Entity.java +++ b/samples/openapi3/server/petstore/spring-boot-oneof-interface/src/main/java/org/openapitools/model/Entity.java @@ -52,6 +52,7 @@ public class Entity { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable String atBaseType; + @JsonInclude(JsonInclude.Include.NON_NULL) private String atType; public Entity() { diff --git a/samples/openapi3/server/petstore/spring-boot-oneof-interface/src/main/java/org/openapitools/model/EntityRef.java b/samples/openapi3/server/petstore/spring-boot-oneof-interface/src/main/java/org/openapitools/model/EntityRef.java index c3e7425d99a4..fb39bfa8fd71 100644 --- a/samples/openapi3/server/petstore/spring-boot-oneof-interface/src/main/java/org/openapitools/model/EntityRef.java +++ b/samples/openapi3/server/petstore/spring-boot-oneof-interface/src/main/java/org/openapitools/model/EntityRef.java @@ -48,6 +48,7 @@ public class EntityRef { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable String atBaseType; + @JsonInclude(JsonInclude.Include.NON_NULL) private String atType; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/openapi3/server/petstore/spring-boot-oneof-interface/src/main/java/org/openapitools/model/Extensible.java b/samples/openapi3/server/petstore/spring-boot-oneof-interface/src/main/java/org/openapitools/model/Extensible.java index 6b1a418efa4e..5426785a0d55 100644 --- a/samples/openapi3/server/petstore/spring-boot-oneof-interface/src/main/java/org/openapitools/model/Extensible.java +++ b/samples/openapi3/server/petstore/spring-boot-oneof-interface/src/main/java/org/openapitools/model/Extensible.java @@ -29,6 +29,7 @@ public class Extensible { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable String atBaseType; + @JsonInclude(JsonInclude.Include.NON_NULL) private String atType; public Extensible() { diff --git a/samples/openapi3/server/petstore/spring-boot-oneof-interface/src/main/java/org/openapitools/model/Fruit.java b/samples/openapi3/server/petstore/spring-boot-oneof-interface/src/main/java/org/openapitools/model/Fruit.java index 3d77543df254..2233230221a9 100644 --- a/samples/openapi3/server/petstore/spring-boot-oneof-interface/src/main/java/org/openapitools/model/Fruit.java +++ b/samples/openapi3/server/petstore/spring-boot-oneof-interface/src/main/java/org/openapitools/model/Fruit.java @@ -3,6 +3,7 @@ import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonSubTypes; diff --git a/samples/openapi3/server/petstore/spring-boot-oneof-sealed/src/main/java/org/openapitools/model/Apple.java b/samples/openapi3/server/petstore/spring-boot-oneof-sealed/src/main/java/org/openapitools/model/Apple.java index f98df374ed7a..3cb15460b8cf 100644 --- a/samples/openapi3/server/petstore/spring-boot-oneof-sealed/src/main/java/org/openapitools/model/Apple.java +++ b/samples/openapi3/server/petstore/spring-boot-oneof-sealed/src/main/java/org/openapitools/model/Apple.java @@ -2,6 +2,7 @@ import java.net.URI; import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import org.springframework.lang.Nullable; @@ -26,8 +27,10 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public final class Apple implements Fruit { + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer seeds; + @JsonInclude(JsonInclude.Include.NON_NULL) private FruitType fruitType; public Apple() { diff --git a/samples/openapi3/server/petstore/spring-boot-oneof-sealed/src/main/java/org/openapitools/model/Banana.java b/samples/openapi3/server/petstore/spring-boot-oneof-sealed/src/main/java/org/openapitools/model/Banana.java index b168fc3d764e..1796fc81d4be 100644 --- a/samples/openapi3/server/petstore/spring-boot-oneof-sealed/src/main/java/org/openapitools/model/Banana.java +++ b/samples/openapi3/server/petstore/spring-boot-oneof-sealed/src/main/java/org/openapitools/model/Banana.java @@ -2,6 +2,7 @@ import java.net.URI; import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import org.springframework.lang.Nullable; @@ -26,8 +27,10 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public final class Banana implements Fruit { + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer length; + @JsonInclude(JsonInclude.Include.NON_NULL) private FruitType fruitType; public Banana() { diff --git a/samples/openapi3/server/petstore/spring-boot-oneof-sealed/src/main/java/org/openapitools/model/Bar.java b/samples/openapi3/server/petstore/spring-boot-oneof-sealed/src/main/java/org/openapitools/model/Bar.java index c27bcfa659c7..0a385721560a 100644 --- a/samples/openapi3/server/petstore/spring-boot-oneof-sealed/src/main/java/org/openapitools/model/Bar.java +++ b/samples/openapi3/server/petstore/spring-boot-oneof-sealed/src/main/java/org/openapitools/model/Bar.java @@ -29,6 +29,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public final class Bar extends Entity implements BarRefOrValue { + @JsonInclude(JsonInclude.Include.NON_NULL) private String id; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/openapi3/server/petstore/spring-boot-oneof-sealed/src/main/java/org/openapitools/model/Entity.java b/samples/openapi3/server/petstore/spring-boot-oneof-sealed/src/main/java/org/openapitools/model/Entity.java index 4a0620729d17..10167c1164ee 100644 --- a/samples/openapi3/server/petstore/spring-boot-oneof-sealed/src/main/java/org/openapitools/model/Entity.java +++ b/samples/openapi3/server/petstore/spring-boot-oneof-sealed/src/main/java/org/openapitools/model/Entity.java @@ -52,6 +52,7 @@ public sealed class Entity permits Bar, BarCreate, Foo, Pasta, Pizza { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable String atBaseType; + @JsonInclude(JsonInclude.Include.NON_NULL) private String atType; public Entity() { diff --git a/samples/openapi3/server/petstore/spring-boot-oneof-sealed/src/main/java/org/openapitools/model/EntityRef.java b/samples/openapi3/server/petstore/spring-boot-oneof-sealed/src/main/java/org/openapitools/model/EntityRef.java index 33e1b724576b..6d9b7196a1ee 100644 --- a/samples/openapi3/server/petstore/spring-boot-oneof-sealed/src/main/java/org/openapitools/model/EntityRef.java +++ b/samples/openapi3/server/petstore/spring-boot-oneof-sealed/src/main/java/org/openapitools/model/EntityRef.java @@ -48,6 +48,7 @@ public sealed class EntityRef permits BarRef, FooRef { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable String atBaseType; + @JsonInclude(JsonInclude.Include.NON_NULL) private String atType; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/openapi3/server/petstore/spring-boot-oneof-sealed/src/main/java/org/openapitools/model/Extensible.java b/samples/openapi3/server/petstore/spring-boot-oneof-sealed/src/main/java/org/openapitools/model/Extensible.java index b9e911f48fa7..bf5afd3ab33b 100644 --- a/samples/openapi3/server/petstore/spring-boot-oneof-sealed/src/main/java/org/openapitools/model/Extensible.java +++ b/samples/openapi3/server/petstore/spring-boot-oneof-sealed/src/main/java/org/openapitools/model/Extensible.java @@ -29,6 +29,7 @@ public final class Extensible { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable String atBaseType; + @JsonInclude(JsonInclude.Include.NON_NULL) private String atType; public Extensible() { diff --git a/samples/openapi3/server/petstore/spring-boot-oneof-sealed/src/main/java/org/openapitools/model/Fruit.java b/samples/openapi3/server/petstore/spring-boot-oneof-sealed/src/main/java/org/openapitools/model/Fruit.java index 45b655f0ce22..a9901953bd7e 100644 --- a/samples/openapi3/server/petstore/spring-boot-oneof-sealed/src/main/java/org/openapitools/model/Fruit.java +++ b/samples/openapi3/server/petstore/spring-boot-oneof-sealed/src/main/java/org/openapitools/model/Fruit.java @@ -3,6 +3,7 @@ import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonSubTypes; diff --git a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Apple.java b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Apple.java index 0be64c62685f..cd02d6d6bdab 100644 --- a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Apple.java +++ b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Apple.java @@ -2,6 +2,7 @@ import java.net.URI; import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import org.springframework.lang.Nullable; @@ -26,8 +27,10 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class Apple implements Fruit { + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer seeds; + @JsonInclude(JsonInclude.Include.NON_NULL) private FruitType fruitType; public Apple() { diff --git a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Banana.java b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Banana.java index cb801806025f..cd3bb74e50bd 100644 --- a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Banana.java +++ b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Banana.java @@ -2,6 +2,7 @@ import java.net.URI; import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import org.springframework.lang.Nullable; @@ -26,8 +27,10 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class Banana implements Fruit { + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer length; + @JsonInclude(JsonInclude.Include.NON_NULL) private FruitType fruitType; public Banana() { diff --git a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Bar.java b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Bar.java index acaa8e50aa91..9854268cedbe 100644 --- a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Bar.java +++ b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Bar.java @@ -29,6 +29,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class Bar extends Entity implements BarRefOrValue { + @JsonInclude(JsonInclude.Include.NON_NULL) private String id; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Entity.java b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Entity.java index 3614b2ed6844..0068e39ff4cc 100644 --- a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Entity.java +++ b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Entity.java @@ -52,6 +52,7 @@ public class Entity { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable String atBaseType; + @JsonInclude(JsonInclude.Include.NON_NULL) private String atType; public Entity() { diff --git a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/EntityRef.java b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/EntityRef.java index 28083ecc80a2..782967688b0e 100644 --- a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/EntityRef.java +++ b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/EntityRef.java @@ -48,6 +48,7 @@ public class EntityRef { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable String atBaseType; + @JsonInclude(JsonInclude.Include.NON_NULL) private String atType; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Extensible.java b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Extensible.java index 1ea149bee2a5..ee4781a36c64 100644 --- a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Extensible.java +++ b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Extensible.java @@ -29,6 +29,7 @@ public class Extensible { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable String atBaseType; + @JsonInclude(JsonInclude.Include.NON_NULL) private String atType; public Extensible() { diff --git a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Fruit.java b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Fruit.java index 3d77543df254..2233230221a9 100644 --- a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Fruit.java +++ b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Fruit.java @@ -3,6 +3,7 @@ import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonSubTypes; diff --git a/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/model/Pet.java index 37d29c32b8da..c16ac8affc4e 100644 --- a/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/model/Pet.java +++ b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/model/Pet.java @@ -36,8 +36,10 @@ public class Pet { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Category category; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name; + @JsonInclude(JsonInclude.Include.NON_NULL) private List photoUrls = new ArrayList<>(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/openapi3/server/petstore/springboot-3-include-http-request-context/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/server/petstore/springboot-3-include-http-request-context/src/main/java/org/openapitools/model/Pet.java index 34fefa217937..0ff80dbce269 100644 --- a/samples/openapi3/server/petstore/springboot-3-include-http-request-context/src/main/java/org/openapitools/model/Pet.java +++ b/samples/openapi3/server/petstore/springboot-3-include-http-request-context/src/main/java/org/openapitools/model/Pet.java @@ -44,8 +44,10 @@ public class Pet { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Category category; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name; + @JsonInclude(JsonInclude.Include.NON_NULL) private List photoUrls = new ArrayList<>(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/model/Pet.java index 76e94c5b80a7..8b46bc621498 100644 --- a/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/model/Pet.java +++ b/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/model/Pet.java @@ -43,8 +43,10 @@ public class Pet { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Category category; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name; + @JsonInclude(JsonInclude.Include.NON_NULL) private List photoUrls = new ArrayList<>(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/openapi3/server/petstore/springboot-4-jspecify/src/main/java/org/openapitools/model/Foo.java b/samples/openapi3/server/petstore/springboot-4-jspecify/src/main/java/org/openapitools/model/Foo.java index 38e257be4546..0c2e561bc8a4 100644 --- a/samples/openapi3/server/petstore/springboot-4-jspecify/src/main/java/org/openapitools/model/Foo.java +++ b/samples/openapi3/server/petstore/springboot-4-jspecify/src/main/java/org/openapitools/model/Foo.java @@ -38,22 +38,28 @@ public class Foo { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private @Nullable OffsetDateTime dt; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private org.springframework.core.io.@Nullable Resource binary; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private List listOfDt = new ArrayList<>(); @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private List listMinIntems = new ArrayList<>(); + @JsonInclude(JsonInclude.Include.NON_NULL) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime requiredDt; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable BigDecimal number; public Foo() { @@ -97,7 +103,6 @@ public Foo dt(OffsetDateTime dt) { return dt; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("dt") @JacksonXmlProperty(localName = "dt") public void setDt(@Nullable OffsetDateTime dt) { @@ -122,7 +127,6 @@ public Foo binary(org.springframework.core.io.Resource binary) { return binary; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("binary") @JacksonXmlProperty(localName = "binary") public void setBinary(org.springframework.core.io.@Nullable Resource binary) { @@ -156,7 +160,6 @@ public List getListOfDt() { return listOfDt; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("listOfDt") @JacksonXmlProperty(localName = "listOfDt") @JacksonXmlElementWrapper(useWrapping = false) @@ -191,7 +194,6 @@ public List getListMinIntems() { return listMinIntems; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("listMinIntems") @JacksonXmlProperty(localName = "listMinIntems") @JacksonXmlElementWrapper(useWrapping = false) @@ -241,7 +243,6 @@ public Foo number(BigDecimal number) { return number; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("number") @JacksonXmlProperty(localName = "number") public void setNumber(@Nullable BigDecimal number) { diff --git a/samples/openapi3/server/petstore/springboot-4/src/main/java/org/openapitools/model/Category.java b/samples/openapi3/server/petstore/springboot-4/src/main/java/org/openapitools/model/Category.java index ee0512f727d5..31dda006bb3b 100644 --- a/samples/openapi3/server/petstore/springboot-4/src/main/java/org/openapitools/model/Category.java +++ b/samples/openapi3/server/petstore/springboot-4/src/main/java/org/openapitools/model/Category.java @@ -33,9 +33,11 @@ public class Category { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Long id; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String name; public Category() { @@ -68,7 +70,6 @@ public Category id(@Nullable Long id) { return id; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("id") @JacksonXmlProperty(localName = "id") public void setId(@Nullable Long id) { @@ -93,7 +94,6 @@ public Category name(@Nullable String name) { return name; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("name") @JacksonXmlProperty(localName = "name") public void setName(@Nullable String name) { diff --git a/samples/openapi3/server/petstore/springboot-4/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/openapi3/server/petstore/springboot-4/src/main/java/org/openapitools/model/ModelApiResponse.java index 09bec0e60ea4..1f3adcabd406 100644 --- a/samples/openapi3/server/petstore/springboot-4/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/openapi3/server/petstore/springboot-4/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -35,12 +35,15 @@ public class ModelApiResponse { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Integer code; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String type; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String message; public ModelApiResponse() { @@ -74,7 +77,6 @@ public ModelApiResponse code(@Nullable Integer code) { return code; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("code") @JacksonXmlProperty(localName = "code") public void setCode(@Nullable Integer code) { @@ -99,7 +101,6 @@ public ModelApiResponse type(@Nullable String type) { return type; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("type") @JacksonXmlProperty(localName = "type") public void setType(@Nullable String type) { @@ -124,7 +125,6 @@ public ModelApiResponse message(@Nullable String message) { return message; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("message") @JacksonXmlProperty(localName = "message") public void setMessage(@Nullable String message) { diff --git a/samples/openapi3/server/petstore/springboot-4/src/main/java/org/openapitools/model/Order.java b/samples/openapi3/server/petstore/springboot-4/src/main/java/org/openapitools/model/Order.java index 3a45cca8c07e..376d86e8d637 100644 --- a/samples/openapi3/server/petstore/springboot-4/src/main/java/org/openapitools/model/Order.java +++ b/samples/openapi3/server/petstore/springboot-4/src/main/java/org/openapitools/model/Order.java @@ -37,15 +37,19 @@ public class Order { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Long id; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Long petId; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Integer quantity; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private @Nullable OffsetDateTime shipDate; @@ -87,9 +91,11 @@ public static StatusEnum fromValue(String value) { } @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable StatusEnum status; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private Boolean complete = false; public Order() { @@ -126,7 +132,6 @@ public Order id(@Nullable Long id) { return id; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("id") @JacksonXmlProperty(localName = "id") public void setId(@Nullable Long id) { @@ -151,7 +156,6 @@ public Order petId(@Nullable Long petId) { return petId; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("petId") @JacksonXmlProperty(localName = "petId") public void setPetId(@Nullable Long petId) { @@ -176,7 +180,6 @@ public Order quantity(@Nullable Integer quantity) { return quantity; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("quantity") @JacksonXmlProperty(localName = "quantity") public void setQuantity(@Nullable Integer quantity) { @@ -201,7 +204,6 @@ public Order shipDate(@Nullable OffsetDateTime shipDate) { return shipDate; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("shipDate") @JacksonXmlProperty(localName = "shipDate") public void setShipDate(@Nullable OffsetDateTime shipDate) { @@ -226,7 +228,6 @@ public Order status(@Nullable StatusEnum status) { return status; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("status") @JacksonXmlProperty(localName = "status") public void setStatus(@Nullable StatusEnum status) { @@ -251,7 +252,6 @@ public Boolean getComplete() { return complete; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("complete") @JacksonXmlProperty(localName = "complete") public void setComplete(Boolean complete) { diff --git a/samples/openapi3/server/petstore/springboot-4/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/server/petstore/springboot-4/src/main/java/org/openapitools/model/Pet.java index ce7523e6fee7..4f2e1cb02f2f 100644 --- a/samples/openapi3/server/petstore/springboot-4/src/main/java/org/openapitools/model/Pet.java +++ b/samples/openapi3/server/petstore/springboot-4/src/main/java/org/openapitools/model/Pet.java @@ -40,16 +40,21 @@ public class Pet { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Long id; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Category category; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name; + @JsonInclude(JsonInclude.Include.NON_NULL) private List photoUrls = new ArrayList<>(); @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private List<@Valid Tag> tags = new ArrayList<>(); /** @@ -90,6 +95,7 @@ public static StatusEnum fromValue(String value) { } @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) @Deprecated private @Nullable StatusEnum status; @@ -135,7 +141,6 @@ public Pet id(@Nullable Long id) { return id; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("id") @JacksonXmlProperty(localName = "id") public void setId(@Nullable Long id) { @@ -160,7 +165,6 @@ public Pet category(@Nullable Category category) { return category; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("category") @JacksonXmlProperty(localName = "Category") public void setCategory(@Nullable Category category) { @@ -254,7 +258,6 @@ public Pet addTagsItem(Tag tagsItem) { return tags; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("tags") @JacksonXmlProperty(localName = "Tag") @JacksonXmlElementWrapper(localName = "tag", useWrapping = true) @@ -285,7 +288,6 @@ public Pet status(@Nullable StatusEnum status) { /** * @deprecated */ - @JsonSetter(nulls = Nulls.SKIP) @Deprecated @JsonProperty("status") @JacksonXmlProperty(localName = "status") diff --git a/samples/openapi3/server/petstore/springboot-4/src/main/java/org/openapitools/model/Tag.java b/samples/openapi3/server/petstore/springboot-4/src/main/java/org/openapitools/model/Tag.java index 8b0e49eb8941..fcf543d6cf15 100644 --- a/samples/openapi3/server/petstore/springboot-4/src/main/java/org/openapitools/model/Tag.java +++ b/samples/openapi3/server/petstore/springboot-4/src/main/java/org/openapitools/model/Tag.java @@ -33,9 +33,11 @@ public class Tag { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Long id; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String name; public Tag() { @@ -68,7 +70,6 @@ public Tag id(@Nullable Long id) { return id; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("id") @JacksonXmlProperty(localName = "id") public void setId(@Nullable Long id) { @@ -93,7 +94,6 @@ public Tag name(@Nullable String name) { return name; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("name") @JacksonXmlProperty(localName = "name") public void setName(@Nullable String name) { diff --git a/samples/openapi3/server/petstore/springboot-4/src/main/java/org/openapitools/model/User.java b/samples/openapi3/server/petstore/springboot-4/src/main/java/org/openapitools/model/User.java index 312a09e79028..73194fbf692a 100644 --- a/samples/openapi3/server/petstore/springboot-4/src/main/java/org/openapitools/model/User.java +++ b/samples/openapi3/server/petstore/springboot-4/src/main/java/org/openapitools/model/User.java @@ -33,27 +33,35 @@ public class User { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Long id; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String username; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String firstName; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String lastName; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String email; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String password; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String phone; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Integer userStatus; public User() { @@ -92,7 +100,6 @@ public User id(@Nullable Long id) { return id; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("id") @JacksonXmlProperty(localName = "id") public void setId(@Nullable Long id) { @@ -117,7 +124,6 @@ public User username(@Nullable String username) { return username; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("username") @JacksonXmlProperty(localName = "username") public void setUsername(@Nullable String username) { @@ -142,7 +148,6 @@ public User firstName(@Nullable String firstName) { return firstName; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("firstName") @JacksonXmlProperty(localName = "firstName") public void setFirstName(@Nullable String firstName) { @@ -167,7 +172,6 @@ public User lastName(@Nullable String lastName) { return lastName; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("lastName") @JacksonXmlProperty(localName = "lastName") public void setLastName(@Nullable String lastName) { @@ -192,7 +196,6 @@ public User email(@Nullable String email) { return email; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("email") @JacksonXmlProperty(localName = "email") public void setEmail(@Nullable String email) { @@ -217,7 +220,6 @@ public User password(@Nullable String password) { return password; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("password") @JacksonXmlProperty(localName = "password") public void setPassword(@Nullable String password) { @@ -242,7 +244,6 @@ public User phone(@Nullable String phone) { return phone; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("phone") @JacksonXmlProperty(localName = "phone") public void setPhone(@Nullable String phone) { @@ -267,7 +268,6 @@ public User userStatus(@Nullable Integer userStatus) { return userStatus; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("userStatus") @JacksonXmlProperty(localName = "userStatus") public void setUserStatus(@Nullable Integer userStatus) { diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index 4798bc0c028d..fc4f770ac1d9 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -57,7 +57,6 @@ public class AdditionalPropertiesClass { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Object anytype1; - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable anytype2 = JsonNullable.undefined(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Animal.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Animal.java index 2f923496661e..7812e1c12382 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Animal.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Animal.java @@ -37,6 +37,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class Animal { + @JsonInclude(JsonInclude.Include.NON_NULL) private String className; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Category.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Category.java index f6a38799c911..03999441f921 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Category.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Category.java @@ -26,6 +26,7 @@ public class Category { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Long id; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name = "default-name"; public Category() { diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ContainerDefaultValue.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ContainerDefaultValue.java index 4a0936f8a784..a51bd99c90fc 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ContainerDefaultValue.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ContainerDefaultValue.java @@ -28,14 +28,14 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class ContainerDefaultValue { - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> nullableArray = JsonNullable.>undefined(); + @JsonInclude(JsonInclude.Include.ALWAYS) private JsonNullable> nullableRequiredArray = JsonNullable.>undefined(); + @JsonInclude(JsonInclude.Include.NON_NULL) private List requiredArray = new ArrayList<>(); - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> nullableArrayWithDefault = JsonNullable.>undefined(); public ContainerDefaultValue() { diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/EnumTest.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/EnumTest.java index cef26523d335..5bd8c11d9722 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/EnumTest.java @@ -104,6 +104,7 @@ public static EnumStringRequiredEnum fromValue(String value) { } } + @JsonInclude(JsonInclude.Include.NON_NULL) private EnumStringRequiredEnum enumStringRequired; /** diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/FormatTest.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/FormatTest.java index b4d90992ea4c..0cb8e0d45c2d 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/FormatTest.java @@ -40,6 +40,7 @@ public class FormatTest { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Long int64; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal number; @JsonInclude(JsonInclude.Include.NON_NULL) @@ -51,11 +52,13 @@ public class FormatTest { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable String string; + @JsonInclude(JsonInclude.Include.NON_NULL) private byte[] _byte; @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable org.springframework.core.io.Resource binary; + @JsonInclude(JsonInclude.Include.NON_NULL) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) private LocalDate date; @@ -66,6 +69,7 @@ public class FormatTest { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable UUID uuid; + @JsonInclude(JsonInclude.Include.NON_NULL) private String password; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Name.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Name.java index 2fc98b6fb666..4b44b936d3e2 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Name.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Name.java @@ -24,6 +24,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class Name { + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer name; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/NullableMapProperty.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/NullableMapProperty.java index 7330185d2021..31127013b739 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/NullableMapProperty.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/NullableMapProperty.java @@ -2,7 +2,6 @@ import java.net.URI; import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Arrays; @@ -28,7 +27,6 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class NullableMapProperty { - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> languageValues = JsonNullable.>undefined(); public NullableMapProperty languageValues(Map languageValues) { diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ParentWithNullable.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ParentWithNullable.java index d095e6659db9..d394b3e38431 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ParentWithNullable.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ParentWithNullable.java @@ -75,7 +75,6 @@ public static TypeEnum fromValue(String value) { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable TypeEnum type; - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable nullableProperty = JsonNullable.undefined(); public ParentWithNullable type(@Nullable TypeEnum type) { diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Pet.java index 673bb2e90254..728f7cad250d 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Pet.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Pet.java @@ -38,8 +38,10 @@ public class Pet { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Category category; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name; + @JsonInclude(JsonInclude.Include.NON_NULL) private Set photoUrls = new LinkedHashSet<>(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/TypeHolderDefault.java index 81f9284d385e..79d663d04658 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -2,6 +2,7 @@ import java.net.URI; import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.math.BigDecimal; @@ -26,14 +27,19 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class TypeHolderDefault { + @JsonInclude(JsonInclude.Include.NON_NULL) private String stringItem = "what"; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal numberItem = new BigDecimal("1.234"); + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer integerItem = -2; + @JsonInclude(JsonInclude.Include.NON_NULL) private Boolean boolItem = true; + @JsonInclude(JsonInclude.Include.NON_NULL) private List arrayItem = new ArrayList<>(Arrays.asList(0, 1, 2, 3)); public TypeHolderDefault() { diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/TypeHolderExample.java index 8b1470e92bf0..31461adcaef0 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -2,6 +2,7 @@ import java.net.URI; import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.math.BigDecimal; @@ -26,16 +27,22 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class TypeHolderExample { + @JsonInclude(JsonInclude.Include.NON_NULL) private String stringItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal numberItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Float floatItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer integerItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Boolean boolItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private List arrayItem = new ArrayList<>(); public TypeHolderExample() { diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index 4798bc0c028d..fc4f770ac1d9 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -57,7 +57,6 @@ public class AdditionalPropertiesClass { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Object anytype1; - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable anytype2 = JsonNullable.undefined(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Animal.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Animal.java index 2f923496661e..7812e1c12382 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Animal.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Animal.java @@ -37,6 +37,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class Animal { + @JsonInclude(JsonInclude.Include.NON_NULL) private String className; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Category.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Category.java index f6a38799c911..03999441f921 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Category.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Category.java @@ -26,6 +26,7 @@ public class Category { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Long id; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name = "default-name"; public Category() { diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ContainerDefaultValue.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ContainerDefaultValue.java index 4a0936f8a784..a51bd99c90fc 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ContainerDefaultValue.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ContainerDefaultValue.java @@ -28,14 +28,14 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class ContainerDefaultValue { - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> nullableArray = JsonNullable.>undefined(); + @JsonInclude(JsonInclude.Include.ALWAYS) private JsonNullable> nullableRequiredArray = JsonNullable.>undefined(); + @JsonInclude(JsonInclude.Include.NON_NULL) private List requiredArray = new ArrayList<>(); - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> nullableArrayWithDefault = JsonNullable.>undefined(); public ContainerDefaultValue() { diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/EnumTest.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/EnumTest.java index cef26523d335..5bd8c11d9722 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/EnumTest.java @@ -104,6 +104,7 @@ public static EnumStringRequiredEnum fromValue(String value) { } } + @JsonInclude(JsonInclude.Include.NON_NULL) private EnumStringRequiredEnum enumStringRequired; /** diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/FormatTest.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/FormatTest.java index b4d90992ea4c..0cb8e0d45c2d 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/FormatTest.java @@ -40,6 +40,7 @@ public class FormatTest { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Long int64; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal number; @JsonInclude(JsonInclude.Include.NON_NULL) @@ -51,11 +52,13 @@ public class FormatTest { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable String string; + @JsonInclude(JsonInclude.Include.NON_NULL) private byte[] _byte; @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable org.springframework.core.io.Resource binary; + @JsonInclude(JsonInclude.Include.NON_NULL) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) private LocalDate date; @@ -66,6 +69,7 @@ public class FormatTest { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable UUID uuid; + @JsonInclude(JsonInclude.Include.NON_NULL) private String password; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Name.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Name.java index 2fc98b6fb666..4b44b936d3e2 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Name.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Name.java @@ -24,6 +24,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class Name { + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer name; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/NullableMapProperty.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/NullableMapProperty.java index 7330185d2021..31127013b739 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/NullableMapProperty.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/NullableMapProperty.java @@ -2,7 +2,6 @@ import java.net.URI; import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Arrays; @@ -28,7 +27,6 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class NullableMapProperty { - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> languageValues = JsonNullable.>undefined(); public NullableMapProperty languageValues(Map languageValues) { diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ParentWithNullable.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ParentWithNullable.java index d095e6659db9..d394b3e38431 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ParentWithNullable.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ParentWithNullable.java @@ -75,7 +75,6 @@ public static TypeEnum fromValue(String value) { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable TypeEnum type; - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable nullableProperty = JsonNullable.undefined(); public ParentWithNullable type(@Nullable TypeEnum type) { diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Pet.java index 673bb2e90254..728f7cad250d 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Pet.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Pet.java @@ -38,8 +38,10 @@ public class Pet { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Category category; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name; + @JsonInclude(JsonInclude.Include.NON_NULL) private Set photoUrls = new LinkedHashSet<>(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/TypeHolderDefault.java index 81f9284d385e..79d663d04658 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -2,6 +2,7 @@ import java.net.URI; import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.math.BigDecimal; @@ -26,14 +27,19 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class TypeHolderDefault { + @JsonInclude(JsonInclude.Include.NON_NULL) private String stringItem = "what"; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal numberItem = new BigDecimal("1.234"); + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer integerItem = -2; + @JsonInclude(JsonInclude.Include.NON_NULL) private Boolean boolItem = true; + @JsonInclude(JsonInclude.Include.NON_NULL) private List arrayItem = new ArrayList<>(Arrays.asList(0, 1, 2, 3)); public TypeHolderDefault() { diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/TypeHolderExample.java index 8b1470e92bf0..31461adcaef0 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -2,6 +2,7 @@ import java.net.URI; import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.math.BigDecimal; @@ -26,16 +27,22 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class TypeHolderExample { + @JsonInclude(JsonInclude.Include.NON_NULL) private String stringItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal numberItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Float floatItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer integerItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Boolean boolItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private List arrayItem = new ArrayList<>(); public TypeHolderExample() { diff --git a/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/model/Pet.java index aa7e8049ad41..47e43e89eb8a 100644 --- a/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/model/Pet.java +++ b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/model/Pet.java @@ -34,8 +34,10 @@ public class Pet { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Category category; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name; + @JsonInclude(JsonInclude.Include.NON_NULL) private List photoUrls = new ArrayList<>(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/Category.java b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/Category.java index 68aca95b6987..b3d2b8e934ca 100644 --- a/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/Category.java +++ b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/Category.java @@ -2,7 +2,6 @@ import java.net.URI; import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import org.springframework.lang.Nullable; @@ -24,10 +23,8 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class Category { - @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Long id; - @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable String name; public Category id(@Nullable Long id) { diff --git a/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/ModelApiResponse.java index f8e6a50f1cb5..ea0b507c324b 100644 --- a/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -2,7 +2,6 @@ import java.net.URI; import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -26,13 +25,10 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class ModelApiResponse { - @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Integer code; - @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable String type; - @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable String message; public ModelApiResponse code(@Nullable Integer code) { diff --git a/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/Order.java b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/Order.java index 2e07158268fa..f45d4cfe2d8d 100644 --- a/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/Order.java +++ b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/Order.java @@ -2,7 +2,6 @@ import java.net.URI; import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -27,16 +26,12 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class Order { - @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Long id; - @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Long petId; - @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Integer quantity; - @JsonInclude(JsonInclude.Include.NON_NULL) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private @Nullable OffsetDateTime shipDate; @@ -77,10 +72,8 @@ public static StatusEnum fromValue(String value) { } } - @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable StatusEnum status; - @JsonInclude(JsonInclude.Include.NON_NULL) private Boolean complete = false; public Order id(@Nullable Long id) { diff --git a/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/Pet.java index 37d29c32b8da..e3002073fbe6 100644 --- a/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/Pet.java +++ b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/Pet.java @@ -30,17 +30,16 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class Pet { - @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Long id; - @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Category category; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name; + @JsonInclude(JsonInclude.Include.NON_NULL) private List photoUrls = new ArrayList<>(); - @JsonInclude(JsonInclude.Include.NON_NULL) private List<@Valid Tag> tags = new ArrayList<>(); /** @@ -80,7 +79,6 @@ public static StatusEnum fromValue(String value) { } } - @JsonInclude(JsonInclude.Include.NON_NULL) @Deprecated private @Nullable StatusEnum status; diff --git a/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/Tag.java b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/Tag.java index 17d305647101..ec805dc81eee 100644 --- a/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/Tag.java +++ b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/Tag.java @@ -2,7 +2,6 @@ import java.net.URI; import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import org.springframework.lang.Nullable; @@ -24,10 +23,8 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class Tag { - @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Long id; - @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable String name; public Tag id(@Nullable Long id) { diff --git a/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/User.java b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/User.java index bac00b6cdd0b..5d8ac5c931ae 100644 --- a/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/User.java +++ b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/User.java @@ -2,7 +2,6 @@ import java.net.URI; import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import org.springframework.lang.Nullable; @@ -24,28 +23,20 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class User { - @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Long id; - @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable String username; - @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable String firstName; - @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable String lastName; - @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable String email; - @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable String password; - @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable String phone; - @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Integer userStatus; public User id(@Nullable Long id) { diff --git a/samples/server/others/kotlin-springboot/oneOf-discriminator-const/src/main/kotlin/org/openapitools/model/Cat.kt b/samples/server/others/kotlin-springboot/oneOf-discriminator-const/src/main/kotlin/org/openapitools/model/Cat.kt index d5af2e05d658..4887b45e853b 100644 --- a/samples/server/others/kotlin-springboot/oneOf-discriminator-const/src/main/kotlin/org/openapitools/model/Cat.kt +++ b/samples/server/others/kotlin-springboot/oneOf-discriminator-const/src/main/kotlin/org/openapitools/model/Cat.kt @@ -2,6 +2,7 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonCreator +import com.fasterxml.jackson.annotation.JsonInclude import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.annotation.JsonValue import com.fasterxml.jackson.annotation.JsonIgnoreProperties @@ -24,6 +25,7 @@ import jakarta.validation.Valid */ data class Cat( + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("huntingSkill") @get:JsonProperty("huntingSkill", required = true) val huntingSkill: Cat.HuntingSkill, diff --git a/samples/server/others/kotlin-springboot/oneOf-discriminator-const/src/main/kotlin/org/openapitools/model/Dog.kt b/samples/server/others/kotlin-springboot/oneOf-discriminator-const/src/main/kotlin/org/openapitools/model/Dog.kt index de31e3c6a74b..599607754f1d 100644 --- a/samples/server/others/kotlin-springboot/oneOf-discriminator-const/src/main/kotlin/org/openapitools/model/Dog.kt +++ b/samples/server/others/kotlin-springboot/oneOf-discriminator-const/src/main/kotlin/org/openapitools/model/Dog.kt @@ -1,6 +1,7 @@ package org.openapitools.model import java.util.Objects +import com.fasterxml.jackson.annotation.JsonInclude import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.annotation.JsonCreator import com.fasterxml.jackson.annotation.JsonIgnoreProperties @@ -25,10 +26,12 @@ import jakarta.validation.Valid data class Dog( @field:Valid + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("petType") @get:JsonProperty("petType", required = true) override val petType: kotlin.String = "dog", @get:Min(value=0) + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("packSize") @get:JsonProperty("packSize", required = true) val packSize: kotlin.Int = 0 ) : Pet { diff --git a/samples/server/others/kotlin-springboot/oneOf-discriminator-const/src/main/kotlin/org/openapitools/model/Pet.kt b/samples/server/others/kotlin-springboot/oneOf-discriminator-const/src/main/kotlin/org/openapitools/model/Pet.kt index 40869b85e6bb..373c49ea1ab7 100644 --- a/samples/server/others/kotlin-springboot/oneOf-discriminator-const/src/main/kotlin/org/openapitools/model/Pet.kt +++ b/samples/server/others/kotlin-springboot/oneOf-discriminator-const/src/main/kotlin/org/openapitools/model/Pet.kt @@ -3,6 +3,7 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonCreator import com.fasterxml.jackson.annotation.JsonIgnoreProperties +import com.fasterxml.jackson.annotation.JsonInclude import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.annotation.JsonSubTypes import com.fasterxml.jackson.annotation.JsonTypeInfo diff --git a/samples/server/others/kotlin-springboot/oneOf-discriminator/src/main/kotlin/org/openapitools/model/Bird.kt b/samples/server/others/kotlin-springboot/oneOf-discriminator/src/main/kotlin/org/openapitools/model/Bird.kt index c5611ef934c7..cf8ed4566029 100644 --- a/samples/server/others/kotlin-springboot/oneOf-discriminator/src/main/kotlin/org/openapitools/model/Bird.kt +++ b/samples/server/others/kotlin-springboot/oneOf-discriminator/src/main/kotlin/org/openapitools/model/Bird.kt @@ -27,9 +27,11 @@ import jakarta.validation.Valid */ data class Bird( + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("discriminator") @get:JsonProperty("discriminator", required = true) override val discriminator: kotlin.String = "BIRD", + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("another_discriminator") @get:JsonProperty("another_discriminator", required = true) override val anotherDiscriminator: kotlin.String = "ANOTHER_BIRD", diff --git a/samples/server/others/kotlin-springboot/oneOf-discriminator/src/main/kotlin/org/openapitools/model/Robobird.kt b/samples/server/others/kotlin-springboot/oneOf-discriminator/src/main/kotlin/org/openapitools/model/Robobird.kt index e11c5a0a1af1..374a42c3886d 100644 --- a/samples/server/others/kotlin-springboot/oneOf-discriminator/src/main/kotlin/org/openapitools/model/Robobird.kt +++ b/samples/server/others/kotlin-springboot/oneOf-discriminator/src/main/kotlin/org/openapitools/model/Robobird.kt @@ -27,9 +27,11 @@ import jakarta.validation.Valid */ data class Robobird( + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("discriminator") @get:JsonProperty("discriminator", required = true) override val discriminator: kotlin.String = "ROBOBIRD", + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("another_discriminator") @get:JsonProperty("another_discriminator", required = true) override val anotherDiscriminator: kotlin.String = "ANOTHER_ROBOBIRD", diff --git a/samples/server/others/kotlin-springboot/oneOf-enum-discriminator/src/main/kotlin/org/openapitools/model/Car.kt b/samples/server/others/kotlin-springboot/oneOf-enum-discriminator/src/main/kotlin/org/openapitools/model/Car.kt index f4e25930868d..831595203de0 100644 --- a/samples/server/others/kotlin-springboot/oneOf-enum-discriminator/src/main/kotlin/org/openapitools/model/Car.kt +++ b/samples/server/others/kotlin-springboot/oneOf-enum-discriminator/src/main/kotlin/org/openapitools/model/Car.kt @@ -2,6 +2,7 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonCreator +import com.fasterxml.jackson.annotation.JsonInclude import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.annotation.JsonValue import org.openapitools.model.VehicleType @@ -26,9 +27,11 @@ import jakarta.validation.Valid data class Car( @field:Valid + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("vehicleType") @get:JsonProperty("vehicleType", required = true) override val vehicleType: VehicleType = VehicleType.CAR, + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("numDoors") @get:JsonProperty("numDoors", required = true) val numDoors: kotlin.Int ) : Vehicle { diff --git a/samples/server/others/kotlin-springboot/oneOf-enum-discriminator/src/main/kotlin/org/openapitools/model/Truck.kt b/samples/server/others/kotlin-springboot/oneOf-enum-discriminator/src/main/kotlin/org/openapitools/model/Truck.kt index 61b3bda8c499..723e2f2376e8 100644 --- a/samples/server/others/kotlin-springboot/oneOf-enum-discriminator/src/main/kotlin/org/openapitools/model/Truck.kt +++ b/samples/server/others/kotlin-springboot/oneOf-enum-discriminator/src/main/kotlin/org/openapitools/model/Truck.kt @@ -2,6 +2,7 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonCreator +import com.fasterxml.jackson.annotation.JsonInclude import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.annotation.JsonValue import org.openapitools.model.VehicleType @@ -26,9 +27,11 @@ import jakarta.validation.Valid data class Truck( @field:Valid + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("vehicleType") @get:JsonProperty("vehicleType", required = true) override val vehicleType: VehicleType = VehicleType.TRUCK, + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("payloadCapacity") @get:JsonProperty("payloadCapacity", required = true) val payloadCapacity: java.math.BigDecimal ) : Vehicle { diff --git a/samples/server/others/kotlin-springboot/oneOf-enum-discriminator/src/main/kotlin/org/openapitools/model/Vehicle.kt b/samples/server/others/kotlin-springboot/oneOf-enum-discriminator/src/main/kotlin/org/openapitools/model/Vehicle.kt index 637caa41c0e0..afd7fad1a33d 100644 --- a/samples/server/others/kotlin-springboot/oneOf-enum-discriminator/src/main/kotlin/org/openapitools/model/Vehicle.kt +++ b/samples/server/others/kotlin-springboot/oneOf-enum-discriminator/src/main/kotlin/org/openapitools/model/Vehicle.kt @@ -3,6 +3,7 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonCreator import com.fasterxml.jackson.annotation.JsonIgnoreProperties +import com.fasterxml.jackson.annotation.JsonInclude import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.annotation.JsonSubTypes import com.fasterxml.jackson.annotation.JsonTypeInfo diff --git a/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/Category.java index 4012cb04f231..4712b79a3cac 100644 --- a/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/Category.java @@ -2,7 +2,6 @@ import java.net.URI; import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import org.openapitools.jackson.nullable.JsonNullable; diff --git a/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/ModelApiResponse.java index 9ee0c1b2807d..bfdb5b06105f 100644 --- a/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -2,7 +2,6 @@ import java.net.URI; import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; diff --git a/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/Order.java b/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/Order.java index 05024e14114d..f4c5514f4426 100644 --- a/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/Order.java @@ -2,7 +2,6 @@ import java.net.URI; import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/Pet.java index 30902a60c2df..36365c9a7a1b 100644 --- a/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/Pet.java @@ -2,7 +2,6 @@ import java.net.URI; import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/Tag.java b/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/Tag.java index 59823ce029a6..671b2504940e 100644 --- a/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/Tag.java @@ -2,7 +2,6 @@ import java.net.URI; import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import org.openapitools.jackson.nullable.JsonNullable; diff --git a/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/User.java b/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/User.java index dde60f69542a..e6053f2676f6 100644 --- a/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/User.java +++ b/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/User.java @@ -2,7 +2,6 @@ import java.net.URI; import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import org.openapitools.jackson.nullable.JsonNullable; diff --git a/samples/server/petstore/kotlin-spring-cloud-4/build.gradle.kts b/samples/server/petstore/kotlin-spring-cloud-4/build.gradle.kts index ce19f0a90dab..e05be7009335 100644 --- a/samples/server/petstore/kotlin-spring-cloud-4/build.gradle.kts +++ b/samples/server/petstore/kotlin-spring-cloud-4/build.gradle.kts @@ -43,7 +43,7 @@ dependencies { implementation("org.springframework.boot:spring-boot-starter-webmvc") implementation("com.google.code.findbugs:jsr305:3.0.2") - val jackson3Version = "3.1.0" + val jackson3Version = "3.1.5" implementation("tools.jackson.dataformat:jackson-dataformat-yaml:$jackson3Version") implementation("tools.jackson.dataformat:jackson-dataformat-xml:$jackson3Version") implementation("tools.jackson.module:jackson-module-kotlin:$jackson3Version") diff --git a/samples/server/petstore/kotlin-spring-cloud-4/gradle/wrapper/gradle-wrapper.properties b/samples/server/petstore/kotlin-spring-cloud-4/gradle/wrapper/gradle-wrapper.properties index ca025c83a7cc..4f5eb9dcc0ef 100644 --- a/samples/server/petstore/kotlin-spring-cloud-4/gradle/wrapper/gradle-wrapper.properties +++ b/samples/server/petstore/kotlin-spring-cloud-4/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.5-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/samples/server/petstore/kotlin-spring-cloud-4/pom.xml b/samples/server/petstore/kotlin-spring-cloud-4/pom.xml index 54f1e792ebad..1d70ea0f2049 100644 --- a/samples/server/petstore/kotlin-spring-cloud-4/pom.xml +++ b/samples/server/petstore/kotlin-spring-cloud-4/pom.xml @@ -8,7 +8,7 @@ 1.0.0 3.0.2 - 3.1.0 + 3.1.5 3.0.0 2.2.0 diff --git a/samples/server/petstore/kotlin-spring-cloud-4/src/main/kotlin/org/openapitools/model/Category.kt b/samples/server/petstore/kotlin-spring-cloud-4/src/main/kotlin/org/openapitools/model/Category.kt index f44ed4c7ace6..84485a66eb96 100644 --- a/samples/server/petstore/kotlin-spring-cloud-4/src/main/kotlin/org/openapitools/model/Category.kt +++ b/samples/server/petstore/kotlin-spring-cloud-4/src/main/kotlin/org/openapitools/model/Category.kt @@ -1,10 +1,7 @@ package org.openapitools.model import java.util.Objects -import com.fasterxml.jackson.annotation.JsonInclude import com.fasterxml.jackson.annotation.JsonProperty -import com.fasterxml.jackson.annotation.JsonSetter -import com.fasterxml.jackson.annotation.Nulls import jakarta.validation.constraints.DecimalMax import jakarta.validation.constraints.DecimalMin import jakarta.validation.constraints.Email @@ -22,14 +19,10 @@ import jakarta.validation.Valid */ data class Category( - @field:JsonInclude(JsonInclude.Include.NON_NULL) - @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("id") @get:JsonProperty("id") val id: kotlin.Long? = null, @get:Pattern(regexp="^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") - @field:JsonInclude(JsonInclude.Include.NON_NULL) - @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("name") @get:JsonProperty("name") val name: kotlin.String? = null ) : java.io.Serializable { diff --git a/samples/server/petstore/kotlin-spring-cloud-4/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt b/samples/server/petstore/kotlin-spring-cloud-4/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt index 8d84914db2ba..bc1eb76d4b71 100644 --- a/samples/server/petstore/kotlin-spring-cloud-4/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt +++ b/samples/server/petstore/kotlin-spring-cloud-4/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt @@ -1,10 +1,7 @@ package org.openapitools.model import java.util.Objects -import com.fasterxml.jackson.annotation.JsonInclude import com.fasterxml.jackson.annotation.JsonProperty -import com.fasterxml.jackson.annotation.JsonSetter -import com.fasterxml.jackson.annotation.Nulls import jakarta.validation.constraints.DecimalMax import jakarta.validation.constraints.DecimalMin import jakarta.validation.constraints.Email @@ -23,18 +20,12 @@ import jakarta.validation.Valid */ data class ModelApiResponse( - @field:JsonInclude(JsonInclude.Include.NON_NULL) - @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("code") @get:JsonProperty("code") val code: kotlin.Int? = null, - @field:JsonInclude(JsonInclude.Include.NON_NULL) - @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("type") @get:JsonProperty("type") val type: kotlin.String? = null, - @field:JsonInclude(JsonInclude.Include.NON_NULL) - @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("message") @get:JsonProperty("message") val message: kotlin.String? = null ) : java.io.Serializable { diff --git a/samples/server/petstore/kotlin-spring-cloud-4/src/main/kotlin/org/openapitools/model/Order.kt b/samples/server/petstore/kotlin-spring-cloud-4/src/main/kotlin/org/openapitools/model/Order.kt index 486848e14599..e865644bd4f8 100644 --- a/samples/server/petstore/kotlin-spring-cloud-4/src/main/kotlin/org/openapitools/model/Order.kt +++ b/samples/server/petstore/kotlin-spring-cloud-4/src/main/kotlin/org/openapitools/model/Order.kt @@ -2,11 +2,8 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonCreator -import com.fasterxml.jackson.annotation.JsonInclude import com.fasterxml.jackson.annotation.JsonProperty -import com.fasterxml.jackson.annotation.JsonSetter import com.fasterxml.jackson.annotation.JsonValue -import com.fasterxml.jackson.annotation.Nulls import jakarta.validation.constraints.DecimalMax import jakarta.validation.constraints.DecimalMin import jakarta.validation.constraints.Email @@ -28,33 +25,21 @@ import jakarta.validation.Valid */ data class Order( - @field:JsonInclude(JsonInclude.Include.NON_NULL) - @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("id") @get:JsonProperty("id") val id: kotlin.Long? = null, - @field:JsonInclude(JsonInclude.Include.NON_NULL) - @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("petId") @get:JsonProperty("petId") val petId: kotlin.Long? = null, - @field:JsonInclude(JsonInclude.Include.NON_NULL) - @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("quantity") @get:JsonProperty("quantity") val quantity: kotlin.Int? = null, - @field:JsonInclude(JsonInclude.Include.NON_NULL) - @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("shipDate") @get:JsonProperty("shipDate") val shipDate: java.time.OffsetDateTime? = null, - @field:JsonInclude(JsonInclude.Include.NON_NULL) - @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("status") @get:JsonProperty("status") val status: Order.Status? = null, - @field:JsonInclude(JsonInclude.Include.NON_NULL) - @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("complete") @get:JsonProperty("complete") val complete: kotlin.Boolean? = false ) : java.io.Serializable { diff --git a/samples/server/petstore/kotlin-spring-cloud-4/src/main/kotlin/org/openapitools/model/Pet.kt b/samples/server/petstore/kotlin-spring-cloud-4/src/main/kotlin/org/openapitools/model/Pet.kt index 56c523367969..472eb39902dc 100644 --- a/samples/server/petstore/kotlin-spring-cloud-4/src/main/kotlin/org/openapitools/model/Pet.kt +++ b/samples/server/petstore/kotlin-spring-cloud-4/src/main/kotlin/org/openapitools/model/Pet.kt @@ -2,11 +2,8 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonCreator -import com.fasterxml.jackson.annotation.JsonInclude import com.fasterxml.jackson.annotation.JsonProperty -import com.fasterxml.jackson.annotation.JsonSetter import com.fasterxml.jackson.annotation.JsonValue -import com.fasterxml.jackson.annotation.Nulls import org.openapitools.model.Category import org.openapitools.model.Tag import jakarta.validation.constraints.DecimalMax @@ -36,26 +33,18 @@ data class Pet( @param:JsonProperty("photoUrls") @get:JsonProperty("photoUrls", required = true) val photoUrls: kotlin.collections.List, - @field:JsonInclude(JsonInclude.Include.NON_NULL) - @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("id") @get:JsonProperty("id") val id: kotlin.Long? = null, @field:Valid - @field:JsonInclude(JsonInclude.Include.NON_NULL) - @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("category") @get:JsonProperty("category") val category: Category? = null, @field:Valid - @field:JsonInclude(JsonInclude.Include.NON_NULL) - @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("tags") @get:JsonProperty("tags") val tags: kotlin.collections.List? = null, @Deprecated(message = "") - @field:JsonInclude(JsonInclude.Include.NON_NULL) - @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("status") @get:JsonProperty("status") val status: Pet.Status? = null ) : java.io.Serializable { diff --git a/samples/server/petstore/kotlin-spring-cloud-4/src/main/kotlin/org/openapitools/model/Tag.kt b/samples/server/petstore/kotlin-spring-cloud-4/src/main/kotlin/org/openapitools/model/Tag.kt index e3ec341838e6..f60b101132b0 100644 --- a/samples/server/petstore/kotlin-spring-cloud-4/src/main/kotlin/org/openapitools/model/Tag.kt +++ b/samples/server/petstore/kotlin-spring-cloud-4/src/main/kotlin/org/openapitools/model/Tag.kt @@ -1,10 +1,7 @@ package org.openapitools.model import java.util.Objects -import com.fasterxml.jackson.annotation.JsonInclude import com.fasterxml.jackson.annotation.JsonProperty -import com.fasterxml.jackson.annotation.JsonSetter -import com.fasterxml.jackson.annotation.Nulls import jakarta.validation.constraints.DecimalMax import jakarta.validation.constraints.DecimalMin import jakarta.validation.constraints.Email @@ -22,13 +19,9 @@ import jakarta.validation.Valid */ data class Tag( - @field:JsonInclude(JsonInclude.Include.NON_NULL) - @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("id") @get:JsonProperty("id") val id: kotlin.Long? = null, - @field:JsonInclude(JsonInclude.Include.NON_NULL) - @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("name") @get:JsonProperty("name") val name: kotlin.String? = null ) : java.io.Serializable { diff --git a/samples/server/petstore/kotlin-spring-cloud-4/src/main/kotlin/org/openapitools/model/User.kt b/samples/server/petstore/kotlin-spring-cloud-4/src/main/kotlin/org/openapitools/model/User.kt index 93294737c422..3fcde2466802 100644 --- a/samples/server/petstore/kotlin-spring-cloud-4/src/main/kotlin/org/openapitools/model/User.kt +++ b/samples/server/petstore/kotlin-spring-cloud-4/src/main/kotlin/org/openapitools/model/User.kt @@ -1,10 +1,7 @@ package org.openapitools.model import java.util.Objects -import com.fasterxml.jackson.annotation.JsonInclude import com.fasterxml.jackson.annotation.JsonProperty -import com.fasterxml.jackson.annotation.JsonSetter -import com.fasterxml.jackson.annotation.Nulls import jakarta.validation.constraints.DecimalMax import jakarta.validation.constraints.DecimalMin import jakarta.validation.constraints.Email @@ -28,43 +25,27 @@ import jakarta.validation.Valid */ data class User( - @field:JsonInclude(JsonInclude.Include.NON_NULL) - @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("id") @get:JsonProperty("id") val id: kotlin.Long? = null, - @field:JsonInclude(JsonInclude.Include.NON_NULL) - @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("username") @get:JsonProperty("username") val username: kotlin.String? = null, - @field:JsonInclude(JsonInclude.Include.NON_NULL) - @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("firstName") @get:JsonProperty("firstName") val firstName: kotlin.String? = null, - @field:JsonInclude(JsonInclude.Include.NON_NULL) - @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("lastName") @get:JsonProperty("lastName") val lastName: kotlin.String? = null, - @field:JsonInclude(JsonInclude.Include.NON_NULL) - @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("email") @get:JsonProperty("email") val email: kotlin.String? = null, - @field:JsonInclude(JsonInclude.Include.NON_NULL) - @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("password") @get:JsonProperty("password") val password: kotlin.String? = null, - @field:JsonInclude(JsonInclude.Include.NON_NULL) - @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("phone") @get:JsonProperty("phone") val phone: kotlin.String? = null, - @field:JsonInclude(JsonInclude.Include.NON_NULL) - @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("userStatus") @get:JsonProperty("userStatus") val userStatus: kotlin.Int? = null ) : java.io.Serializable { diff --git a/samples/server/petstore/kotlin-spring-cloud/src/main/kotlin/org/openapitools/model/Pet.kt b/samples/server/petstore/kotlin-spring-cloud/src/main/kotlin/org/openapitools/model/Pet.kt index 978290446045..d37fcde397d1 100644 --- a/samples/server/petstore/kotlin-spring-cloud/src/main/kotlin/org/openapitools/model/Pet.kt +++ b/samples/server/petstore/kotlin-spring-cloud/src/main/kotlin/org/openapitools/model/Pet.kt @@ -30,9 +30,11 @@ import javax.validation.Valid */ data class Pet( + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("name") @get:JsonProperty("name", required = true) val name: kotlin.String, + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("photoUrls") @get:JsonProperty("photoUrls", required = true) val photoUrls: kotlin.collections.List, diff --git a/samples/server/petstore/kotlin-spring-declarative-interface-bean-validation/src/main/kotlin/org/openapitools/model/Pet.kt b/samples/server/petstore/kotlin-spring-declarative-interface-bean-validation/src/main/kotlin/org/openapitools/model/Pet.kt index ebd784c67532..818ca34ee824 100644 --- a/samples/server/petstore/kotlin-spring-declarative-interface-bean-validation/src/main/kotlin/org/openapitools/model/Pet.kt +++ b/samples/server/petstore/kotlin-spring-declarative-interface-bean-validation/src/main/kotlin/org/openapitools/model/Pet.kt @@ -32,10 +32,12 @@ import io.swagger.v3.oas.annotations.media.Schema data class Pet( @Schema(example = "doggie", required = true, description = "") + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("name") @get:JsonProperty("name", required = true) val name: kotlin.String, @Schema(required = true, description = "") + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("photoUrls") @get:JsonProperty("photoUrls", required = true) val photoUrls: kotlin.collections.List, diff --git a/samples/server/petstore/kotlin-spring-declarative-interface-reactive-coroutines/src/main/kotlin/org/openapitools/model/Pet.kt b/samples/server/petstore/kotlin-spring-declarative-interface-reactive-coroutines/src/main/kotlin/org/openapitools/model/Pet.kt index ebd784c67532..818ca34ee824 100644 --- a/samples/server/petstore/kotlin-spring-declarative-interface-reactive-coroutines/src/main/kotlin/org/openapitools/model/Pet.kt +++ b/samples/server/petstore/kotlin-spring-declarative-interface-reactive-coroutines/src/main/kotlin/org/openapitools/model/Pet.kt @@ -32,10 +32,12 @@ import io.swagger.v3.oas.annotations.media.Schema data class Pet( @Schema(example = "doggie", required = true, description = "") + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("name") @get:JsonProperty("name", required = true) val name: kotlin.String, @Schema(required = true, description = "") + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("photoUrls") @get:JsonProperty("photoUrls", required = true) val photoUrls: kotlin.collections.List, diff --git a/samples/server/petstore/kotlin-spring-declarative-interface-reactive-reactor-wrapped/src/main/kotlin/org/openapitools/model/Pet.kt b/samples/server/petstore/kotlin-spring-declarative-interface-reactive-reactor-wrapped/src/main/kotlin/org/openapitools/model/Pet.kt index ebd784c67532..818ca34ee824 100644 --- a/samples/server/petstore/kotlin-spring-declarative-interface-reactive-reactor-wrapped/src/main/kotlin/org/openapitools/model/Pet.kt +++ b/samples/server/petstore/kotlin-spring-declarative-interface-reactive-reactor-wrapped/src/main/kotlin/org/openapitools/model/Pet.kt @@ -32,10 +32,12 @@ import io.swagger.v3.oas.annotations.media.Schema data class Pet( @Schema(example = "doggie", required = true, description = "") + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("name") @get:JsonProperty("name", required = true) val name: kotlin.String, @Schema(required = true, description = "") + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("photoUrls") @get:JsonProperty("photoUrls", required = true) val photoUrls: kotlin.collections.List, diff --git a/samples/server/petstore/kotlin-spring-declarative-interface-wrapped/src/main/kotlin/org/openapitools/model/Pet.kt b/samples/server/petstore/kotlin-spring-declarative-interface-wrapped/src/main/kotlin/org/openapitools/model/Pet.kt index ebd784c67532..818ca34ee824 100644 --- a/samples/server/petstore/kotlin-spring-declarative-interface-wrapped/src/main/kotlin/org/openapitools/model/Pet.kt +++ b/samples/server/petstore/kotlin-spring-declarative-interface-wrapped/src/main/kotlin/org/openapitools/model/Pet.kt @@ -32,10 +32,12 @@ import io.swagger.v3.oas.annotations.media.Schema data class Pet( @Schema(example = "doggie", required = true, description = "") + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("name") @get:JsonProperty("name", required = true) val name: kotlin.String, @Schema(required = true, description = "") + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("photoUrls") @get:JsonProperty("photoUrls", required = true) val photoUrls: kotlin.collections.List, diff --git a/samples/server/petstore/kotlin-spring-declarative-interface/src/main/kotlin/org/openapitools/model/Pet.kt b/samples/server/petstore/kotlin-spring-declarative-interface/src/main/kotlin/org/openapitools/model/Pet.kt index ebd784c67532..818ca34ee824 100644 --- a/samples/server/petstore/kotlin-spring-declarative-interface/src/main/kotlin/org/openapitools/model/Pet.kt +++ b/samples/server/petstore/kotlin-spring-declarative-interface/src/main/kotlin/org/openapitools/model/Pet.kt @@ -32,10 +32,12 @@ import io.swagger.v3.oas.annotations.media.Schema data class Pet( @Schema(example = "doggie", required = true, description = "") + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("name") @get:JsonProperty("name", required = true) val name: kotlin.String, @Schema(required = true, description = "") + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("photoUrls") @get:JsonProperty("photoUrls", required = true) val photoUrls: kotlin.collections.List, diff --git a/samples/server/petstore/kotlin-spring-default/src/main/kotlin/org/openapitools/model/AnyOfUserOrPet.kt b/samples/server/petstore/kotlin-spring-default/src/main/kotlin/org/openapitools/model/AnyOfUserOrPet.kt index b0c7a8a472e2..28f9f7e2cf42 100644 --- a/samples/server/petstore/kotlin-spring-default/src/main/kotlin/org/openapitools/model/AnyOfUserOrPet.kt +++ b/samples/server/petstore/kotlin-spring-default/src/main/kotlin/org/openapitools/model/AnyOfUserOrPet.kt @@ -41,14 +41,17 @@ import io.swagger.v3.oas.annotations.media.Schema data class AnyOfUserOrPet( @Schema(required = true, description = "") + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("username") @get:JsonProperty("username", required = true) val username: kotlin.String, @Schema(example = "doggie", required = true, description = "") + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("name") @get:JsonProperty("name", required = true) val name: kotlin.String, @Schema(required = true, description = "") + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("photoUrls") @get:JsonProperty("photoUrls", required = true) val photoUrls: kotlin.collections.List, diff --git a/samples/server/petstore/kotlin-spring-default/src/main/kotlin/org/openapitools/model/AnyOfUserOrPetOrArrayString.kt b/samples/server/petstore/kotlin-spring-default/src/main/kotlin/org/openapitools/model/AnyOfUserOrPetOrArrayString.kt index 245556f67207..7e5d66de499d 100644 --- a/samples/server/petstore/kotlin-spring-default/src/main/kotlin/org/openapitools/model/AnyOfUserOrPetOrArrayString.kt +++ b/samples/server/petstore/kotlin-spring-default/src/main/kotlin/org/openapitools/model/AnyOfUserOrPetOrArrayString.kt @@ -41,14 +41,17 @@ import io.swagger.v3.oas.annotations.media.Schema data class AnyOfUserOrPetOrArrayString( @Schema(required = true, description = "") + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("username") @get:JsonProperty("username", required = true) val username: kotlin.String, @Schema(example = "doggie", required = true, description = "") + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("name") @get:JsonProperty("name", required = true) val name: kotlin.String, @Schema(required = true, description = "") + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("photoUrls") @get:JsonProperty("photoUrls", required = true) val photoUrls: kotlin.collections.List, diff --git a/samples/server/petstore/kotlin-spring-default/src/main/kotlin/org/openapitools/model/Pet.kt b/samples/server/petstore/kotlin-spring-default/src/main/kotlin/org/openapitools/model/Pet.kt index edcf36d7df67..ab6822d9644c 100644 --- a/samples/server/petstore/kotlin-spring-default/src/main/kotlin/org/openapitools/model/Pet.kt +++ b/samples/server/petstore/kotlin-spring-default/src/main/kotlin/org/openapitools/model/Pet.kt @@ -32,10 +32,12 @@ import io.swagger.v3.oas.annotations.media.Schema data class Pet( @Schema(example = "doggie", required = true, description = "") + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("name") @get:JsonProperty("name", required = true) val name: kotlin.String, @Schema(required = true, description = "") + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("photoUrls") @get:JsonProperty("photoUrls", required = true) val photoUrls: kotlin.collections.List, diff --git a/samples/server/petstore/kotlin-spring-default/src/main/kotlin/org/openapitools/model/User.kt b/samples/server/petstore/kotlin-spring-default/src/main/kotlin/org/openapitools/model/User.kt index 67857d6d788d..e16108c6b858 100644 --- a/samples/server/petstore/kotlin-spring-default/src/main/kotlin/org/openapitools/model/User.kt +++ b/samples/server/petstore/kotlin-spring-default/src/main/kotlin/org/openapitools/model/User.kt @@ -32,6 +32,7 @@ import io.swagger.v3.oas.annotations.media.Schema data class User( @Schema(required = true, description = "") + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("username") @get:JsonProperty("username", required = true) val username: kotlin.String, diff --git a/samples/server/petstore/kotlin-spring-sealed-interfaces/src/main/kotlin/org/openapitools/model/Pet.kt b/samples/server/petstore/kotlin-spring-sealed-interfaces/src/main/kotlin/org/openapitools/model/Pet.kt index 0de23f8edb3c..4734ca04df3e 100644 --- a/samples/server/petstore/kotlin-spring-sealed-interfaces/src/main/kotlin/org/openapitools/model/Pet.kt +++ b/samples/server/petstore/kotlin-spring-sealed-interfaces/src/main/kotlin/org/openapitools/model/Pet.kt @@ -33,9 +33,11 @@ import jakarta.validation.Valid */ data class Pet( + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("name") @get:JsonProperty("name", required = true) val name: kotlin.String, + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("photoUrls") @get:JsonProperty("photoUrls", required = true) val photoUrls: kotlin.collections.List, diff --git a/samples/server/petstore/kotlin-springboot-3-no-response-entity/src/main/kotlin/org/openapitools/model/Pet.kt b/samples/server/petstore/kotlin-springboot-3-no-response-entity/src/main/kotlin/org/openapitools/model/Pet.kt index 56c523367969..7cf3de7d9c48 100644 --- a/samples/server/petstore/kotlin-springboot-3-no-response-entity/src/main/kotlin/org/openapitools/model/Pet.kt +++ b/samples/server/petstore/kotlin-springboot-3-no-response-entity/src/main/kotlin/org/openapitools/model/Pet.kt @@ -30,9 +30,11 @@ import jakarta.validation.Valid */ data class Pet( + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("name") @get:JsonProperty("name", required = true) val name: kotlin.String, + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("photoUrls") @get:JsonProperty("photoUrls", required = true) val photoUrls: kotlin.collections.List, diff --git a/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/model/Category.kt b/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/model/Category.kt index f44ed4c7ace6..51d9077df63b 100644 --- a/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/model/Category.kt +++ b/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/model/Category.kt @@ -1,7 +1,6 @@ package org.openapitools.model import java.util.Objects -import com.fasterxml.jackson.annotation.JsonInclude import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.annotation.JsonSetter import com.fasterxml.jackson.annotation.Nulls @@ -22,13 +21,11 @@ import jakarta.validation.Valid */ data class Category( - @field:JsonInclude(JsonInclude.Include.NON_NULL) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("id") @get:JsonProperty("id") val id: kotlin.Long? = null, @get:Pattern(regexp="^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") - @field:JsonInclude(JsonInclude.Include.NON_NULL) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("name") @get:JsonProperty("name") val name: kotlin.String? = null diff --git a/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt b/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt index 8d84914db2ba..7689e944371e 100644 --- a/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt +++ b/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt @@ -1,7 +1,6 @@ package org.openapitools.model import java.util.Objects -import com.fasterxml.jackson.annotation.JsonInclude import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.annotation.JsonSetter import com.fasterxml.jackson.annotation.Nulls @@ -23,17 +22,14 @@ import jakarta.validation.Valid */ data class ModelApiResponse( - @field:JsonInclude(JsonInclude.Include.NON_NULL) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("code") @get:JsonProperty("code") val code: kotlin.Int? = null, - @field:JsonInclude(JsonInclude.Include.NON_NULL) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("type") @get:JsonProperty("type") val type: kotlin.String? = null, - @field:JsonInclude(JsonInclude.Include.NON_NULL) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("message") @get:JsonProperty("message") val message: kotlin.String? = null diff --git a/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/model/Order.kt b/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/model/Order.kt index 486848e14599..c14d1323ba00 100644 --- a/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/model/Order.kt +++ b/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/model/Order.kt @@ -2,7 +2,6 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonCreator -import com.fasterxml.jackson.annotation.JsonInclude import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.annotation.JsonSetter import com.fasterxml.jackson.annotation.JsonValue @@ -28,32 +27,26 @@ import jakarta.validation.Valid */ data class Order( - @field:JsonInclude(JsonInclude.Include.NON_NULL) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("id") @get:JsonProperty("id") val id: kotlin.Long? = null, - @field:JsonInclude(JsonInclude.Include.NON_NULL) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("petId") @get:JsonProperty("petId") val petId: kotlin.Long? = null, - @field:JsonInclude(JsonInclude.Include.NON_NULL) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("quantity") @get:JsonProperty("quantity") val quantity: kotlin.Int? = null, - @field:JsonInclude(JsonInclude.Include.NON_NULL) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("shipDate") @get:JsonProperty("shipDate") val shipDate: java.time.OffsetDateTime? = null, - @field:JsonInclude(JsonInclude.Include.NON_NULL) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("status") @get:JsonProperty("status") val status: Order.Status? = null, - @field:JsonInclude(JsonInclude.Include.NON_NULL) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("complete") @get:JsonProperty("complete") val complete: kotlin.Boolean? = false diff --git a/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/model/Pet.kt b/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/model/Pet.kt index 56c523367969..35b6f48617a1 100644 --- a/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/model/Pet.kt +++ b/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/model/Pet.kt @@ -30,31 +30,29 @@ import jakarta.validation.Valid */ data class Pet( + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("name") @get:JsonProperty("name", required = true) val name: kotlin.String, + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("photoUrls") @get:JsonProperty("photoUrls", required = true) val photoUrls: kotlin.collections.List, - @field:JsonInclude(JsonInclude.Include.NON_NULL) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("id") @get:JsonProperty("id") val id: kotlin.Long? = null, @field:Valid - @field:JsonInclude(JsonInclude.Include.NON_NULL) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("category") @get:JsonProperty("category") val category: Category? = null, @field:Valid - @field:JsonInclude(JsonInclude.Include.NON_NULL) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("tags") @get:JsonProperty("tags") val tags: kotlin.collections.List? = null, @Deprecated(message = "") - @field:JsonInclude(JsonInclude.Include.NON_NULL) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("status") @get:JsonProperty("status") val status: Pet.Status? = null diff --git a/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/model/Tag.kt b/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/model/Tag.kt index e3ec341838e6..38364c2ba7a2 100644 --- a/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/model/Tag.kt +++ b/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/model/Tag.kt @@ -1,7 +1,6 @@ package org.openapitools.model import java.util.Objects -import com.fasterxml.jackson.annotation.JsonInclude import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.annotation.JsonSetter import com.fasterxml.jackson.annotation.Nulls @@ -22,12 +21,10 @@ import jakarta.validation.Valid */ data class Tag( - @field:JsonInclude(JsonInclude.Include.NON_NULL) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("id") @get:JsonProperty("id") val id: kotlin.Long? = null, - @field:JsonInclude(JsonInclude.Include.NON_NULL) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("name") @get:JsonProperty("name") val name: kotlin.String? = null diff --git a/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/model/User.kt b/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/model/User.kt index 93294737c422..268dc150996d 100644 --- a/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/model/User.kt +++ b/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/model/User.kt @@ -1,7 +1,6 @@ package org.openapitools.model import java.util.Objects -import com.fasterxml.jackson.annotation.JsonInclude import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.annotation.JsonSetter import com.fasterxml.jackson.annotation.Nulls @@ -28,42 +27,34 @@ import jakarta.validation.Valid */ data class User( - @field:JsonInclude(JsonInclude.Include.NON_NULL) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("id") @get:JsonProperty("id") val id: kotlin.Long? = null, - @field:JsonInclude(JsonInclude.Include.NON_NULL) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("username") @get:JsonProperty("username") val username: kotlin.String? = null, - @field:JsonInclude(JsonInclude.Include.NON_NULL) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("firstName") @get:JsonProperty("firstName") val firstName: kotlin.String? = null, - @field:JsonInclude(JsonInclude.Include.NON_NULL) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("lastName") @get:JsonProperty("lastName") val lastName: kotlin.String? = null, - @field:JsonInclude(JsonInclude.Include.NON_NULL) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("email") @get:JsonProperty("email") val email: kotlin.String? = null, - @field:JsonInclude(JsonInclude.Include.NON_NULL) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("password") @get:JsonProperty("password") val password: kotlin.String? = null, - @field:JsonInclude(JsonInclude.Include.NON_NULL) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("phone") @get:JsonProperty("phone") val phone: kotlin.String? = null, - @field:JsonInclude(JsonInclude.Include.NON_NULL) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("userStatus") @get:JsonProperty("userStatus") val userStatus: kotlin.Int? = null diff --git a/samples/server/petstore/kotlin-springboot-4/src/main/kotlin/org/openapitools/model/Pet.kt b/samples/server/petstore/kotlin-springboot-4/src/main/kotlin/org/openapitools/model/Pet.kt index 56c523367969..7cf3de7d9c48 100644 --- a/samples/server/petstore/kotlin-springboot-4/src/main/kotlin/org/openapitools/model/Pet.kt +++ b/samples/server/petstore/kotlin-springboot-4/src/main/kotlin/org/openapitools/model/Pet.kt @@ -30,9 +30,11 @@ import jakarta.validation.Valid */ data class Pet( + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("name") @get:JsonProperty("name", required = true) val name: kotlin.String, + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("photoUrls") @get:JsonProperty("photoUrls", required = true) val photoUrls: kotlin.collections.List, diff --git a/samples/server/petstore/kotlin-springboot-additionalproperties/src/main/kotlin/org/openapitools/model/Pet.kt b/samples/server/petstore/kotlin-springboot-additionalproperties/src/main/kotlin/org/openapitools/model/Pet.kt index c076750eb99a..f6f096f6eed4 100644 --- a/samples/server/petstore/kotlin-springboot-additionalproperties/src/main/kotlin/org/openapitools/model/Pet.kt +++ b/samples/server/petstore/kotlin-springboot-additionalproperties/src/main/kotlin/org/openapitools/model/Pet.kt @@ -30,9 +30,11 @@ import jakarta.validation.Valid */ data class Pet( + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("name") @get:JsonProperty("name", required = true) val name: kotlin.String, + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("photoUrls") @get:JsonProperty("photoUrls", required = true) val photoUrls: kotlin.collections.List, diff --git a/samples/server/petstore/kotlin-springboot-bigdecimal-default/src/main/kotlin/org/openapitools/model/Apa.kt b/samples/server/petstore/kotlin-springboot-bigdecimal-default/src/main/kotlin/org/openapitools/model/Apa.kt index 70d1f73e208f..9ec6249ca10e 100644 --- a/samples/server/petstore/kotlin-springboot-bigdecimal-default/src/main/kotlin/org/openapitools/model/Apa.kt +++ b/samples/server/petstore/kotlin-springboot-bigdecimal-default/src/main/kotlin/org/openapitools/model/Apa.kt @@ -28,10 +28,12 @@ import io.swagger.v3.oas.annotations.media.Schema data class Apa( @Schema(required = true, description = "") + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("bepa") @get:JsonProperty("bepa", required = true) val bepa: java.math.BigDecimal = java.math.BigDecimal("0"), @Schema(required = true, description = "") + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("cepa") @get:JsonProperty("cepa", required = true) val cepa: java.math.BigDecimal = java.math.BigDecimal("6.28318"), diff --git a/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/model/Pet.kt b/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/model/Pet.kt index 0aa99a764a76..7cd760e87cc8 100644 --- a/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/model/Pet.kt +++ b/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/model/Pet.kt @@ -32,10 +32,12 @@ import io.swagger.v3.oas.annotations.media.Schema data class Pet( @Schema(example = "doggie", required = true, description = "") + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("name") @get:JsonProperty("name", required = true) val name: kotlin.String, @Schema(required = true, description = "") + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("photoUrls") @get:JsonProperty("photoUrls", required = true) val photoUrls: kotlin.collections.List, diff --git a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/model/Pet.kt b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/model/Pet.kt index 45c87638f15f..0a072512fd08 100644 --- a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/model/Pet.kt +++ b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/model/Pet.kt @@ -32,10 +32,12 @@ import io.swagger.v3.oas.annotations.media.Schema data class Pet( @Schema(example = "doggie", required = true, description = "") + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("name") @get:JsonProperty("name", required = true) val name: kotlin.String, @Schema(required = true, description = "") + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("photoUrls") @get:JsonProperty("photoUrls", required = true) val photoUrls: kotlin.collections.List, diff --git a/samples/server/petstore/kotlin-springboot-include-http-request-context-delegate/src/main/kotlin/org/openapitools/model/Cat.kt b/samples/server/petstore/kotlin-springboot-include-http-request-context-delegate/src/main/kotlin/org/openapitools/model/Cat.kt index 4db812f3390c..0869716cacdd 100644 --- a/samples/server/petstore/kotlin-springboot-include-http-request-context-delegate/src/main/kotlin/org/openapitools/model/Cat.kt +++ b/samples/server/petstore/kotlin-springboot-include-http-request-context-delegate/src/main/kotlin/org/openapitools/model/Cat.kt @@ -37,14 +37,17 @@ import io.swagger.annotations.ApiModelProperty data class Cat( @ApiModelProperty(required = true, value = "") + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("name") @get:JsonProperty("name", required = true) override val name: kotlin.String, @ApiModelProperty(required = true, value = "") + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("photoUrls") @get:JsonProperty("photoUrls", required = true) override val photoUrls: kotlin.collections.List, @ApiModelProperty(required = true, value = "") + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("petType") @get:JsonProperty("petType", required = true) override val petType: kotlin.String, diff --git a/samples/server/petstore/kotlin-springboot-include-http-request-context-delegate/src/main/kotlin/org/openapitools/model/Dog.kt b/samples/server/petstore/kotlin-springboot-include-http-request-context-delegate/src/main/kotlin/org/openapitools/model/Dog.kt index 301b4c80b12f..9cd0d8edc3f8 100644 --- a/samples/server/petstore/kotlin-springboot-include-http-request-context-delegate/src/main/kotlin/org/openapitools/model/Dog.kt +++ b/samples/server/petstore/kotlin-springboot-include-http-request-context-delegate/src/main/kotlin/org/openapitools/model/Dog.kt @@ -38,26 +38,32 @@ import io.swagger.annotations.ApiModelProperty data class Dog( @ApiModelProperty(required = true, value = "") + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("bark") @get:JsonProperty("bark", required = true) val bark: kotlin.Boolean, @ApiModelProperty(required = true, value = "") + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("breed") @get:JsonProperty("breed", required = true) val breed: Dog.Breed, @ApiModelProperty(required = true, value = "Whether the dog enjoys fetching") + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("likesFetch") @get:JsonProperty("likesFetch", required = true) override val likesFetch: kotlin.Boolean, @ApiModelProperty(required = true, value = "") + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("name") @get:JsonProperty("name", required = true) override val name: kotlin.String, @ApiModelProperty(required = true, value = "") + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("photoUrls") @get:JsonProperty("photoUrls", required = true) override val photoUrls: kotlin.collections.List, @ApiModelProperty(required = true, value = "") + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("petType") @get:JsonProperty("petType", required = true) override val petType: kotlin.String, diff --git a/samples/server/petstore/kotlin-springboot-integer-enum/src/main/kotlin/org/openapitools/model/ApiError.kt b/samples/server/petstore/kotlin-springboot-integer-enum/src/main/kotlin/org/openapitools/model/ApiError.kt index c7effc69943c..eb40a7638b18 100644 --- a/samples/server/petstore/kotlin-springboot-integer-enum/src/main/kotlin/org/openapitools/model/ApiError.kt +++ b/samples/server/petstore/kotlin-springboot-integer-enum/src/main/kotlin/org/openapitools/model/ApiError.kt @@ -26,6 +26,7 @@ import jakarta.validation.Valid */ data class ApiError( + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("errorCode") @get:JsonProperty("errorCode", required = true) val errorCode: ApiError.ErrorCode, diff --git a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Category.kt b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Category.kt index 6c4d3c5f36ee..521ef45226d1 100644 --- a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Category.kt +++ b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Category.kt @@ -24,13 +24,13 @@ import io.swagger.v3.oas.annotations.media.Schema data class Category( @Schema(description = "") - @field:JsonInclude(JsonInclude.Include.NON_NULL) + @field:JsonInclude(JsonInclude.Include.NON_DEFAULT) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("id") @get:JsonProperty("id") var id: kotlin.Long? = null, @Schema(description = "") - @field:JsonInclude(JsonInclude.Include.NON_NULL) + @field:JsonInclude(JsonInclude.Include.NON_DEFAULT) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("name") @get:JsonProperty("name") var name: kotlin.String? = null diff --git a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt index 9886cbcdc3ad..00e04fb41353 100644 --- a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt +++ b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt @@ -25,19 +25,19 @@ import io.swagger.v3.oas.annotations.media.Schema data class ModelApiResponse( @Schema(description = "") - @field:JsonInclude(JsonInclude.Include.NON_NULL) + @field:JsonInclude(JsonInclude.Include.NON_DEFAULT) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("code") @get:JsonProperty("code") var code: kotlin.Int? = null, @Schema(description = "") - @field:JsonInclude(JsonInclude.Include.NON_NULL) + @field:JsonInclude(JsonInclude.Include.NON_DEFAULT) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("type") @get:JsonProperty("type") var type: kotlin.String? = null, @Schema(description = "") - @field:JsonInclude(JsonInclude.Include.NON_NULL) + @field:JsonInclude(JsonInclude.Include.NON_DEFAULT) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("message") @get:JsonProperty("message") var message: kotlin.String? = null diff --git a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Order.kt b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Order.kt index 7d68cd3f584e..acbf3a877d82 100644 --- a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Order.kt +++ b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Order.kt @@ -30,37 +30,37 @@ import io.swagger.v3.oas.annotations.media.Schema data class Order( @Schema(description = "") - @field:JsonInclude(JsonInclude.Include.NON_NULL) + @field:JsonInclude(JsonInclude.Include.NON_DEFAULT) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("id") @get:JsonProperty("id") var id: kotlin.Long? = null, @Schema(description = "") - @field:JsonInclude(JsonInclude.Include.NON_NULL) + @field:JsonInclude(JsonInclude.Include.NON_DEFAULT) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("petId") @get:JsonProperty("petId") var petId: kotlin.Long? = null, @Schema(description = "") - @field:JsonInclude(JsonInclude.Include.NON_NULL) + @field:JsonInclude(JsonInclude.Include.NON_DEFAULT) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("quantity") @get:JsonProperty("quantity") var quantity: kotlin.Int? = null, @Schema(description = "") - @field:JsonInclude(JsonInclude.Include.NON_NULL) + @field:JsonInclude(JsonInclude.Include.NON_DEFAULT) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("shipDate") @get:JsonProperty("shipDate") var shipDate: java.time.OffsetDateTime? = null, @Schema(description = "Order Status") - @field:JsonInclude(JsonInclude.Include.NON_NULL) + @field:JsonInclude(JsonInclude.Include.NON_DEFAULT) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("status") @get:JsonProperty("status") var status: Order.Status? = null, @Schema(description = "") - @field:JsonInclude(JsonInclude.Include.NON_NULL) + @field:JsonInclude(JsonInclude.Include.NON_DEFAULT) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("complete") @get:JsonProperty("complete") var complete: kotlin.Boolean? = false diff --git a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Pet.kt b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Pet.kt index 3f3a4d005b5b..687cc12f771f 100644 --- a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Pet.kt +++ b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Pet.kt @@ -32,35 +32,37 @@ import io.swagger.v3.oas.annotations.media.Schema data class Pet( @Schema(example = "doggie", required = true, description = "") + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("name") @get:JsonProperty("name", required = true) var name: kotlin.String, @Schema(required = true, description = "") + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("photoUrls") @get:JsonProperty("photoUrls", required = true) var photoUrls: kotlin.collections.MutableList, @Schema(description = "") - @field:JsonInclude(JsonInclude.Include.NON_NULL) + @field:JsonInclude(JsonInclude.Include.NON_DEFAULT) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("id") @get:JsonProperty("id") var id: kotlin.Long? = null, @field:Valid @Schema(description = "") - @field:JsonInclude(JsonInclude.Include.NON_NULL) + @field:JsonInclude(JsonInclude.Include.NON_DEFAULT) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("category") @get:JsonProperty("category") var category: Category? = null, @field:Valid @Schema(description = "") - @field:JsonInclude(JsonInclude.Include.NON_NULL) + @field:JsonInclude(JsonInclude.Include.NON_DEFAULT) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("tags") @get:JsonProperty("tags") var tags: kotlin.collections.MutableList? = null, @Schema(description = "pet status in the store") - @field:JsonInclude(JsonInclude.Include.NON_NULL) + @field:JsonInclude(JsonInclude.Include.NON_DEFAULT) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("status") @get:JsonProperty("status") var status: Pet.Status? = null diff --git a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Tag.kt b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Tag.kt index 8dabb08a5f93..858c04d95899 100644 --- a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Tag.kt +++ b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Tag.kt @@ -24,13 +24,13 @@ import io.swagger.v3.oas.annotations.media.Schema data class Tag( @Schema(description = "") - @field:JsonInclude(JsonInclude.Include.NON_NULL) + @field:JsonInclude(JsonInclude.Include.NON_DEFAULT) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("id") @get:JsonProperty("id") var id: kotlin.Long? = null, @Schema(description = "") - @field:JsonInclude(JsonInclude.Include.NON_NULL) + @field:JsonInclude(JsonInclude.Include.NON_DEFAULT) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("name") @get:JsonProperty("name") var name: kotlin.String? = null diff --git a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/User.kt b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/User.kt index 86c750bac0c9..c9063f163fe6 100644 --- a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/User.kt +++ b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/User.kt @@ -30,49 +30,49 @@ import io.swagger.v3.oas.annotations.media.Schema data class User( @Schema(description = "") - @field:JsonInclude(JsonInclude.Include.NON_NULL) + @field:JsonInclude(JsonInclude.Include.NON_DEFAULT) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("id") @get:JsonProperty("id") var id: kotlin.Long? = null, @Schema(description = "") - @field:JsonInclude(JsonInclude.Include.NON_NULL) + @field:JsonInclude(JsonInclude.Include.NON_DEFAULT) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("username") @get:JsonProperty("username") var username: kotlin.String? = null, @Schema(description = "") - @field:JsonInclude(JsonInclude.Include.NON_NULL) + @field:JsonInclude(JsonInclude.Include.NON_DEFAULT) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("firstName") @get:JsonProperty("firstName") var firstName: kotlin.String? = null, @Schema(description = "") - @field:JsonInclude(JsonInclude.Include.NON_NULL) + @field:JsonInclude(JsonInclude.Include.NON_DEFAULT) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("lastName") @get:JsonProperty("lastName") var lastName: kotlin.String? = null, @Schema(description = "") - @field:JsonInclude(JsonInclude.Include.NON_NULL) + @field:JsonInclude(JsonInclude.Include.NON_DEFAULT) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("email") @get:JsonProperty("email") var email: kotlin.String? = null, @Schema(description = "") - @field:JsonInclude(JsonInclude.Include.NON_NULL) + @field:JsonInclude(JsonInclude.Include.NON_DEFAULT) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("password") @get:JsonProperty("password") var password: kotlin.String? = null, @Schema(description = "") - @field:JsonInclude(JsonInclude.Include.NON_NULL) + @field:JsonInclude(JsonInclude.Include.NON_DEFAULT) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("phone") @get:JsonProperty("phone") var phone: kotlin.String? = null, @Schema(description = "User Status") - @field:JsonInclude(JsonInclude.Include.NON_NULL) + @field:JsonInclude(JsonInclude.Include.NON_DEFAULT) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("userStatus") @get:JsonProperty("userStatus") var userStatus: kotlin.Int? = null diff --git a/samples/server/petstore/kotlin-springboot-no-response-entity-delegate/src/main/kotlin/org/openapitools/model/Pet.kt b/samples/server/petstore/kotlin-springboot-no-response-entity-delegate/src/main/kotlin/org/openapitools/model/Pet.kt index d5959182a70f..572741c45089 100644 --- a/samples/server/petstore/kotlin-springboot-no-response-entity-delegate/src/main/kotlin/org/openapitools/model/Pet.kt +++ b/samples/server/petstore/kotlin-springboot-no-response-entity-delegate/src/main/kotlin/org/openapitools/model/Pet.kt @@ -30,9 +30,11 @@ import javax.validation.Valid */ data class Pet( + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("name") @get:JsonProperty("name", required = true) val name: kotlin.String, + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("photoUrls") @get:JsonProperty("photoUrls", required = true) val photoUrls: kotlin.collections.List, diff --git a/samples/server/petstore/kotlin-springboot-no-response-entity/src/main/kotlin/org/openapitools/model/Pet.kt b/samples/server/petstore/kotlin-springboot-no-response-entity/src/main/kotlin/org/openapitools/model/Pet.kt index d5959182a70f..572741c45089 100644 --- a/samples/server/petstore/kotlin-springboot-no-response-entity/src/main/kotlin/org/openapitools/model/Pet.kt +++ b/samples/server/petstore/kotlin-springboot-no-response-entity/src/main/kotlin/org/openapitools/model/Pet.kt @@ -30,9 +30,11 @@ import javax.validation.Valid */ data class Pet( + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("name") @get:JsonProperty("name", required = true) val name: kotlin.String, + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("photoUrls") @get:JsonProperty("photoUrls", required = true) val photoUrls: kotlin.collections.List, diff --git a/samples/server/petstore/kotlin-springboot-paged-model/src/main/kotlin/org/openapitools/model/PageMeta.kt b/samples/server/petstore/kotlin-springboot-paged-model/src/main/kotlin/org/openapitools/model/PageMeta.kt index d2938312720f..a40d0746abed 100644 --- a/samples/server/petstore/kotlin-springboot-paged-model/src/main/kotlin/org/openapitools/model/PageMeta.kt +++ b/samples/server/petstore/kotlin-springboot-paged-model/src/main/kotlin/org/openapitools/model/PageMeta.kt @@ -1,6 +1,7 @@ package org.openapitools.model import java.util.Objects +import com.fasterxml.jackson.annotation.JsonInclude import com.fasterxml.jackson.annotation.JsonProperty import jakarta.validation.constraints.DecimalMax import jakarta.validation.constraints.DecimalMin @@ -21,15 +22,19 @@ import jakarta.validation.Valid */ data class PageMeta( + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("size") @get:JsonProperty("size", required = true) val propertySize: kotlin.Long, + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("number") @get:JsonProperty("number", required = true) val number: kotlin.Long, + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("totalElements") @get:JsonProperty("totalElements", required = true) val totalElements: kotlin.Long, + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("totalPages") @get:JsonProperty("totalPages", required = true) val totalPages: kotlin.Long ) : java.io.Serializable { diff --git a/samples/server/petstore/kotlin-springboot-paged-model/src/main/kotlin/org/openapitools/model/Pet.kt b/samples/server/petstore/kotlin-springboot-paged-model/src/main/kotlin/org/openapitools/model/Pet.kt index 983d1f583f52..1fef46231b24 100644 --- a/samples/server/petstore/kotlin-springboot-paged-model/src/main/kotlin/org/openapitools/model/Pet.kt +++ b/samples/server/petstore/kotlin-springboot-paged-model/src/main/kotlin/org/openapitools/model/Pet.kt @@ -23,6 +23,7 @@ import jakarta.validation.Valid */ data class Pet( + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("name") @get:JsonProperty("name", required = true) val name: kotlin.String, diff --git a/samples/server/petstore/kotlin-springboot-reactive-without-flow/src/main/kotlin/org/openapitools/model/Pet.kt b/samples/server/petstore/kotlin-springboot-reactive-without-flow/src/main/kotlin/org/openapitools/model/Pet.kt index 45c87638f15f..0a072512fd08 100644 --- a/samples/server/petstore/kotlin-springboot-reactive-without-flow/src/main/kotlin/org/openapitools/model/Pet.kt +++ b/samples/server/petstore/kotlin-springboot-reactive-without-flow/src/main/kotlin/org/openapitools/model/Pet.kt @@ -32,10 +32,12 @@ import io.swagger.v3.oas.annotations.media.Schema data class Pet( @Schema(example = "doggie", required = true, description = "") + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("name") @get:JsonProperty("name", required = true) val name: kotlin.String, @Schema(required = true, description = "") + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("photoUrls") @get:JsonProperty("photoUrls", required = true) val photoUrls: kotlin.collections.List, diff --git a/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Pet.kt b/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Pet.kt index 45c87638f15f..0a072512fd08 100644 --- a/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Pet.kt +++ b/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Pet.kt @@ -32,10 +32,12 @@ import io.swagger.v3.oas.annotations.media.Schema data class Pet( @Schema(example = "doggie", required = true, description = "") + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("name") @get:JsonProperty("name", required = true) val name: kotlin.String, @Schema(required = true, description = "") + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("photoUrls") @get:JsonProperty("photoUrls", required = true) val photoUrls: kotlin.collections.List, diff --git a/samples/server/petstore/kotlin-springboot-request-cookie/src/main/kotlin/org/openapitools/model/Cat.kt b/samples/server/petstore/kotlin-springboot-request-cookie/src/main/kotlin/org/openapitools/model/Cat.kt index 148d5e215f21..3ded71b1e461 100644 --- a/samples/server/petstore/kotlin-springboot-request-cookie/src/main/kotlin/org/openapitools/model/Cat.kt +++ b/samples/server/petstore/kotlin-springboot-request-cookie/src/main/kotlin/org/openapitools/model/Cat.kt @@ -26,6 +26,7 @@ import io.swagger.v3.oas.annotations.media.Schema data class Cat( @Schema(required = true, description = "") + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("className") @get:JsonProperty("className", required = true) override val className: kotlin.String, diff --git a/samples/server/petstore/kotlin-springboot-request-cookie/src/main/kotlin/org/openapitools/model/Category.kt b/samples/server/petstore/kotlin-springboot-request-cookie/src/main/kotlin/org/openapitools/model/Category.kt index 0349895b01be..48a8f76d11bf 100644 --- a/samples/server/petstore/kotlin-springboot-request-cookie/src/main/kotlin/org/openapitools/model/Category.kt +++ b/samples/server/petstore/kotlin-springboot-request-cookie/src/main/kotlin/org/openapitools/model/Category.kt @@ -24,6 +24,7 @@ import io.swagger.v3.oas.annotations.media.Schema data class Category( @Schema(required = true, description = "") + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("name") @get:JsonProperty("name", required = true) val name: kotlin.String = "default-name", diff --git a/samples/server/petstore/kotlin-springboot-request-cookie/src/main/kotlin/org/openapitools/model/Dog.kt b/samples/server/petstore/kotlin-springboot-request-cookie/src/main/kotlin/org/openapitools/model/Dog.kt index 856de1f1a7b0..f6565a59f920 100644 --- a/samples/server/petstore/kotlin-springboot-request-cookie/src/main/kotlin/org/openapitools/model/Dog.kt +++ b/samples/server/petstore/kotlin-springboot-request-cookie/src/main/kotlin/org/openapitools/model/Dog.kt @@ -26,6 +26,7 @@ import io.swagger.v3.oas.annotations.media.Schema data class Dog( @Schema(required = true, description = "") + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("className") @get:JsonProperty("className", required = true) override val className: kotlin.String, diff --git a/samples/server/petstore/kotlin-springboot-request-cookie/src/main/kotlin/org/openapitools/model/Pet.kt b/samples/server/petstore/kotlin-springboot-request-cookie/src/main/kotlin/org/openapitools/model/Pet.kt index 3933754b80f8..664fcc2f0214 100644 --- a/samples/server/petstore/kotlin-springboot-request-cookie/src/main/kotlin/org/openapitools/model/Pet.kt +++ b/samples/server/petstore/kotlin-springboot-request-cookie/src/main/kotlin/org/openapitools/model/Pet.kt @@ -32,10 +32,12 @@ import io.swagger.v3.oas.annotations.media.Schema data class Pet( @Schema(example = "doggie", required = true, description = "") + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("name") @get:JsonProperty("name", required = true) val name: kotlin.String, @Schema(required = true, description = "") + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("photoUrls") @get:JsonProperty("photoUrls", required = true) val photoUrls: kotlin.collections.Set, diff --git a/samples/server/petstore/kotlin-springboot-sort-validation/src/main/kotlin/org/openapitools/model/NullableModel.kt b/samples/server/petstore/kotlin-springboot-sort-validation/src/main/kotlin/org/openapitools/model/NullableModel.kt index 9ed84667a2bd..808f5695c0c8 100644 --- a/samples/server/petstore/kotlin-springboot-sort-validation/src/main/kotlin/org/openapitools/model/NullableModel.kt +++ b/samples/server/petstore/kotlin-springboot-sort-validation/src/main/kotlin/org/openapitools/model/NullableModel.kt @@ -25,9 +25,11 @@ import jakarta.validation.Valid */ data class NullableModel( + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("requiredNonNullable") @get:JsonProperty("requiredNonNullable", required = true) val requiredNonNullable: kotlin.String, + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("requiredNullable") @get:JsonProperty("requiredNullable", required = true) val requiredNullable: kotlin.String?, @@ -36,7 +38,6 @@ data class NullableModel( @param:JsonProperty("optionalNonNullable") @get:JsonProperty("optionalNonNullable") val optionalNonNullable: kotlin.String? = null, - @field:JsonInclude(JsonInclude.Include.NON_ABSENT) @param:JsonProperty("optionalNullable") @get:JsonProperty("optionalNullable") val optionalNullable: JsonNullable = JsonNullable.undefined() ) : java.io.Serializable { diff --git a/samples/server/petstore/kotlin-springboot-sort-validation/src/main/kotlin/org/openapitools/model/Pet.kt b/samples/server/petstore/kotlin-springboot-sort-validation/src/main/kotlin/org/openapitools/model/Pet.kt index 11b4702d5b38..3adf7cb3f88b 100644 --- a/samples/server/petstore/kotlin-springboot-sort-validation/src/main/kotlin/org/openapitools/model/Pet.kt +++ b/samples/server/petstore/kotlin-springboot-sort-validation/src/main/kotlin/org/openapitools/model/Pet.kt @@ -23,6 +23,7 @@ import jakarta.validation.Valid */ data class Pet( + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("name") @get:JsonProperty("name", required = true) val name: kotlin.String, diff --git a/samples/server/petstore/kotlin-springboot-source-swagger1/src/main/kotlin/org/openapitools/model/Pet.kt b/samples/server/petstore/kotlin-springboot-source-swagger1/src/main/kotlin/org/openapitools/model/Pet.kt index 3de771e29973..121502d59510 100644 --- a/samples/server/petstore/kotlin-springboot-source-swagger1/src/main/kotlin/org/openapitools/model/Pet.kt +++ b/samples/server/petstore/kotlin-springboot-source-swagger1/src/main/kotlin/org/openapitools/model/Pet.kt @@ -32,10 +32,12 @@ import io.swagger.annotations.ApiModelProperty data class Pet( @ApiModelProperty(example = "doggie", required = true, value = "") + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("name") @get:JsonProperty("name", required = true) val name: kotlin.String, @ApiModelProperty(required = true, value = "") + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("photoUrls") @get:JsonProperty("photoUrls", required = true) val photoUrls: kotlin.collections.List, diff --git a/samples/server/petstore/kotlin-springboot-source-swagger2/src/main/kotlin/org/openapitools/model/Pet.kt b/samples/server/petstore/kotlin-springboot-source-swagger2/src/main/kotlin/org/openapitools/model/Pet.kt index 2f4708fe0104..298428490fdf 100644 --- a/samples/server/petstore/kotlin-springboot-source-swagger2/src/main/kotlin/org/openapitools/model/Pet.kt +++ b/samples/server/petstore/kotlin-springboot-source-swagger2/src/main/kotlin/org/openapitools/model/Pet.kt @@ -32,10 +32,12 @@ import io.swagger.v3.oas.annotations.media.Schema data class Pet( @Schema(example = "doggie", required = true, description = "") + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("name") @get:JsonProperty("name", required = true) val name: kotlin.String, @Schema(required = true, description = "") + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("photoUrls") @get:JsonProperty("photoUrls", required = true) val photoUrls: kotlin.collections.List, diff --git a/samples/server/petstore/kotlin-springboot-x-kotlin-implements/src/main/kotlin/org/openapitools/model/Cat.kt b/samples/server/petstore/kotlin-springboot-x-kotlin-implements/src/main/kotlin/org/openapitools/model/Cat.kt index 4db812f3390c..0869716cacdd 100644 --- a/samples/server/petstore/kotlin-springboot-x-kotlin-implements/src/main/kotlin/org/openapitools/model/Cat.kt +++ b/samples/server/petstore/kotlin-springboot-x-kotlin-implements/src/main/kotlin/org/openapitools/model/Cat.kt @@ -37,14 +37,17 @@ import io.swagger.annotations.ApiModelProperty data class Cat( @ApiModelProperty(required = true, value = "") + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("name") @get:JsonProperty("name", required = true) override val name: kotlin.String, @ApiModelProperty(required = true, value = "") + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("photoUrls") @get:JsonProperty("photoUrls", required = true) override val photoUrls: kotlin.collections.List, @ApiModelProperty(required = true, value = "") + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("petType") @get:JsonProperty("petType", required = true) override val petType: kotlin.String, diff --git a/samples/server/petstore/kotlin-springboot-x-kotlin-implements/src/main/kotlin/org/openapitools/model/Dog.kt b/samples/server/petstore/kotlin-springboot-x-kotlin-implements/src/main/kotlin/org/openapitools/model/Dog.kt index 2202f4aae40b..911756347da6 100644 --- a/samples/server/petstore/kotlin-springboot-x-kotlin-implements/src/main/kotlin/org/openapitools/model/Dog.kt +++ b/samples/server/petstore/kotlin-springboot-x-kotlin-implements/src/main/kotlin/org/openapitools/model/Dog.kt @@ -38,26 +38,32 @@ import io.swagger.annotations.ApiModelProperty data class Dog( @ApiModelProperty(required = true, value = "") + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("bark") @get:JsonProperty("bark", required = true) override val bark: kotlin.Boolean, @ApiModelProperty(required = true, value = "") + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("breed") @get:JsonProperty("breed", required = true) override val breed: Dog.Breed, @ApiModelProperty(required = true, value = "Whether the dog enjoys fetching") + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("likesFetch") @get:JsonProperty("likesFetch", required = true) override val likesFetch: kotlin.Boolean, @ApiModelProperty(required = true, value = "") + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("name") @get:JsonProperty("name", required = true) override val name: kotlin.String, @ApiModelProperty(required = true, value = "") + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("photoUrls") @get:JsonProperty("photoUrls", required = true) override val photoUrls: kotlin.collections.List, @ApiModelProperty(required = true, value = "") + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("petType") @get:JsonProperty("petType", required = true) override val petType: kotlin.String, diff --git a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Category.kt b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Category.kt index 8699b8c6b258..d86ba248177e 100644 --- a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Category.kt +++ b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Category.kt @@ -22,12 +22,12 @@ import javax.validation.Valid */ data class Category( - @field:JsonInclude(JsonInclude.Include.NON_NULL) + @field:JsonInclude(JsonInclude.Include.NON_EMPTY) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("id") @get:JsonProperty("id") val id: kotlin.Long? = null, - @field:JsonInclude(JsonInclude.Include.NON_NULL) + @field:JsonInclude(JsonInclude.Include.NON_EMPTY) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("name") @get:JsonProperty("name") val name: kotlin.String? = null diff --git a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt index 876981873b0e..748516067b24 100644 --- a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt +++ b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt @@ -23,17 +23,17 @@ import javax.validation.Valid */ data class ModelApiResponse( - @field:JsonInclude(JsonInclude.Include.NON_NULL) + @field:JsonInclude(JsonInclude.Include.NON_EMPTY) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("code") @get:JsonProperty("code") val code: kotlin.Int? = null, - @field:JsonInclude(JsonInclude.Include.NON_NULL) + @field:JsonInclude(JsonInclude.Include.NON_EMPTY) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("type") @get:JsonProperty("type") val type: kotlin.String? = null, - @field:JsonInclude(JsonInclude.Include.NON_NULL) + @field:JsonInclude(JsonInclude.Include.NON_EMPTY) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("message") @get:JsonProperty("message") val message: kotlin.String? = null diff --git a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Order.kt b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Order.kt index 05b5fbbae3f3..10df079f91ab 100644 --- a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Order.kt +++ b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Order.kt @@ -29,32 +29,32 @@ import javax.validation.Valid */ data class Order( - @field:JsonInclude(JsonInclude.Include.NON_NULL) + @field:JsonInclude(JsonInclude.Include.NON_EMPTY) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("id") @get:JsonProperty("id") val id: kotlin.Long? = null, - @field:JsonInclude(JsonInclude.Include.NON_NULL) + @field:JsonInclude(JsonInclude.Include.NON_EMPTY) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("petId") @get:JsonProperty("petId") val petId: kotlin.Long? = null, - @field:JsonInclude(JsonInclude.Include.NON_NULL) + @field:JsonInclude(JsonInclude.Include.NON_EMPTY) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("quantity") @get:JsonProperty("quantity") val quantity: kotlin.Int? = null, - @field:JsonInclude(JsonInclude.Include.NON_NULL) + @field:JsonInclude(JsonInclude.Include.NON_EMPTY) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("shipDate") @get:JsonProperty("shipDate") val shipDate: java.time.OffsetDateTime? = null, - @field:JsonInclude(JsonInclude.Include.NON_NULL) + @field:JsonInclude(JsonInclude.Include.NON_EMPTY) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("status") @get:JsonProperty("status") val status: Order.Status? = null, - @field:JsonInclude(JsonInclude.Include.NON_NULL) + @field:JsonInclude(JsonInclude.Include.NON_EMPTY) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("complete") @get:JsonProperty("complete") val complete: kotlin.Boolean? = false diff --git a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Pet.kt b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Pet.kt index a94d6438c2b5..e4dd73bb038b 100644 --- a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Pet.kt +++ b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Pet.kt @@ -31,30 +31,32 @@ import javax.validation.Valid */ data class Pet( + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("name") @get:JsonProperty("name", required = true) val name: kotlin.String, + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("photoUrls") @get:JsonProperty("photoUrls", required = true) val photoUrls: kotlin.collections.List, - @field:JsonInclude(JsonInclude.Include.NON_NULL) + @field:JsonInclude(JsonInclude.Include.NON_EMPTY) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("id") @get:JsonProperty("id") val id: kotlin.Long? = null, @field:Valid - @field:JsonInclude(JsonInclude.Include.NON_NULL) + @field:JsonInclude(JsonInclude.Include.NON_EMPTY) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("category") @get:JsonProperty("category") val category: Category? = null, @field:Valid - @field:JsonInclude(JsonInclude.Include.NON_NULL) + @field:JsonInclude(JsonInclude.Include.NON_EMPTY) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("tags") @get:JsonProperty("tags") val tags: kotlin.collections.List? = null, - @field:JsonInclude(JsonInclude.Include.NON_NULL) + @field:JsonInclude(JsonInclude.Include.NON_EMPTY) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("status") @get:JsonProperty("status") val status: Pet.Status? = null diff --git a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Tag.kt b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Tag.kt index cd1a35d618e7..d697b5ebfa6e 100644 --- a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Tag.kt +++ b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Tag.kt @@ -22,12 +22,12 @@ import javax.validation.Valid */ data class Tag( - @field:JsonInclude(JsonInclude.Include.NON_NULL) + @field:JsonInclude(JsonInclude.Include.NON_EMPTY) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("id") @get:JsonProperty("id") val id: kotlin.Long? = null, - @field:JsonInclude(JsonInclude.Include.NON_NULL) + @field:JsonInclude(JsonInclude.Include.NON_EMPTY) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("name") @get:JsonProperty("name") val name: kotlin.String? = null diff --git a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/User.kt b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/User.kt index 12b33d8f20a6..d7b4d95ef2c8 100644 --- a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/User.kt +++ b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/User.kt @@ -28,42 +28,42 @@ import javax.validation.Valid */ data class User( - @field:JsonInclude(JsonInclude.Include.NON_NULL) + @field:JsonInclude(JsonInclude.Include.NON_EMPTY) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("id") @get:JsonProperty("id") val id: kotlin.Long? = null, - @field:JsonInclude(JsonInclude.Include.NON_NULL) + @field:JsonInclude(JsonInclude.Include.NON_EMPTY) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("username") @get:JsonProperty("username") val username: kotlin.String? = null, - @field:JsonInclude(JsonInclude.Include.NON_NULL) + @field:JsonInclude(JsonInclude.Include.NON_EMPTY) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("firstName") @get:JsonProperty("firstName") val firstName: kotlin.String? = null, - @field:JsonInclude(JsonInclude.Include.NON_NULL) + @field:JsonInclude(JsonInclude.Include.NON_EMPTY) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("lastName") @get:JsonProperty("lastName") val lastName: kotlin.String? = null, - @field:JsonInclude(JsonInclude.Include.NON_NULL) + @field:JsonInclude(JsonInclude.Include.NON_EMPTY) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("email") @get:JsonProperty("email") val email: kotlin.String? = null, - @field:JsonInclude(JsonInclude.Include.NON_NULL) + @field:JsonInclude(JsonInclude.Include.NON_EMPTY) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("password") @get:JsonProperty("password") val password: kotlin.String? = null, - @field:JsonInclude(JsonInclude.Include.NON_NULL) + @field:JsonInclude(JsonInclude.Include.NON_EMPTY) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("phone") @get:JsonProperty("phone") val phone: kotlin.String? = null, - @field:JsonInclude(JsonInclude.Include.NON_NULL) + @field:JsonInclude(JsonInclude.Include.NON_EMPTY) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("userStatus") @get:JsonProperty("userStatus") val userStatus: kotlin.Int? = null diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index 4798bc0c028d..fc4f770ac1d9 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -57,7 +57,6 @@ public class AdditionalPropertiesClass { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Object anytype1; - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable anytype2 = JsonNullable.undefined(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/src/main/java/org/openapitools/model/Animal.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/src/main/java/org/openapitools/model/Animal.java index 2f923496661e..7812e1c12382 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/src/main/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/src/main/java/org/openapitools/model/Animal.java @@ -37,6 +37,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class Animal { + @JsonInclude(JsonInclude.Include.NON_NULL) private String className; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/src/main/java/org/openapitools/model/Category.java index f6a38799c911..03999441f921 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/src/main/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/src/main/java/org/openapitools/model/Category.java @@ -26,6 +26,7 @@ public class Category { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Long id; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name = "default-name"; public Category() { diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/src/main/java/org/openapitools/model/ContainerDefaultValue.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/src/main/java/org/openapitools/model/ContainerDefaultValue.java index 4a0936f8a784..a51bd99c90fc 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/src/main/java/org/openapitools/model/ContainerDefaultValue.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/src/main/java/org/openapitools/model/ContainerDefaultValue.java @@ -28,14 +28,14 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class ContainerDefaultValue { - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> nullableArray = JsonNullable.>undefined(); + @JsonInclude(JsonInclude.Include.ALWAYS) private JsonNullable> nullableRequiredArray = JsonNullable.>undefined(); + @JsonInclude(JsonInclude.Include.NON_NULL) private List requiredArray = new ArrayList<>(); - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> nullableArrayWithDefault = JsonNullable.>undefined(); public ContainerDefaultValue() { diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/src/main/java/org/openapitools/model/EnumTest.java index cef26523d335..5bd8c11d9722 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/src/main/java/org/openapitools/model/EnumTest.java @@ -104,6 +104,7 @@ public static EnumStringRequiredEnum fromValue(String value) { } } + @JsonInclude(JsonInclude.Include.NON_NULL) private EnumStringRequiredEnum enumStringRequired; /** diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/src/main/java/org/openapitools/model/FormatTest.java index b4d90992ea4c..0cb8e0d45c2d 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/src/main/java/org/openapitools/model/FormatTest.java @@ -40,6 +40,7 @@ public class FormatTest { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Long int64; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal number; @JsonInclude(JsonInclude.Include.NON_NULL) @@ -51,11 +52,13 @@ public class FormatTest { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable String string; + @JsonInclude(JsonInclude.Include.NON_NULL) private byte[] _byte; @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable org.springframework.core.io.Resource binary; + @JsonInclude(JsonInclude.Include.NON_NULL) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) private LocalDate date; @@ -66,6 +69,7 @@ public class FormatTest { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable UUID uuid; + @JsonInclude(JsonInclude.Include.NON_NULL) private String password; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/src/main/java/org/openapitools/model/Name.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/src/main/java/org/openapitools/model/Name.java index 2fc98b6fb666..4b44b936d3e2 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/src/main/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/src/main/java/org/openapitools/model/Name.java @@ -24,6 +24,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class Name { + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer name; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/src/main/java/org/openapitools/model/NullableMapProperty.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/src/main/java/org/openapitools/model/NullableMapProperty.java index 7330185d2021..31127013b739 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/src/main/java/org/openapitools/model/NullableMapProperty.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/src/main/java/org/openapitools/model/NullableMapProperty.java @@ -2,7 +2,6 @@ import java.net.URI; import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Arrays; @@ -28,7 +27,6 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class NullableMapProperty { - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> languageValues = JsonNullable.>undefined(); public NullableMapProperty languageValues(Map languageValues) { diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/src/main/java/org/openapitools/model/ParentWithNullable.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/src/main/java/org/openapitools/model/ParentWithNullable.java index d095e6659db9..d394b3e38431 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/src/main/java/org/openapitools/model/ParentWithNullable.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/src/main/java/org/openapitools/model/ParentWithNullable.java @@ -75,7 +75,6 @@ public static TypeEnum fromValue(String value) { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable TypeEnum type; - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable nullableProperty = JsonNullable.undefined(); public ParentWithNullable type(@Nullable TypeEnum type) { diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/src/main/java/org/openapitools/model/Pet.java index 673bb2e90254..728f7cad250d 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/src/main/java/org/openapitools/model/Pet.java @@ -38,8 +38,10 @@ public class Pet { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Category category; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name; + @JsonInclude(JsonInclude.Include.NON_NULL) private Set photoUrls = new LinkedHashSet<>(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/src/main/java/org/openapitools/model/TypeHolderDefault.java index 81f9284d385e..79d663d04658 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -2,6 +2,7 @@ import java.net.URI; import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.math.BigDecimal; @@ -26,14 +27,19 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class TypeHolderDefault { + @JsonInclude(JsonInclude.Include.NON_NULL) private String stringItem = "what"; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal numberItem = new BigDecimal("1.234"); + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer integerItem = -2; + @JsonInclude(JsonInclude.Include.NON_NULL) private Boolean boolItem = true; + @JsonInclude(JsonInclude.Include.NON_NULL) private List arrayItem = new ArrayList<>(Arrays.asList(0, 1, 2, 3)); public TypeHolderDefault() { diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/src/main/java/org/openapitools/model/TypeHolderExample.java index 8b1470e92bf0..31461adcaef0 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -2,6 +2,7 @@ import java.net.URI; import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.math.BigDecimal; @@ -26,16 +27,22 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class TypeHolderExample { + @JsonInclude(JsonInclude.Include.NON_NULL) private String stringItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal numberItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Float floatItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer integerItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Boolean boolItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private List arrayItem = new ArrayList<>(); public TypeHolderExample() { diff --git a/samples/server/petstore/spring-boot-nullable-set/src/main/java/org/openapitools/model/ObjectWithUniqueItems.java b/samples/server/petstore/spring-boot-nullable-set/src/main/java/org/openapitools/model/ObjectWithUniqueItems.java index 30bc93ff4da5..430f680158d4 100644 --- a/samples/server/petstore/spring-boot-nullable-set/src/main/java/org/openapitools/model/ObjectWithUniqueItems.java +++ b/samples/server/petstore/spring-boot-nullable-set/src/main/java/org/openapitools/model/ObjectWithUniqueItems.java @@ -33,13 +33,11 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class ObjectWithUniqueItems { - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> nullSet = JsonNullable.>undefined(); @JsonInclude(JsonInclude.Include.NON_NULL) private Set notNullSet = new LinkedHashSet<>(); - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> nullList = JsonNullable.>undefined(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java index e8a5db7c2cfe..675b856d3e45 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java @@ -29,6 +29,7 @@ public class AdditionalPropertiesAnyType { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String name; public AdditionalPropertiesAnyType name(@Nullable String name) { @@ -47,7 +48,6 @@ public AdditionalPropertiesAnyType name(@Nullable String name) { return name; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("name") public void setName(@Nullable String name) { this.name = name; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java index 3790bf7ab569..c4cc93375b6a 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java @@ -30,6 +30,7 @@ public class AdditionalPropertiesArray { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String name; public AdditionalPropertiesArray name(@Nullable String name) { @@ -48,7 +49,6 @@ public AdditionalPropertiesArray name(@Nullable String name) { return name; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("name") public void setName(@Nullable String name) { this.name = name; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java index 5785f0edaf45..4fc0a9cc16da 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -29,6 +29,7 @@ public class AdditionalPropertiesBoolean { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String name; public AdditionalPropertiesBoolean name(@Nullable String name) { @@ -47,7 +48,6 @@ public AdditionalPropertiesBoolean name(@Nullable String name) { return name; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("name") public void setName(@Nullable String name) { this.name = name; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index dabffe7b93a1..8c8fef587001 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -29,35 +29,45 @@ public class AdditionalPropertiesClass { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private Map mapString = new HashMap<>(); @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private Map mapNumber = new HashMap<>(); @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private Map mapInteger = new HashMap<>(); @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private Map mapBoolean = new HashMap<>(); @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private Map> mapArrayInteger = new HashMap<>(); @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private Map> mapArrayAnytype = new HashMap<>(); @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private Map> mapMapString = new HashMap<>(); @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private Map> mapMapAnytype = new HashMap<>(); @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Object anytype1; private @Nullable Object anytype2 = null; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Object anytype3; public AdditionalPropertiesClass mapString(Map mapString) { @@ -84,7 +94,6 @@ public Map getMapString() { return mapString; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("map_string") public void setMapString(Map mapString) { this.mapString = mapString; @@ -114,7 +123,6 @@ public Map getMapNumber() { return mapNumber; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("map_number") public void setMapNumber(Map mapNumber) { this.mapNumber = mapNumber; @@ -144,7 +152,6 @@ public Map getMapInteger() { return mapInteger; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("map_integer") public void setMapInteger(Map mapInteger) { this.mapInteger = mapInteger; @@ -174,7 +181,6 @@ public Map getMapBoolean() { return mapBoolean; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("map_boolean") public void setMapBoolean(Map mapBoolean) { this.mapBoolean = mapBoolean; @@ -204,7 +210,6 @@ public Map> getMapArrayInteger() { return mapArrayInteger; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("map_array_integer") public void setMapArrayInteger(Map> mapArrayInteger) { this.mapArrayInteger = mapArrayInteger; @@ -234,7 +239,6 @@ public Map> getMapArrayAnytype() { return mapArrayAnytype; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("map_array_anytype") public void setMapArrayAnytype(Map> mapArrayAnytype) { this.mapArrayAnytype = mapArrayAnytype; @@ -264,7 +268,6 @@ public Map> getMapMapString() { return mapMapString; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("map_map_string") public void setMapMapString(Map> mapMapString) { this.mapMapString = mapMapString; @@ -294,7 +297,6 @@ public Map> getMapMapAnytype() { return mapMapAnytype; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("map_map_anytype") public void setMapMapAnytype(Map> mapMapAnytype) { this.mapMapAnytype = mapMapAnytype; @@ -316,7 +318,6 @@ public AdditionalPropertiesClass anytype1(@Nullable Object anytype1) { return anytype1; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("anytype_1") public void setAnytype1(@Nullable Object anytype1) { this.anytype1 = anytype1; @@ -359,7 +360,6 @@ public AdditionalPropertiesClass anytype3(@Nullable Object anytype3) { return anytype3; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("anytype_3") public void setAnytype3(@Nullable Object anytype3) { this.anytype3 = anytype3; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java index 360609409551..6ac9fdff8fb4 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java @@ -29,6 +29,7 @@ public class AdditionalPropertiesInteger { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String name; public AdditionalPropertiesInteger name(@Nullable String name) { @@ -47,7 +48,6 @@ public AdditionalPropertiesInteger name(@Nullable String name) { return name; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("name") public void setName(@Nullable String name) { this.name = name; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java index 60915b85b8b7..76a52001f257 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java @@ -30,6 +30,7 @@ public class AdditionalPropertiesNumber { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String name; public AdditionalPropertiesNumber name(@Nullable String name) { @@ -48,7 +49,6 @@ public AdditionalPropertiesNumber name(@Nullable String name) { return name; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("name") public void setName(@Nullable String name) { this.name = name; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java index 680678b588e2..8658dce01653 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java @@ -30,6 +30,7 @@ public class AdditionalPropertiesObject { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String name; public AdditionalPropertiesObject name(@Nullable String name) { @@ -48,7 +49,6 @@ public AdditionalPropertiesObject name(@Nullable String name) { return name; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("name") public void setName(@Nullable String name) { this.name = name; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesString.java index 0602a16979f5..943185937e9d 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesString.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesString.java @@ -29,6 +29,7 @@ public class AdditionalPropertiesString { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String name; public AdditionalPropertiesString name(@Nullable String name) { @@ -47,7 +48,6 @@ public AdditionalPropertiesString name(@Nullable String name) { return name; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("name") public void setName(@Nullable String name) { this.name = name; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Animal.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Animal.java index 0364cbeb451f..d68a905f982a 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Animal.java @@ -38,9 +38,11 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class Animal { + @JsonInclude(JsonInclude.Include.NON_NULL) private String className; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private String color = "red"; public Animal() { @@ -91,7 +93,6 @@ public String getColor() { return color; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("color") public void setColor(String color) { this.color = color; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index 3580fffc402f..c501f85aa0a4 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -29,6 +29,7 @@ public class ArrayOfArrayOfNumberOnly { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private List> arrayArrayNumber = new ArrayList<>(); public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { @@ -55,7 +56,6 @@ public List> getArrayArrayNumber() { return arrayArrayNumber; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("ArrayArrayNumber") public void setArrayArrayNumber(List> arrayArrayNumber) { this.arrayArrayNumber = arrayArrayNumber; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java index 424ea6ded9b5..3f92a31d8455 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -29,6 +29,7 @@ public class ArrayOfNumberOnly { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private List arrayNumber = new ArrayList<>(); public ArrayOfNumberOnly arrayNumber(List arrayNumber) { @@ -55,7 +56,6 @@ public List getArrayNumber() { return arrayNumber; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("ArrayNumber") public void setArrayNumber(List arrayNumber) { this.arrayNumber = arrayNumber; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayTest.java index 2a1da8ab2c7a..7241c0a4be53 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayTest.java @@ -29,12 +29,15 @@ public class ArrayTest { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private List arrayOfString = new ArrayList<>(); @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private List> arrayArrayOfInteger = new ArrayList<>(); @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private List> arrayArrayOfModel = new ArrayList<>(); public ArrayTest arrayOfString(List arrayOfString) { @@ -61,7 +64,6 @@ public List getArrayOfString() { return arrayOfString; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("array_of_string") public void setArrayOfString(List arrayOfString) { this.arrayOfString = arrayOfString; @@ -91,7 +93,6 @@ public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("array_array_of_integer") public void setArrayArrayOfInteger(List> arrayArrayOfInteger) { this.arrayArrayOfInteger = arrayArrayOfInteger; @@ -121,7 +122,6 @@ public ArrayTest addArrayArrayOfModelItem(List<@Valid ReadOnlyFirst> arrayArrayO return arrayArrayOfModel; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("array_array_of_model") public void setArrayArrayOfModel(List> arrayArrayOfModel) { this.arrayArrayOfModel = arrayArrayOfModel; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/BigCat.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/BigCat.java index a344aa882002..06709bc31808 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/BigCat.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/BigCat.java @@ -70,6 +70,7 @@ public static KindEnum fromValue(String value) { } @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable KindEnum kind; public BigCat() { @@ -99,7 +100,6 @@ public BigCat kind(@Nullable KindEnum kind) { return kind; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("kind") public void setKind(@Nullable KindEnum kind) { this.kind = kind; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Capitalization.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Capitalization.java index 811258d49330..bb54603e5ccd 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Capitalization.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Capitalization.java @@ -25,21 +25,27 @@ public class Capitalization { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String smallCamel; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String capitalCamel; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String smallSnake; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String capitalSnake; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String scAETHFlowPoints; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String ATT_NAME; public Capitalization smallCamel(@Nullable String smallCamel) { @@ -58,7 +64,6 @@ public Capitalization smallCamel(@Nullable String smallCamel) { return smallCamel; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("smallCamel") public void setSmallCamel(@Nullable String smallCamel) { this.smallCamel = smallCamel; @@ -80,7 +85,6 @@ public Capitalization capitalCamel(@Nullable String capitalCamel) { return capitalCamel; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("CapitalCamel") public void setCapitalCamel(@Nullable String capitalCamel) { this.capitalCamel = capitalCamel; @@ -102,7 +106,6 @@ public Capitalization smallSnake(@Nullable String smallSnake) { return smallSnake; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("small_Snake") public void setSmallSnake(@Nullable String smallSnake) { this.smallSnake = smallSnake; @@ -124,7 +127,6 @@ public Capitalization capitalSnake(@Nullable String capitalSnake) { return capitalSnake; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("Capital_Snake") public void setCapitalSnake(@Nullable String capitalSnake) { this.capitalSnake = capitalSnake; @@ -146,7 +148,6 @@ public Capitalization scAETHFlowPoints(@Nullable String scAETHFlowPoints) { return scAETHFlowPoints; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("SCA_ETH_Flow_Points") public void setScAETHFlowPoints(@Nullable String scAETHFlowPoints) { this.scAETHFlowPoints = scAETHFlowPoints; @@ -168,7 +169,6 @@ public Capitalization ATT_NAME(@Nullable String ATT_NAME) { return ATT_NAME; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("ATT_NAME") public void setATTNAME(@Nullable String ATT_NAME) { this.ATT_NAME = ATT_NAME; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Cat.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Cat.java index e8666d33a3e2..5007778d234b 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Cat.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Cat.java @@ -38,6 +38,7 @@ public class Cat extends Animal { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Boolean declawed; public Cat() { @@ -67,7 +68,6 @@ public Cat declawed(@Nullable Boolean declawed) { return declawed; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("declawed") public void setDeclawed(@Nullable Boolean declawed) { this.declawed = declawed; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Category.java index 0920e9972f19..c70eaa3e66f9 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Category.java @@ -25,8 +25,10 @@ public class Category { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Long id; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name = "default-name"; public Category() { @@ -56,7 +58,6 @@ public Category id(@Nullable Long id) { return id; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("id") public void setId(@Nullable Long id) { this.id = id; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ChildWithNullable.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ChildWithNullable.java index ecf4dd98d0fc..201010e97d87 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ChildWithNullable.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ChildWithNullable.java @@ -31,6 +31,7 @@ public class ChildWithNullable extends ParentWithNullable { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String otherProperty; public ChildWithNullable otherProperty(@Nullable String otherProperty) { @@ -49,7 +50,6 @@ public ChildWithNullable otherProperty(@Nullable String otherProperty) { return otherProperty; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("otherProperty") public void setOtherProperty(@Nullable String otherProperty) { this.otherProperty = otherProperty; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ClassModel.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ClassModel.java index ae7726959eeb..3fb8e61e8b38 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ClassModel.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ClassModel.java @@ -26,6 +26,7 @@ public class ClassModel { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String propertyClass; public ClassModel propertyClass(@Nullable String propertyClass) { @@ -44,7 +45,6 @@ public ClassModel propertyClass(@Nullable String propertyClass) { return propertyClass; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("_class") public void setPropertyClass(@Nullable String propertyClass) { this.propertyClass = propertyClass; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Client.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Client.java index 68d1d67e9d69..9be6d4099760 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Client.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Client.java @@ -25,6 +25,7 @@ public class Client { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String client; public Client client(@Nullable String client) { @@ -43,7 +44,6 @@ public Client client(@Nullable String client) { return client; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("client") public void setClient(@Nullable String client) { this.client = client; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ContainerDefaultValue.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ContainerDefaultValue.java index 518f33493840..6674c88a2e4f 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ContainerDefaultValue.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ContainerDefaultValue.java @@ -2,6 +2,7 @@ import java.net.URI; import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.util.ArrayList; @@ -26,8 +27,10 @@ public class ContainerDefaultValue { private @Nullable List nullableArray; + @JsonInclude(JsonInclude.Include.ALWAYS) private List nullableRequiredArray; + @JsonInclude(JsonInclude.Include.NON_NULL) private List requiredArray = new ArrayList<>(); private @Nullable List nullableArrayWithDefault = new ArrayList<>(Arrays.asList("foo", "bar")); diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Dog.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Dog.java index 0f0727d69986..794aae78d768 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Dog.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Dog.java @@ -30,6 +30,7 @@ public class Dog extends Animal { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String breed; public Dog() { @@ -59,7 +60,6 @@ public Dog breed(@Nullable String breed) { return breed; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("breed") public void setBreed(@Nullable String breed) { this.breed = breed; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumArrays.java index 00a83253dffe..4f89c8476898 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumArrays.java @@ -64,6 +64,7 @@ public static JustSymbolEnum fromValue(String value) { } @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable JustSymbolEnum justSymbol; /** @@ -102,6 +103,7 @@ public static ArrayEnumEnum fromValue(String value) { } @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private List arrayEnum = new ArrayList<>(); public EnumArrays justSymbol(@Nullable JustSymbolEnum justSymbol) { @@ -120,7 +122,6 @@ public EnumArrays justSymbol(@Nullable JustSymbolEnum justSymbol) { return justSymbol; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("just_symbol") public void setJustSymbol(@Nullable JustSymbolEnum justSymbol) { this.justSymbol = justSymbol; @@ -150,7 +151,6 @@ public List getArrayEnum() { return arrayEnum; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("array_enum") public void setArrayEnum(List arrayEnum) { this.arrayEnum = arrayEnum; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumTest.java index c5b52e5f1168..bd138a9d4845 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumTest.java @@ -66,6 +66,7 @@ public static EnumStringEnum fromValue(String value) { } @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable EnumStringEnum enumString; /** @@ -105,6 +106,7 @@ public static EnumStringRequiredEnum fromValue(String value) { } } + @JsonInclude(JsonInclude.Include.NON_NULL) private EnumStringRequiredEnum enumStringRequired; /** @@ -143,6 +145,7 @@ public static EnumIntegerEnum fromValue(Integer value) { } @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable EnumIntegerEnum enumInteger; /** @@ -181,9 +184,11 @@ public static EnumNumberEnum fromValue(Double value) { } @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable EnumNumberEnum enumNumber; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable OuterEnum outerEnum; public EnumTest() { @@ -213,7 +218,6 @@ public EnumTest enumString(@Nullable EnumStringEnum enumString) { return enumString; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("enum_string") public void setEnumString(@Nullable EnumStringEnum enumString) { this.enumString = enumString; @@ -256,7 +260,6 @@ public EnumTest enumInteger(@Nullable EnumIntegerEnum enumInteger) { return enumInteger; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("enum_integer") public void setEnumInteger(@Nullable EnumIntegerEnum enumInteger) { this.enumInteger = enumInteger; @@ -278,7 +281,6 @@ public EnumTest enumNumber(@Nullable EnumNumberEnum enumNumber) { return enumNumber; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("enum_number") public void setEnumNumber(@Nullable EnumNumberEnum enumNumber) { this.enumNumber = enumNumber; @@ -300,7 +302,6 @@ public EnumTest outerEnum(@Nullable OuterEnum outerEnum) { return outerEnum; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("outerEnum") public void setOuterEnum(@Nullable OuterEnum outerEnum) { this.outerEnum = outerEnum; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/File.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/File.java index a534baa11503..fb2777c8d8ad 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/File.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/File.java @@ -26,6 +26,7 @@ public class File { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String sourceURI; public File sourceURI(@Nullable String sourceURI) { @@ -44,7 +45,6 @@ public File sourceURI(@Nullable String sourceURI) { return sourceURI; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("sourceURI") public void setSourceURI(@Nullable String sourceURI) { this.sourceURI = sourceURI; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/FileSchemaTestClass.java index 85da24365011..bfeb4444c19e 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/FileSchemaTestClass.java @@ -29,9 +29,11 @@ public class FileSchemaTestClass { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable File file; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private List<@Valid File> files = new ArrayList<>(); public FileSchemaTestClass file(@Nullable File file) { @@ -50,7 +52,6 @@ public FileSchemaTestClass file(@Nullable File file) { return file; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("file") public void setFile(@Nullable File file) { this.file = file; @@ -80,7 +81,6 @@ public FileSchemaTestClass addFilesItem(File filesItem) { return files; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("files") public void setFiles(List<@Valid File> files) { this.files = files; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/FormatTest.java index 12be011e4b50..b84f5c1254d3 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/FormatTest.java @@ -33,43 +33,57 @@ public class FormatTest { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Integer integer; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Integer int32; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Long int64; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal number; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Float _float; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Double _double; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String string; + @JsonInclude(JsonInclude.Include.NON_NULL) private byte[] _byte; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable org.springframework.core.io.Resource binary; + @JsonInclude(JsonInclude.Include.NON_NULL) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) private LocalDate date; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private @Nullable OffsetDateTime dateTime; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable UUID uuid; + @JsonInclude(JsonInclude.Include.NON_NULL) private String password; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable BigDecimal bigDecimal; public FormatTest() { @@ -104,7 +118,6 @@ public FormatTest integer(@Nullable Integer integer) { return integer; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("integer") public void setInteger(@Nullable Integer integer) { this.integer = integer; @@ -128,7 +141,6 @@ public FormatTest int32(@Nullable Integer int32) { return int32; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("int32") public void setInt32(@Nullable Integer int32) { this.int32 = int32; @@ -150,7 +162,6 @@ public FormatTest int64(@Nullable Long int64) { return int64; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("int64") public void setInt64(@Nullable Long int64) { this.int64 = int64; @@ -197,7 +208,6 @@ public FormatTest _float(@Nullable Float _float) { return _float; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("float") public void setFloat(@Nullable Float _float) { this._float = _float; @@ -221,7 +231,6 @@ public FormatTest _double(@Nullable Double _double) { return _double; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("double") public void setDouble(@Nullable Double _double) { this._double = _double; @@ -243,7 +252,6 @@ public FormatTest string(@Nullable String string) { return string; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("string") public void setString(@Nullable String string) { this.string = string; @@ -286,7 +294,6 @@ public FormatTest binary(@Nullable org.springframework.core.io.Resource binary) return binary; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("binary") public void setBinary(@Nullable org.springframework.core.io.Resource binary) { this.binary = binary; @@ -329,7 +336,6 @@ public FormatTest dateTime(@Nullable OffsetDateTime dateTime) { return dateTime; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("dateTime") public void setDateTime(@Nullable OffsetDateTime dateTime) { this.dateTime = dateTime; @@ -351,7 +357,6 @@ public FormatTest uuid(@Nullable UUID uuid) { return uuid; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("uuid") public void setUuid(@Nullable UUID uuid) { this.uuid = uuid; @@ -394,7 +399,6 @@ public FormatTest bigDecimal(@Nullable BigDecimal bigDecimal) { return bigDecimal; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("BigDecimal") public void setBigDecimal(@Nullable BigDecimal bigDecimal) { this.bigDecimal = bigDecimal; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/HasOnlyReadOnly.java index 67d03b549c9b..0a7610e2760a 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/HasOnlyReadOnly.java @@ -27,9 +27,11 @@ public class HasOnlyReadOnly { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String bar; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String foo; public HasOnlyReadOnly bar(@Nullable String bar) { @@ -48,7 +50,6 @@ public HasOnlyReadOnly bar(@Nullable String bar) { return bar; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("bar") public void setBar(@Nullable String bar) { this.bar = bar; @@ -70,7 +71,6 @@ public HasOnlyReadOnly foo(@Nullable String foo) { return foo; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("foo") public void setFoo(@Nullable String foo) { this.foo = foo; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/MapTest.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/MapTest.java index 20a4b78b97f4..91a4abcb039b 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/MapTest.java @@ -28,6 +28,7 @@ public class MapTest { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private Map> mapMapOfString = new HashMap<>(); /** @@ -66,12 +67,15 @@ public static InnerEnum fromValue(String value) { } @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private Map mapOfEnumString = new HashMap<>(); @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private Map directMap = new HashMap<>(); @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private Map indirectMap = new HashMap<>(); public MapTest mapMapOfString(Map> mapMapOfString) { @@ -98,7 +102,6 @@ public Map> getMapMapOfString() { return mapMapOfString; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("map_map_of_string") public void setMapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; @@ -128,7 +131,6 @@ public Map getMapOfEnumString() { return mapOfEnumString; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("map_of_enum_string") public void setMapOfEnumString(Map mapOfEnumString) { this.mapOfEnumString = mapOfEnumString; @@ -158,7 +160,6 @@ public Map getDirectMap() { return directMap; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("direct_map") public void setDirectMap(Map directMap) { this.directMap = directMap; @@ -188,7 +189,6 @@ public Map getIndirectMap() { return indirectMap; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("indirect_map") public void setIndirectMap(Map indirectMap) { this.indirectMap = indirectMap; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index 4a1a2fafc376..c890177e5c7d 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -31,13 +31,16 @@ public class MixedPropertiesAndAdditionalPropertiesClass { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable UUID uuid; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private @Nullable OffsetDateTime dateTime; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private Map map = new HashMap<>(); public MixedPropertiesAndAdditionalPropertiesClass uuid(@Nullable UUID uuid) { @@ -56,7 +59,6 @@ public MixedPropertiesAndAdditionalPropertiesClass uuid(@Nullable UUID uuid) { return uuid; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("uuid") public void setUuid(@Nullable UUID uuid) { this.uuid = uuid; @@ -78,7 +80,6 @@ public MixedPropertiesAndAdditionalPropertiesClass dateTime(@Nullable OffsetDate return dateTime; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("dateTime") public void setDateTime(@Nullable OffsetDateTime dateTime) { this.dateTime = dateTime; @@ -108,7 +109,6 @@ public Map getMap() { return map; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("map") public void setMap(Map map) { this.map = map; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Model200Response.java index c071004dcf37..aa582adbe1de 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Model200Response.java @@ -28,9 +28,11 @@ public class Model200Response { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Integer name; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String propertyClass; public Model200Response name(@Nullable Integer name) { @@ -49,7 +51,6 @@ public Model200Response name(@Nullable Integer name) { return name; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("name") public void setName(@Nullable Integer name) { this.name = name; @@ -71,7 +72,6 @@ public Model200Response propertyClass(@Nullable String propertyClass) { return propertyClass; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("class") public void setPropertyClass(@Nullable String propertyClass) { this.propertyClass = propertyClass; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelApiResponse.java index 2f93f69f9606..77b8d44c0593 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -27,12 +27,15 @@ public class ModelApiResponse { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Integer code; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String type; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String message; public ModelApiResponse code(@Nullable Integer code) { @@ -51,7 +54,6 @@ public ModelApiResponse code(@Nullable Integer code) { return code; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("code") public void setCode(@Nullable Integer code) { this.code = code; @@ -73,7 +75,6 @@ public ModelApiResponse type(@Nullable String type) { return type; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("type") public void setType(@Nullable String type) { this.type = type; @@ -95,7 +96,6 @@ public ModelApiResponse message(@Nullable String message) { return message; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("message") public void setMessage(@Nullable String message) { this.message = message; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelList.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelList.java index 12c0719d562d..387898d916e3 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelList.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelList.java @@ -27,6 +27,7 @@ public class ModelList { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String _123list; public ModelList _123list(@Nullable String _123list) { @@ -45,7 +46,6 @@ public ModelList _123list(@Nullable String _123list) { return _123list; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("123-list") public void set123list(@Nullable String _123list) { this._123list = _123list; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelReturn.java index 7f3e8f170726..bcb90c304d6a 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelReturn.java @@ -28,6 +28,7 @@ public class ModelReturn { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Integer _return; public ModelReturn _return(@Nullable Integer _return) { @@ -46,7 +47,6 @@ public ModelReturn _return(@Nullable Integer _return) { return _return; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("return") public void setReturn(@Nullable Integer _return) { this._return = _return; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Name.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Name.java index e9a7f9cc9d8a..a6e4993c1ddc 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Name.java @@ -25,15 +25,19 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class Name { + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer name; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Integer snakeCase; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String property; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Integer _123number; public Name() { @@ -84,7 +88,6 @@ public Name snakeCase(@Nullable Integer snakeCase) { return snakeCase; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("snake_case") public void setSnakeCase(@Nullable Integer snakeCase) { this.snakeCase = snakeCase; @@ -106,7 +109,6 @@ public Name property(@Nullable String property) { return property; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("property") public void setProperty(@Nullable String property) { this.property = property; @@ -128,7 +130,6 @@ public Name _123number(@Nullable Integer _123number) { return _123number; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("123Number") public void set123number(@Nullable Integer _123number) { this._123number = _123number; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/NumberOnly.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/NumberOnly.java index 22cea2d2d766..52a68b30ab73 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/NumberOnly.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/NumberOnly.java @@ -26,6 +26,7 @@ public class NumberOnly { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable BigDecimal justNumber; public NumberOnly justNumber(@Nullable BigDecimal justNumber) { @@ -44,7 +45,6 @@ public NumberOnly justNumber(@Nullable BigDecimal justNumber) { return justNumber; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("JustNumber") public void setJustNumber(@Nullable BigDecimal justNumber) { this.justNumber = justNumber; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Order.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Order.java index fdc614781b08..1595738597f9 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Order.java @@ -28,15 +28,19 @@ public class Order { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Long id; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Long petId; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Integer quantity; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private @Nullable OffsetDateTime shipDate; @@ -78,9 +82,11 @@ public static StatusEnum fromValue(String value) { } @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable StatusEnum status; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private Boolean complete = false; public Order id(@Nullable Long id) { @@ -99,7 +105,6 @@ public Order id(@Nullable Long id) { return id; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("id") public void setId(@Nullable Long id) { this.id = id; @@ -121,7 +126,6 @@ public Order petId(@Nullable Long petId) { return petId; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("petId") public void setPetId(@Nullable Long petId) { this.petId = petId; @@ -143,7 +147,6 @@ public Order quantity(@Nullable Integer quantity) { return quantity; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("quantity") public void setQuantity(@Nullable Integer quantity) { this.quantity = quantity; @@ -165,7 +168,6 @@ public Order shipDate(@Nullable OffsetDateTime shipDate) { return shipDate; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("shipDate") public void setShipDate(@Nullable OffsetDateTime shipDate) { this.shipDate = shipDate; @@ -187,7 +189,6 @@ public Order status(@Nullable StatusEnum status) { return status; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("status") public void setStatus(@Nullable StatusEnum status) { this.status = status; @@ -209,7 +210,6 @@ public Boolean getComplete() { return complete; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("complete") public void setComplete(Boolean complete) { this.complete = complete; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/OuterComposite.java index 36b201b865cf..1fc9d46645e8 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/OuterComposite.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/OuterComposite.java @@ -26,12 +26,15 @@ public class OuterComposite { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable BigDecimal myNumber; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String myString; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Boolean myBoolean; public OuterComposite myNumber(@Nullable BigDecimal myNumber) { @@ -50,7 +53,6 @@ public OuterComposite myNumber(@Nullable BigDecimal myNumber) { return myNumber; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("my_number") public void setMyNumber(@Nullable BigDecimal myNumber) { this.myNumber = myNumber; @@ -72,7 +74,6 @@ public OuterComposite myString(@Nullable String myString) { return myString; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("my_string") public void setMyString(@Nullable String myString) { this.myString = myString; @@ -94,7 +95,6 @@ public OuterComposite myBoolean(@Nullable Boolean myBoolean) { return myBoolean; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("my_boolean") public void setMyBoolean(@Nullable Boolean myBoolean) { this.myBoolean = myBoolean; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ParentWithNullable.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ParentWithNullable.java index 67fe6b9074de..032a06cb2a2b 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ParentWithNullable.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ParentWithNullable.java @@ -71,6 +71,7 @@ public static TypeEnum fromValue(String value) { } @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable TypeEnum type; private @Nullable String nullableProperty = null; @@ -91,7 +92,6 @@ public ParentWithNullable type(@Nullable TypeEnum type) { return type; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("type") public void setType(@Nullable TypeEnum type) { this.type = type; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Pet.java index 6a20ec90e83f..7bdf76f63b75 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Pet.java @@ -34,16 +34,21 @@ public class Pet { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Long id; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Category category; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name; + @JsonInclude(JsonInclude.Include.NON_NULL) private Set photoUrls = new LinkedHashSet<>(); @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private List<@Valid Tag> tags = new ArrayList<>(); /** @@ -84,6 +89,7 @@ public static StatusEnum fromValue(String value) { } @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) @Deprecated private @Nullable StatusEnum status; @@ -115,7 +121,6 @@ public Pet id(@Nullable Long id) { return id; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("id") public void setId(@Nullable Long id) { this.id = id; @@ -137,7 +142,6 @@ public Pet category(@Nullable Category category) { return category; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("category") public void setCategory(@Nullable Category category) { this.category = category; @@ -218,7 +222,6 @@ public Pet addTagsItem(Tag tagsItem) { return tags; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("tags") public void setTags(List<@Valid Tag> tags) { this.tags = tags; @@ -245,7 +248,6 @@ public Pet status(@Nullable StatusEnum status) { /** * @deprecated */ - @JsonSetter(nulls = Nulls.SKIP) @Deprecated @JsonProperty("status") public void setStatus(@Nullable StatusEnum status) { diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ReadOnlyFirst.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ReadOnlyFirst.java index ffdb54f62711..6047f75ef858 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ReadOnlyFirst.java @@ -25,9 +25,11 @@ public class ReadOnlyFirst { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String bar; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String baz; public ReadOnlyFirst bar(@Nullable String bar) { @@ -46,7 +48,6 @@ public ReadOnlyFirst bar(@Nullable String bar) { return bar; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("bar") public void setBar(@Nullable String bar) { this.bar = bar; @@ -68,7 +69,6 @@ public ReadOnlyFirst baz(@Nullable String baz) { return baz; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("baz") public void setBaz(@Nullable String baz) { this.baz = baz; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java index 49e5a3dbd7b6..f9d4a07cb8c8 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java @@ -25,15 +25,19 @@ public class ResponseObjectWithDifferentFieldNames { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String normalPropertyName; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String UPPER_CASE_PROPERTY_SNAKE; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String lowerCasePropertyDashes; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String propertyNameWithSpaces; public ResponseObjectWithDifferentFieldNames normalPropertyName(@Nullable String normalPropertyName) { @@ -52,7 +56,6 @@ public ResponseObjectWithDifferentFieldNames normalPropertyName(@Nullable String return normalPropertyName; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("normalPropertyName") public void setNormalPropertyName(@Nullable String normalPropertyName) { this.normalPropertyName = normalPropertyName; @@ -74,7 +77,6 @@ public ResponseObjectWithDifferentFieldNames UPPER_CASE_PROPERTY_SNAKE(@Nullable return UPPER_CASE_PROPERTY_SNAKE; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("UPPER_CASE_PROPERTY_SNAKE") public void setUPPERCASEPROPERTYSNAKE(@Nullable String UPPER_CASE_PROPERTY_SNAKE) { this.UPPER_CASE_PROPERTY_SNAKE = UPPER_CASE_PROPERTY_SNAKE; @@ -96,7 +98,6 @@ public ResponseObjectWithDifferentFieldNames lowerCasePropertyDashes(@Nullable S return lowerCasePropertyDashes; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("lower-case-property-dashes") public void setLowerCasePropertyDashes(@Nullable String lowerCasePropertyDashes) { this.lowerCasePropertyDashes = lowerCasePropertyDashes; @@ -118,7 +119,6 @@ public ResponseObjectWithDifferentFieldNames propertyNameWithSpaces(@Nullable St return propertyNameWithSpaces; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("property name with spaces") public void setPropertyNameWithSpaces(@Nullable String propertyNameWithSpaces) { this.propertyNameWithSpaces = propertyNameWithSpaces; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/SpecialModelName.java index a037c51871ba..6d8439318c14 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/SpecialModelName.java @@ -27,6 +27,7 @@ public class SpecialModelName { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Long $specialPropertyName; public SpecialModelName $specialPropertyName(@Nullable Long $specialPropertyName) { @@ -45,7 +46,6 @@ public class SpecialModelName { return $specialPropertyName; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("$special[property.name]") public void set$SpecialPropertyName(@Nullable Long $specialPropertyName) { this.$specialPropertyName = $specialPropertyName; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Tag.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Tag.java index 54480713e85b..7039951b34b3 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Tag.java @@ -25,9 +25,11 @@ public class Tag { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Long id; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String name; public Tag id(@Nullable Long id) { @@ -46,7 +48,6 @@ public Tag id(@Nullable Long id) { return id; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("id") public void setId(@Nullable Long id) { this.id = id; @@ -68,7 +69,6 @@ public Tag name(@Nullable String name) { return name; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("name") public void setName(@Nullable String name) { this.name = name; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/TypeHolderDefault.java index e1ddc677876c..df8b8fbcdb51 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -2,6 +2,7 @@ import java.net.URI; import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.math.BigDecimal; @@ -25,14 +26,19 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class TypeHolderDefault { + @JsonInclude(JsonInclude.Include.NON_NULL) private String stringItem = "what"; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal numberItem = new BigDecimal("1.234"); + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer integerItem = -2; + @JsonInclude(JsonInclude.Include.NON_NULL) private Boolean boolItem = true; + @JsonInclude(JsonInclude.Include.NON_NULL) private List arrayItem = new ArrayList<>(Arrays.asList(0, 1, 2, 3)); public TypeHolderDefault() { diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/TypeHolderExample.java index 088b142a7513..3b3204e03b16 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -2,6 +2,7 @@ import java.net.URI; import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.math.BigDecimal; @@ -25,16 +26,22 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class TypeHolderExample { + @JsonInclude(JsonInclude.Include.NON_NULL) private String stringItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal numberItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Float floatItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer integerItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Boolean boolItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private List arrayItem = new ArrayList<>(); public TypeHolderExample() { diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/User.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/User.java index f7547a7e00c5..eb2111764012 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/User.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/User.java @@ -25,27 +25,35 @@ public class User { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Long id; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String username; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String firstName; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String lastName; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String email; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String password; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String phone; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Integer userStatus; public User id(@Nullable Long id) { @@ -64,7 +72,6 @@ public User id(@Nullable Long id) { return id; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("id") public void setId(@Nullable Long id) { this.id = id; @@ -86,7 +93,6 @@ public User username(@Nullable String username) { return username; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("username") public void setUsername(@Nullable String username) { this.username = username; @@ -108,7 +114,6 @@ public User firstName(@Nullable String firstName) { return firstName; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("firstName") public void setFirstName(@Nullable String firstName) { this.firstName = firstName; @@ -130,7 +135,6 @@ public User lastName(@Nullable String lastName) { return lastName; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("lastName") public void setLastName(@Nullable String lastName) { this.lastName = lastName; @@ -152,7 +156,6 @@ public User email(@Nullable String email) { return email; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("email") public void setEmail(@Nullable String email) { this.email = email; @@ -174,7 +177,6 @@ public User password(@Nullable String password) { return password; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("password") public void setPassword(@Nullable String password) { this.password = password; @@ -196,7 +198,6 @@ public User phone(@Nullable String phone) { return phone; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("phone") public void setPhone(@Nullable String phone) { this.phone = phone; @@ -218,7 +219,6 @@ public User userStatus(@Nullable Integer userStatus) { return userStatus; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("userStatus") public void setUserStatus(@Nullable Integer userStatus) { this.userStatus = userStatus; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/XmlItem.java index fe3ac71771db..e76b8fdf4d6b 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/XmlItem.java @@ -29,90 +29,119 @@ public class XmlItem { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String attributeString; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable BigDecimal attributeNumber; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Integer attributeInteger; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Boolean attributeBoolean; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private List wrappedArray = new ArrayList<>(); @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String nameString; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable BigDecimal nameNumber; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Integer nameInteger; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Boolean nameBoolean; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private List nameArray = new ArrayList<>(); @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private List nameWrappedArray = new ArrayList<>(); @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String prefixString; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable BigDecimal prefixNumber; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Integer prefixInteger; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Boolean prefixBoolean; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private List prefixArray = new ArrayList<>(); @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private List prefixWrappedArray = new ArrayList<>(); @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String namespaceString; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable BigDecimal namespaceNumber; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Integer namespaceInteger; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Boolean namespaceBoolean; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private List namespaceArray = new ArrayList<>(); @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private List namespaceWrappedArray = new ArrayList<>(); @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String prefixNsString; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable BigDecimal prefixNsNumber; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Integer prefixNsInteger; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Boolean prefixNsBoolean; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private List prefixNsArray = new ArrayList<>(); @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private List prefixNsWrappedArray = new ArrayList<>(); public XmlItem attributeString(@Nullable String attributeString) { @@ -131,7 +160,6 @@ public XmlItem attributeString(@Nullable String attributeString) { return attributeString; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("attribute_string") public void setAttributeString(@Nullable String attributeString) { this.attributeString = attributeString; @@ -153,7 +181,6 @@ public XmlItem attributeNumber(@Nullable BigDecimal attributeNumber) { return attributeNumber; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("attribute_number") public void setAttributeNumber(@Nullable BigDecimal attributeNumber) { this.attributeNumber = attributeNumber; @@ -175,7 +202,6 @@ public XmlItem attributeInteger(@Nullable Integer attributeInteger) { return attributeInteger; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("attribute_integer") public void setAttributeInteger(@Nullable Integer attributeInteger) { this.attributeInteger = attributeInteger; @@ -197,7 +223,6 @@ public XmlItem attributeBoolean(@Nullable Boolean attributeBoolean) { return attributeBoolean; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("attribute_boolean") public void setAttributeBoolean(@Nullable Boolean attributeBoolean) { this.attributeBoolean = attributeBoolean; @@ -227,7 +252,6 @@ public List getWrappedArray() { return wrappedArray; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("wrapped_array") public void setWrappedArray(List wrappedArray) { this.wrappedArray = wrappedArray; @@ -249,7 +273,6 @@ public XmlItem nameString(@Nullable String nameString) { return nameString; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("name_string") public void setNameString(@Nullable String nameString) { this.nameString = nameString; @@ -271,7 +294,6 @@ public XmlItem nameNumber(@Nullable BigDecimal nameNumber) { return nameNumber; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("name_number") public void setNameNumber(@Nullable BigDecimal nameNumber) { this.nameNumber = nameNumber; @@ -293,7 +315,6 @@ public XmlItem nameInteger(@Nullable Integer nameInteger) { return nameInteger; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("name_integer") public void setNameInteger(@Nullable Integer nameInteger) { this.nameInteger = nameInteger; @@ -315,7 +336,6 @@ public XmlItem nameBoolean(@Nullable Boolean nameBoolean) { return nameBoolean; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("name_boolean") public void setNameBoolean(@Nullable Boolean nameBoolean) { this.nameBoolean = nameBoolean; @@ -345,7 +365,6 @@ public List getNameArray() { return nameArray; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("name_array") public void setNameArray(List nameArray) { this.nameArray = nameArray; @@ -375,7 +394,6 @@ public List getNameWrappedArray() { return nameWrappedArray; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("name_wrapped_array") public void setNameWrappedArray(List nameWrappedArray) { this.nameWrappedArray = nameWrappedArray; @@ -397,7 +415,6 @@ public XmlItem prefixString(@Nullable String prefixString) { return prefixString; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("prefix_string") public void setPrefixString(@Nullable String prefixString) { this.prefixString = prefixString; @@ -419,7 +436,6 @@ public XmlItem prefixNumber(@Nullable BigDecimal prefixNumber) { return prefixNumber; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("prefix_number") public void setPrefixNumber(@Nullable BigDecimal prefixNumber) { this.prefixNumber = prefixNumber; @@ -441,7 +457,6 @@ public XmlItem prefixInteger(@Nullable Integer prefixInteger) { return prefixInteger; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("prefix_integer") public void setPrefixInteger(@Nullable Integer prefixInteger) { this.prefixInteger = prefixInteger; @@ -463,7 +478,6 @@ public XmlItem prefixBoolean(@Nullable Boolean prefixBoolean) { return prefixBoolean; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("prefix_boolean") public void setPrefixBoolean(@Nullable Boolean prefixBoolean) { this.prefixBoolean = prefixBoolean; @@ -493,7 +507,6 @@ public List getPrefixArray() { return prefixArray; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("prefix_array") public void setPrefixArray(List prefixArray) { this.prefixArray = prefixArray; @@ -523,7 +536,6 @@ public List getPrefixWrappedArray() { return prefixWrappedArray; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("prefix_wrapped_array") public void setPrefixWrappedArray(List prefixWrappedArray) { this.prefixWrappedArray = prefixWrappedArray; @@ -545,7 +557,6 @@ public XmlItem namespaceString(@Nullable String namespaceString) { return namespaceString; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("namespace_string") public void setNamespaceString(@Nullable String namespaceString) { this.namespaceString = namespaceString; @@ -567,7 +578,6 @@ public XmlItem namespaceNumber(@Nullable BigDecimal namespaceNumber) { return namespaceNumber; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("namespace_number") public void setNamespaceNumber(@Nullable BigDecimal namespaceNumber) { this.namespaceNumber = namespaceNumber; @@ -589,7 +599,6 @@ public XmlItem namespaceInteger(@Nullable Integer namespaceInteger) { return namespaceInteger; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("namespace_integer") public void setNamespaceInteger(@Nullable Integer namespaceInteger) { this.namespaceInteger = namespaceInteger; @@ -611,7 +620,6 @@ public XmlItem namespaceBoolean(@Nullable Boolean namespaceBoolean) { return namespaceBoolean; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("namespace_boolean") public void setNamespaceBoolean(@Nullable Boolean namespaceBoolean) { this.namespaceBoolean = namespaceBoolean; @@ -641,7 +649,6 @@ public List getNamespaceArray() { return namespaceArray; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("namespace_array") public void setNamespaceArray(List namespaceArray) { this.namespaceArray = namespaceArray; @@ -671,7 +678,6 @@ public List getNamespaceWrappedArray() { return namespaceWrappedArray; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("namespace_wrapped_array") public void setNamespaceWrappedArray(List namespaceWrappedArray) { this.namespaceWrappedArray = namespaceWrappedArray; @@ -693,7 +699,6 @@ public XmlItem prefixNsString(@Nullable String prefixNsString) { return prefixNsString; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("prefix_ns_string") public void setPrefixNsString(@Nullable String prefixNsString) { this.prefixNsString = prefixNsString; @@ -715,7 +720,6 @@ public XmlItem prefixNsNumber(@Nullable BigDecimal prefixNsNumber) { return prefixNsNumber; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("prefix_ns_number") public void setPrefixNsNumber(@Nullable BigDecimal prefixNsNumber) { this.prefixNsNumber = prefixNsNumber; @@ -737,7 +741,6 @@ public XmlItem prefixNsInteger(@Nullable Integer prefixNsInteger) { return prefixNsInteger; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("prefix_ns_integer") public void setPrefixNsInteger(@Nullable Integer prefixNsInteger) { this.prefixNsInteger = prefixNsInteger; @@ -759,7 +762,6 @@ public XmlItem prefixNsBoolean(@Nullable Boolean prefixNsBoolean) { return prefixNsBoolean; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("prefix_ns_boolean") public void setPrefixNsBoolean(@Nullable Boolean prefixNsBoolean) { this.prefixNsBoolean = prefixNsBoolean; @@ -789,7 +791,6 @@ public List getPrefixNsArray() { return prefixNsArray; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("prefix_ns_array") public void setPrefixNsArray(List prefixNsArray) { this.prefixNsArray = prefixNsArray; @@ -819,7 +820,6 @@ public List getPrefixNsWrappedArray() { return prefixNsWrappedArray; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("prefix_ns_wrapped_array") public void setPrefixNsWrappedArray(List prefixNsWrappedArray) { this.prefixNsWrappedArray = prefixNsWrappedArray; diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index 4798bc0c028d..fc4f770ac1d9 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -57,7 +57,6 @@ public class AdditionalPropertiesClass { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Object anytype1; - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable anytype2 = JsonNullable.undefined(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Animal.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Animal.java index 2f923496661e..7812e1c12382 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Animal.java @@ -37,6 +37,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class Animal { + @JsonInclude(JsonInclude.Include.NON_NULL) private String className; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Category.java index f6a38799c911..03999441f921 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Category.java @@ -26,6 +26,7 @@ public class Category { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Long id; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name = "default-name"; public Category() { diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ContainerDefaultValue.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ContainerDefaultValue.java index 4a0936f8a784..a51bd99c90fc 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ContainerDefaultValue.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ContainerDefaultValue.java @@ -28,14 +28,14 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class ContainerDefaultValue { - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> nullableArray = JsonNullable.>undefined(); + @JsonInclude(JsonInclude.Include.ALWAYS) private JsonNullable> nullableRequiredArray = JsonNullable.>undefined(); + @JsonInclude(JsonInclude.Include.NON_NULL) private List requiredArray = new ArrayList<>(); - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> nullableArrayWithDefault = JsonNullable.>undefined(); public ContainerDefaultValue() { diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/EnumTest.java index cef26523d335..5bd8c11d9722 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/EnumTest.java @@ -104,6 +104,7 @@ public static EnumStringRequiredEnum fromValue(String value) { } } + @JsonInclude(JsonInclude.Include.NON_NULL) private EnumStringRequiredEnum enumStringRequired; /** diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/FormatTest.java index b4d90992ea4c..0cb8e0d45c2d 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/FormatTest.java @@ -40,6 +40,7 @@ public class FormatTest { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Long int64; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal number; @JsonInclude(JsonInclude.Include.NON_NULL) @@ -51,11 +52,13 @@ public class FormatTest { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable String string; + @JsonInclude(JsonInclude.Include.NON_NULL) private byte[] _byte; @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable org.springframework.core.io.Resource binary; + @JsonInclude(JsonInclude.Include.NON_NULL) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) private LocalDate date; @@ -66,6 +69,7 @@ public class FormatTest { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable UUID uuid; + @JsonInclude(JsonInclude.Include.NON_NULL) private String password; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Name.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Name.java index 2fc98b6fb666..4b44b936d3e2 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Name.java @@ -24,6 +24,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class Name { + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer name; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/NullableMapProperty.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/NullableMapProperty.java index 7330185d2021..31127013b739 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/NullableMapProperty.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/NullableMapProperty.java @@ -2,7 +2,6 @@ import java.net.URI; import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Arrays; @@ -28,7 +27,6 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class NullableMapProperty { - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> languageValues = JsonNullable.>undefined(); public NullableMapProperty languageValues(Map languageValues) { diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ParentWithNullable.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ParentWithNullable.java index d095e6659db9..d394b3e38431 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ParentWithNullable.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ParentWithNullable.java @@ -75,7 +75,6 @@ public static TypeEnum fromValue(String value) { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable TypeEnum type; - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable nullableProperty = JsonNullable.undefined(); public ParentWithNullable type(@Nullable TypeEnum type) { diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Pet.java index 673bb2e90254..728f7cad250d 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Pet.java @@ -38,8 +38,10 @@ public class Pet { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Category category; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name; + @JsonInclude(JsonInclude.Include.NON_NULL) private Set photoUrls = new LinkedHashSet<>(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/TypeHolderDefault.java index 81f9284d385e..79d663d04658 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -2,6 +2,7 @@ import java.net.URI; import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.math.BigDecimal; @@ -26,14 +27,19 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class TypeHolderDefault { + @JsonInclude(JsonInclude.Include.NON_NULL) private String stringItem = "what"; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal numberItem = new BigDecimal("1.234"); + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer integerItem = -2; + @JsonInclude(JsonInclude.Include.NON_NULL) private Boolean boolItem = true; + @JsonInclude(JsonInclude.Include.NON_NULL) private List arrayItem = new ArrayList<>(Arrays.asList(0, 1, 2, 3)); public TypeHolderDefault() { diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/TypeHolderExample.java index 8b1470e92bf0..31461adcaef0 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -2,6 +2,7 @@ import java.net.URI; import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.math.BigDecimal; @@ -26,16 +27,22 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class TypeHolderExample { + @JsonInclude(JsonInclude.Include.NON_NULL) private String stringItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal numberItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Float floatItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer integerItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Boolean boolItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private List arrayItem = new ArrayList<>(); public TypeHolderExample() { diff --git a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index 4798bc0c028d..fc4f770ac1d9 100644 --- a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -57,7 +57,6 @@ public class AdditionalPropertiesClass { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Object anytype1; - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable anytype2 = JsonNullable.undefined(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/Animal.java b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/Animal.java index 2f923496661e..7812e1c12382 100644 --- a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/Animal.java @@ -37,6 +37,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class Animal { + @JsonInclude(JsonInclude.Include.NON_NULL) private String className; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/Category.java index f6a38799c911..03999441f921 100644 --- a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/Category.java @@ -26,6 +26,7 @@ public class Category { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Long id; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name = "default-name"; public Category() { diff --git a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/ContainerDefaultValue.java b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/ContainerDefaultValue.java index 4a0936f8a784..a51bd99c90fc 100644 --- a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/ContainerDefaultValue.java +++ b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/ContainerDefaultValue.java @@ -28,14 +28,14 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class ContainerDefaultValue { - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> nullableArray = JsonNullable.>undefined(); + @JsonInclude(JsonInclude.Include.ALWAYS) private JsonNullable> nullableRequiredArray = JsonNullable.>undefined(); + @JsonInclude(JsonInclude.Include.NON_NULL) private List requiredArray = new ArrayList<>(); - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> nullableArrayWithDefault = JsonNullable.>undefined(); public ContainerDefaultValue() { diff --git a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/EnumTest.java index cef26523d335..5bd8c11d9722 100644 --- a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/EnumTest.java @@ -104,6 +104,7 @@ public static EnumStringRequiredEnum fromValue(String value) { } } + @JsonInclude(JsonInclude.Include.NON_NULL) private EnumStringRequiredEnum enumStringRequired; /** diff --git a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/FormatTest.java index b4d90992ea4c..0cb8e0d45c2d 100644 --- a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/FormatTest.java @@ -40,6 +40,7 @@ public class FormatTest { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Long int64; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal number; @JsonInclude(JsonInclude.Include.NON_NULL) @@ -51,11 +52,13 @@ public class FormatTest { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable String string; + @JsonInclude(JsonInclude.Include.NON_NULL) private byte[] _byte; @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable org.springframework.core.io.Resource binary; + @JsonInclude(JsonInclude.Include.NON_NULL) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) private LocalDate date; @@ -66,6 +69,7 @@ public class FormatTest { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable UUID uuid; + @JsonInclude(JsonInclude.Include.NON_NULL) private String password; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/Name.java b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/Name.java index 2fc98b6fb666..4b44b936d3e2 100644 --- a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/Name.java @@ -24,6 +24,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class Name { + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer name; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/NullableMapProperty.java b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/NullableMapProperty.java index 7330185d2021..31127013b739 100644 --- a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/NullableMapProperty.java +++ b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/NullableMapProperty.java @@ -2,7 +2,6 @@ import java.net.URI; import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Arrays; @@ -28,7 +27,6 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class NullableMapProperty { - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> languageValues = JsonNullable.>undefined(); public NullableMapProperty languageValues(Map languageValues) { diff --git a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/ParentWithNullable.java b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/ParentWithNullable.java index d095e6659db9..d394b3e38431 100644 --- a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/ParentWithNullable.java +++ b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/ParentWithNullable.java @@ -75,7 +75,6 @@ public static TypeEnum fromValue(String value) { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable TypeEnum type; - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable nullableProperty = JsonNullable.undefined(); public ParentWithNullable type(@Nullable TypeEnum type) { diff --git a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/Pet.java index 673bb2e90254..728f7cad250d 100644 --- a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/Pet.java @@ -38,8 +38,10 @@ public class Pet { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Category category; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name; + @JsonInclude(JsonInclude.Include.NON_NULL) private Set photoUrls = new LinkedHashSet<>(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/TypeHolderDefault.java index 81f9284d385e..79d663d04658 100644 --- a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -2,6 +2,7 @@ import java.net.URI; import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.math.BigDecimal; @@ -26,14 +27,19 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class TypeHolderDefault { + @JsonInclude(JsonInclude.Include.NON_NULL) private String stringItem = "what"; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal numberItem = new BigDecimal("1.234"); + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer integerItem = -2; + @JsonInclude(JsonInclude.Include.NON_NULL) private Boolean boolItem = true; + @JsonInclude(JsonInclude.Include.NON_NULL) private List arrayItem = new ArrayList<>(Arrays.asList(0, 1, 2, 3)); public TypeHolderDefault() { diff --git a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/TypeHolderExample.java index 8b1470e92bf0..31461adcaef0 100644 --- a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -2,6 +2,7 @@ import java.net.URI; import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.math.BigDecimal; @@ -26,16 +27,22 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class TypeHolderExample { + @JsonInclude(JsonInclude.Include.NON_NULL) private String stringItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal numberItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Float floatItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer integerItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Boolean boolItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private List arrayItem = new ArrayList<>(); public TypeHolderExample() { diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index 4798bc0c028d..fc4f770ac1d9 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -57,7 +57,6 @@ public class AdditionalPropertiesClass { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Object anytype1; - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable anytype2 = JsonNullable.undefined(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Animal.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Animal.java index 2f923496661e..7812e1c12382 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Animal.java @@ -37,6 +37,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class Animal { + @JsonInclude(JsonInclude.Include.NON_NULL) private String className; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Category.java index f6a38799c911..03999441f921 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Category.java @@ -26,6 +26,7 @@ public class Category { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Long id; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name = "default-name"; public Category() { diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ContainerDefaultValue.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ContainerDefaultValue.java index 4a0936f8a784..a51bd99c90fc 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ContainerDefaultValue.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ContainerDefaultValue.java @@ -28,14 +28,14 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class ContainerDefaultValue { - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> nullableArray = JsonNullable.>undefined(); + @JsonInclude(JsonInclude.Include.ALWAYS) private JsonNullable> nullableRequiredArray = JsonNullable.>undefined(); + @JsonInclude(JsonInclude.Include.NON_NULL) private List requiredArray = new ArrayList<>(); - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> nullableArrayWithDefault = JsonNullable.>undefined(); public ContainerDefaultValue() { diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/EnumTest.java index cef26523d335..5bd8c11d9722 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/EnumTest.java @@ -104,6 +104,7 @@ public static EnumStringRequiredEnum fromValue(String value) { } } + @JsonInclude(JsonInclude.Include.NON_NULL) private EnumStringRequiredEnum enumStringRequired; /** diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/FormatTest.java index b4d90992ea4c..0cb8e0d45c2d 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/FormatTest.java @@ -40,6 +40,7 @@ public class FormatTest { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Long int64; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal number; @JsonInclude(JsonInclude.Include.NON_NULL) @@ -51,11 +52,13 @@ public class FormatTest { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable String string; + @JsonInclude(JsonInclude.Include.NON_NULL) private byte[] _byte; @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable org.springframework.core.io.Resource binary; + @JsonInclude(JsonInclude.Include.NON_NULL) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) private LocalDate date; @@ -66,6 +69,7 @@ public class FormatTest { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable UUID uuid; + @JsonInclude(JsonInclude.Include.NON_NULL) private String password; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Name.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Name.java index 2fc98b6fb666..4b44b936d3e2 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Name.java @@ -24,6 +24,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class Name { + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer name; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/NullableMapProperty.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/NullableMapProperty.java index 7330185d2021..31127013b739 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/NullableMapProperty.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/NullableMapProperty.java @@ -2,7 +2,6 @@ import java.net.URI; import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Arrays; @@ -28,7 +27,6 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class NullableMapProperty { - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> languageValues = JsonNullable.>undefined(); public NullableMapProperty languageValues(Map languageValues) { diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ParentWithNullable.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ParentWithNullable.java index d095e6659db9..d394b3e38431 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ParentWithNullable.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ParentWithNullable.java @@ -75,7 +75,6 @@ public static TypeEnum fromValue(String value) { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable TypeEnum type; - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable nullableProperty = JsonNullable.undefined(); public ParentWithNullable type(@Nullable TypeEnum type) { diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Pet.java index 673bb2e90254..728f7cad250d 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Pet.java @@ -38,8 +38,10 @@ public class Pet { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Category category; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name; + @JsonInclude(JsonInclude.Include.NON_NULL) private Set photoUrls = new LinkedHashSet<>(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/TypeHolderDefault.java index 81f9284d385e..79d663d04658 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -2,6 +2,7 @@ import java.net.URI; import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.math.BigDecimal; @@ -26,14 +27,19 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class TypeHolderDefault { + @JsonInclude(JsonInclude.Include.NON_NULL) private String stringItem = "what"; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal numberItem = new BigDecimal("1.234"); + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer integerItem = -2; + @JsonInclude(JsonInclude.Include.NON_NULL) private Boolean boolItem = true; + @JsonInclude(JsonInclude.Include.NON_NULL) private List arrayItem = new ArrayList<>(Arrays.asList(0, 1, 2, 3)); public TypeHolderDefault() { diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/TypeHolderExample.java index 8b1470e92bf0..31461adcaef0 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -2,6 +2,7 @@ import java.net.URI; import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.math.BigDecimal; @@ -26,16 +27,22 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class TypeHolderExample { + @JsonInclude(JsonInclude.Include.NON_NULL) private String stringItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal numberItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Float floatItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer integerItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Boolean boolItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private List arrayItem = new ArrayList<>(); public TypeHolderExample() { diff --git a/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/model/Pet.java index 37d29c32b8da..c16ac8affc4e 100644 --- a/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/model/Pet.java @@ -36,8 +36,10 @@ public class Pet { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Category category; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name; + @JsonInclude(JsonInclude.Include.NON_NULL) private List photoUrls = new ArrayList<>(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index 86be6e693c91..32023ee3da1e 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -57,7 +57,6 @@ public class AdditionalPropertiesClass { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Object anytype1; - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable anytype2 = JsonNullable.undefined(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Animal.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Animal.java index f5dda830a79d..6ce4f7f8914c 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Animal.java @@ -37,6 +37,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class Animal { + @JsonInclude(JsonInclude.Include.NON_NULL) private String className; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Category.java index 48bdaa9344f8..11e1022ae3d3 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Category.java @@ -26,6 +26,7 @@ public class Category { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Long id; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name = "default-name"; public Category() { diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ContainerDefaultValue.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ContainerDefaultValue.java index 30539406b232..b6557ceff4e9 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ContainerDefaultValue.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ContainerDefaultValue.java @@ -28,14 +28,14 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class ContainerDefaultValue { - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> nullableArray = JsonNullable.>undefined(); + @JsonInclude(JsonInclude.Include.ALWAYS) private JsonNullable> nullableRequiredArray = JsonNullable.>undefined(); + @JsonInclude(JsonInclude.Include.NON_NULL) private List requiredArray = new ArrayList<>(); - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> nullableArrayWithDefault = JsonNullable.>undefined(); public ContainerDefaultValue() { diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/EnumTest.java index ef143d4788e3..8d3ed031d65d 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/EnumTest.java @@ -104,6 +104,7 @@ public static EnumStringRequiredEnum fromValue(String value) { } } + @JsonInclude(JsonInclude.Include.NON_NULL) private EnumStringRequiredEnum enumStringRequired; /** diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/FormatTest.java index c81f93c993ea..150781082c6d 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/FormatTest.java @@ -40,6 +40,7 @@ public class FormatTest { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Long int64; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal number; @JsonInclude(JsonInclude.Include.NON_NULL) @@ -51,11 +52,13 @@ public class FormatTest { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable String string; + @JsonInclude(JsonInclude.Include.NON_NULL) private byte[] _byte; @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable org.springframework.core.io.Resource binary; + @JsonInclude(JsonInclude.Include.NON_NULL) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) private LocalDate date; @@ -66,6 +69,7 @@ public class FormatTest { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable UUID uuid; + @JsonInclude(JsonInclude.Include.NON_NULL) private String password; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Name.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Name.java index bd408cc22a7c..76e74fd67579 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Name.java @@ -24,6 +24,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class Name { + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer name; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/NullableMapProperty.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/NullableMapProperty.java index 897b2fe03dd2..e2ceeea637fe 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/NullableMapProperty.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/NullableMapProperty.java @@ -2,7 +2,6 @@ import java.net.URI; import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Arrays; @@ -28,7 +27,6 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class NullableMapProperty { - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> languageValues = JsonNullable.>undefined(); public NullableMapProperty() { diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ParentWithNullable.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ParentWithNullable.java index 6f7cb3fcb82c..50c34a0c9121 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ParentWithNullable.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ParentWithNullable.java @@ -75,7 +75,6 @@ public static TypeEnum fromValue(String value) { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable TypeEnum type; - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable nullableProperty = JsonNullable.undefined(); public ParentWithNullable() { diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Pet.java index 4a92bd5c7782..ea586df2067a 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Pet.java @@ -38,8 +38,10 @@ public class Pet { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Category category; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name; + @JsonInclude(JsonInclude.Include.NON_NULL) private Set photoUrls = new LinkedHashSet<>(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/TypeHolderDefault.java index 157504edc6d6..d3800560158c 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -2,6 +2,7 @@ import java.net.URI; import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.math.BigDecimal; @@ -26,14 +27,19 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class TypeHolderDefault { + @JsonInclude(JsonInclude.Include.NON_NULL) private String stringItem = "what"; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal numberItem = new BigDecimal("1.234"); + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer integerItem = -2; + @JsonInclude(JsonInclude.Include.NON_NULL) private Boolean boolItem = true; + @JsonInclude(JsonInclude.Include.NON_NULL) private List arrayItem = new ArrayList<>(Arrays.asList(0, 1, 2, 3)); public TypeHolderDefault() { diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/TypeHolderExample.java index 405f1100a495..03b53c193ee8 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -2,6 +2,7 @@ import java.net.URI; import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.math.BigDecimal; @@ -26,16 +27,22 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class TypeHolderExample { + @JsonInclude(JsonInclude.Include.NON_NULL) private String stringItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal numberItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Float floatItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer integerItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Boolean boolItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private List arrayItem = new ArrayList<>(); public TypeHolderExample() { diff --git a/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/src/main/java/org/openapitools/model/Pet.java index c4d654ac44a6..bdce7e27156f 100644 --- a/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/src/main/java/org/openapitools/model/Pet.java @@ -34,8 +34,10 @@ public class Pet { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Category category; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name; + @JsonInclude(JsonInclude.Include.NON_NULL) private List photoUrls = new ArrayList<>(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index 3a1809dfa191..3f6cf5af234f 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -57,7 +57,6 @@ public class AdditionalPropertiesClass { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Object anytype1; - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable anytype2 = JsonNullable.undefined(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Animal.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Animal.java index 99e7a4cdca08..dac8f14035fc 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Animal.java @@ -37,6 +37,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class Animal { + @JsonInclude(JsonInclude.Include.NON_NULL) private String className; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Category.java index 75246c9ff8ce..d15dbbf7d60c 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Category.java @@ -26,6 +26,7 @@ public class Category { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Long id; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name = "default-name"; public Category() { diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ContainerDefaultValue.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ContainerDefaultValue.java index 0e937a87f12b..1e996c854efe 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ContainerDefaultValue.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ContainerDefaultValue.java @@ -28,14 +28,14 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class ContainerDefaultValue { - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> nullableArray = JsonNullable.>undefined(); + @JsonInclude(JsonInclude.Include.ALWAYS) private JsonNullable> nullableRequiredArray = JsonNullable.>undefined(); + @JsonInclude(JsonInclude.Include.NON_NULL) private List requiredArray = new ArrayList<>(); - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> nullableArrayWithDefault = JsonNullable.>undefined(); public ContainerDefaultValue() { diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/EnumTest.java index c8c06116f9a1..795d53cd01a6 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/EnumTest.java @@ -104,6 +104,7 @@ public static EnumStringRequiredEnum fromValue(String value) { } } + @JsonInclude(JsonInclude.Include.NON_NULL) private EnumStringRequiredEnum enumStringRequired; /** diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/FormatTest.java index e99a9a785740..79dc8a7432ae 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/FormatTest.java @@ -40,6 +40,7 @@ public class FormatTest { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Long int64; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal number; @JsonInclude(JsonInclude.Include.NON_NULL) @@ -51,11 +52,13 @@ public class FormatTest { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable String string; + @JsonInclude(JsonInclude.Include.NON_NULL) private byte[] _byte; @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable org.springframework.core.io.Resource binary; + @JsonInclude(JsonInclude.Include.NON_NULL) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) private LocalDate date; @@ -66,6 +69,7 @@ public class FormatTest { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable UUID uuid; + @JsonInclude(JsonInclude.Include.NON_NULL) private String password; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Name.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Name.java index 3a21421bf13c..4fd62bd3f389 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Name.java @@ -24,6 +24,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class Name { + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer name; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/NullableMapProperty.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/NullableMapProperty.java index 14cce68e1223..56d45c3ad292 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/NullableMapProperty.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/NullableMapProperty.java @@ -2,7 +2,6 @@ import java.net.URI; import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Arrays; @@ -28,7 +27,6 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class NullableMapProperty { - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> languageValues = JsonNullable.>undefined(); public NullableMapProperty languageValues(Map languageValues) { diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ParentWithNullable.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ParentWithNullable.java index 2b706856fd92..af16949486cc 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ParentWithNullable.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ParentWithNullable.java @@ -75,7 +75,6 @@ public static TypeEnum fromValue(String value) { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable TypeEnum type; - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable nullableProperty = JsonNullable.undefined(); public ParentWithNullable type(@Nullable TypeEnum type) { diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Pet.java index cf4719096fb0..1b1399efc065 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Pet.java @@ -38,8 +38,10 @@ public class Pet { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Category category; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name; + @JsonInclude(JsonInclude.Include.NON_NULL) private Set photoUrls = new LinkedHashSet<>(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/TypeHolderDefault.java index 7cc05e11b994..57fabf941047 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -2,6 +2,7 @@ import java.net.URI; import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.math.BigDecimal; @@ -26,14 +27,19 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class TypeHolderDefault { + @JsonInclude(JsonInclude.Include.NON_NULL) private String stringItem = "what"; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal numberItem = new BigDecimal("1.234"); + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer integerItem = -2; + @JsonInclude(JsonInclude.Include.NON_NULL) private Boolean boolItem = true; + @JsonInclude(JsonInclude.Include.NON_NULL) private List arrayItem = new ArrayList<>(Arrays.asList(0, 1, 2, 3)); public TypeHolderDefault() { diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/TypeHolderExample.java index a2f08996fefa..ab33d9a13ef8 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -2,6 +2,7 @@ import java.net.URI; import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.math.BigDecimal; @@ -26,16 +27,22 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class TypeHolderExample { + @JsonInclude(JsonInclude.Include.NON_NULL) private String stringItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal numberItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Float floatItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer integerItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Boolean boolItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private List arrayItem = new ArrayList<>(); public TypeHolderExample() { diff --git a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/AdditionalPropertiesClassDto.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/AdditionalPropertiesClassDto.java index 37d3f00f767f..9ea7f74985a9 100644 --- a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/AdditionalPropertiesClassDto.java +++ b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/AdditionalPropertiesClassDto.java @@ -59,7 +59,6 @@ public class AdditionalPropertiesClassDto { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Object anytype1; - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable anytype2 = JsonNullable.undefined(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/AnimalDto.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/AnimalDto.java index 234aef7fb345..fe05be4b1c68 100644 --- a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/AnimalDto.java +++ b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/AnimalDto.java @@ -38,6 +38,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class AnimalDto { + @JsonInclude(JsonInclude.Include.NON_NULL) private String className; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/CategoryDto.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/CategoryDto.java index b54dbbd66b7f..e62f4eb17757 100644 --- a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/CategoryDto.java +++ b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/CategoryDto.java @@ -28,6 +28,7 @@ public class CategoryDto { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Long id; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name = "default-name"; public CategoryDto() { diff --git a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/ContainerDefaultValueDto.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/ContainerDefaultValueDto.java index fe421ec5cd1d..2bc02f7a7cc3 100644 --- a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/ContainerDefaultValueDto.java +++ b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/ContainerDefaultValueDto.java @@ -30,14 +30,14 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class ContainerDefaultValueDto { - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> nullableArray = JsonNullable.>undefined(); + @JsonInclude(JsonInclude.Include.ALWAYS) private JsonNullable> nullableRequiredArray = JsonNullable.>undefined(); + @JsonInclude(JsonInclude.Include.NON_NULL) private List requiredArray = new ArrayList<>(); - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> nullableArrayWithDefault = JsonNullable.>undefined(); public ContainerDefaultValueDto() { diff --git a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/EnumTestDto.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/EnumTestDto.java index 7bd7ee977200..4d3330046620 100644 --- a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/EnumTestDto.java +++ b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/EnumTestDto.java @@ -104,6 +104,7 @@ public static EnumStringRequiredEnum fromValue(String value) { } } + @JsonInclude(JsonInclude.Include.NON_NULL) private EnumStringRequiredEnum enumStringRequired; /** diff --git a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/FormatTestDto.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/FormatTestDto.java index 5894378400d2..e4f7ebda46b3 100644 --- a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/FormatTestDto.java +++ b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/FormatTestDto.java @@ -40,6 +40,7 @@ public class FormatTestDto { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Long int64; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal number; @JsonInclude(JsonInclude.Include.NON_NULL) @@ -51,11 +52,13 @@ public class FormatTestDto { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable String string; + @JsonInclude(JsonInclude.Include.NON_NULL) private byte[] _byte; @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable org.springframework.core.io.Resource binary; + @JsonInclude(JsonInclude.Include.NON_NULL) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) private LocalDate date; @@ -66,6 +69,7 @@ public class FormatTestDto { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable UUID uuid; + @JsonInclude(JsonInclude.Include.NON_NULL) private String password; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/NameDto.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/NameDto.java index 6561257a70c2..6055fd7ceb2d 100644 --- a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/NameDto.java +++ b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/NameDto.java @@ -26,6 +26,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class NameDto { + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer name; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/NullableMapPropertyDto.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/NullableMapPropertyDto.java index e82c4b3a1679..98ba228cdc9b 100644 --- a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/NullableMapPropertyDto.java +++ b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/NullableMapPropertyDto.java @@ -2,7 +2,6 @@ import java.net.URI; import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -30,7 +29,6 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class NullableMapPropertyDto { - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> languageValues = JsonNullable.>undefined(); public NullableMapPropertyDto languageValues(Map languageValues) { diff --git a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/ParentWithNullableDto.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/ParentWithNullableDto.java index b4a5e5095239..982f8d038258 100644 --- a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/ParentWithNullableDto.java +++ b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/ParentWithNullableDto.java @@ -76,7 +76,6 @@ public static TypeEnum fromValue(String value) { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable TypeEnum type; - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable nullableProperty = JsonNullable.undefined(); public ParentWithNullableDto type(@Nullable TypeEnum type) { diff --git a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/PetDto.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/PetDto.java index a760602c8d73..84bb38e9fc00 100644 --- a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/PetDto.java +++ b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/PetDto.java @@ -40,8 +40,10 @@ public class PetDto { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable CategoryDto category; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name; + @JsonInclude(JsonInclude.Include.NON_NULL) private Set photoUrls = new LinkedHashSet<>(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/TypeHolderDefaultDto.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/TypeHolderDefaultDto.java index f59eb21da480..4fba162597a9 100644 --- a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/TypeHolderDefaultDto.java +++ b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/TypeHolderDefaultDto.java @@ -2,6 +2,7 @@ import java.net.URI; import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -28,14 +29,19 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class TypeHolderDefaultDto { + @JsonInclude(JsonInclude.Include.NON_NULL) private String stringItem = "what"; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal numberItem = new BigDecimal("1.234"); + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer integerItem = -2; + @JsonInclude(JsonInclude.Include.NON_NULL) private Boolean boolItem = true; + @JsonInclude(JsonInclude.Include.NON_NULL) private List arrayItem = new ArrayList<>(Arrays.asList(0, 1, 2, 3)); public TypeHolderDefaultDto() { diff --git a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/TypeHolderExampleDto.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/TypeHolderExampleDto.java index 4b7506f903ec..fb1d40011dac 100644 --- a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/TypeHolderExampleDto.java +++ b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/TypeHolderExampleDto.java @@ -2,6 +2,7 @@ import java.net.URI; import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -28,16 +29,22 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class TypeHolderExampleDto { + @JsonInclude(JsonInclude.Include.NON_NULL) private String stringItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal numberItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Float floatItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer integerItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Boolean boolItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private List arrayItem = new ArrayList<>(); public TypeHolderExampleDto() { diff --git a/samples/server/petstore/springboot-lombok-data/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/springboot-lombok-data/src/main/java/org/openapitools/model/Category.java index 8bebe53b3407..327bdbf43f5b 100644 --- a/samples/server/petstore/springboot-lombok-data/src/main/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/springboot-lombok-data/src/main/java/org/openapitools/model/Category.java @@ -32,14 +32,14 @@ public class Category { @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("id") - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_EMPTY) private @Nullable Long id; @Pattern(regexp = "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name") - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_EMPTY) private @Nullable String name; } diff --git a/samples/server/petstore/springboot-lombok-data/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/springboot-lombok-data/src/main/java/org/openapitools/model/ModelApiResponse.java index 741915556d54..7eba849384a7 100644 --- a/samples/server/petstore/springboot-lombok-data/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/springboot-lombok-data/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -34,21 +34,21 @@ public class ModelApiResponse { @Schema(name = "code", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("code") - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_EMPTY) private @Nullable Integer code; @Schema(name = "type", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("type") - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_EMPTY) private @Nullable String type; @Schema(name = "message", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("message") - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_EMPTY) private @Nullable String message; } diff --git a/samples/server/petstore/springboot-lombok-data/src/main/java/org/openapitools/model/Order.java b/samples/server/petstore/springboot-lombok-data/src/main/java/org/openapitools/model/Order.java index c3b14de3f295..9638d243a3e9 100644 --- a/samples/server/petstore/springboot-lombok-data/src/main/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/springboot-lombok-data/src/main/java/org/openapitools/model/Order.java @@ -35,28 +35,28 @@ public class Order { @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("id") - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_EMPTY) private @Nullable Long id; @Schema(name = "petId", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("petId") - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_EMPTY) private @Nullable Long petId; @Schema(name = "quantity", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("quantity") - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_EMPTY) private @Nullable Integer quantity; @Valid @Schema(name = "shipDate", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("shipDate") - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_EMPTY) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private @Nullable OffsetDateTime shipDate; @@ -101,7 +101,7 @@ public static StatusEnum fromValue(String value) { @Schema(name = "status", description = "Order Status", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("status") - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_EMPTY) private @Nullable StatusEnum status; @@ -109,7 +109,7 @@ public static StatusEnum fromValue(String value) { @JsonProperty("complete") @lombok.Builder.Default - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_EMPTY) private Boolean complete = false; } diff --git a/samples/server/petstore/springboot-lombok-data/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-lombok-data/src/main/java/org/openapitools/model/Pet.java index abb9aa57acef..f7fcbc4a1758 100644 --- a/samples/server/petstore/springboot-lombok-data/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-lombok-data/src/main/java/org/openapitools/model/Pet.java @@ -38,20 +38,21 @@ public class Pet { @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("id") - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_EMPTY) private @Nullable Long id; @Valid @Schema(name = "category", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("category") - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_EMPTY) private @Nullable Category category; @NotNull @Schema(name = "name", example = "doggie", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("name") + @JsonInclude(JsonInclude.Include.NON_NULL) private String name; @@ -59,6 +60,7 @@ public class Pet { @JsonProperty("photoUrls") @lombok.Builder.Default + @JsonInclude(JsonInclude.Include.NON_NULL) private List photoUrls = new ArrayList<>(); @@ -66,7 +68,7 @@ public class Pet { @JsonProperty("tags") @lombok.Builder.Default - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_EMPTY) private List<@Valid Tag> tags = new ArrayList<>(); /** @@ -110,7 +112,7 @@ public static StatusEnum fromValue(String value) { @Schema(name = "status", description = "pet status in the store", deprecated = true, requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("status") - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_EMPTY) @Deprecated private @Nullable StatusEnum status; diff --git a/samples/server/petstore/springboot-lombok-data/src/main/java/org/openapitools/model/Tag.java b/samples/server/petstore/springboot-lombok-data/src/main/java/org/openapitools/model/Tag.java index 0a70bef0dd88..af73a26fa88c 100644 --- a/samples/server/petstore/springboot-lombok-data/src/main/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/springboot-lombok-data/src/main/java/org/openapitools/model/Tag.java @@ -32,14 +32,14 @@ public class Tag { @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("id") - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_EMPTY) private @Nullable Long id; @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name") - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_EMPTY) private @Nullable String name; } diff --git a/samples/server/petstore/springboot-lombok-data/src/main/java/org/openapitools/model/User.java b/samples/server/petstore/springboot-lombok-data/src/main/java/org/openapitools/model/User.java index df90dcfb454d..34a4dd74e2fc 100644 --- a/samples/server/petstore/springboot-lombok-data/src/main/java/org/openapitools/model/User.java +++ b/samples/server/petstore/springboot-lombok-data/src/main/java/org/openapitools/model/User.java @@ -32,56 +32,56 @@ public class User { @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("id") - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_EMPTY) private @Nullable Long id; @Schema(name = "username", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("username") - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_EMPTY) private @Nullable String username; @Schema(name = "firstName", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("firstName") - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_EMPTY) private @Nullable String firstName; @Schema(name = "lastName", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("lastName") - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_EMPTY) private @Nullable String lastName; @Schema(name = "email", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("email") - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_EMPTY) private @Nullable String email; @Schema(name = "password", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("password") - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_EMPTY) private @Nullable String password; @Schema(name = "phone", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("phone") - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_EMPTY) private @Nullable String phone; @Schema(name = "userStatus", description = "User Status", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("userStatus") - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_EMPTY) private @Nullable Integer userStatus; } diff --git a/samples/server/petstore/springboot-lombok-tostring/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-lombok-tostring/src/main/java/org/openapitools/model/Pet.java index 3819f2efd3fb..1a5e177b89a4 100644 --- a/samples/server/petstore/springboot-lombok-tostring/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-lombok-tostring/src/main/java/org/openapitools/model/Pet.java @@ -41,8 +41,10 @@ public class Pet { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Category category; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name; + @JsonInclude(JsonInclude.Include.NON_NULL) private List photoUrls = new ArrayList<>(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-paged-model/src/main/java/org/openapitools/model/PageMeta.java b/samples/server/petstore/springboot-paged-model/src/main/java/org/openapitools/model/PageMeta.java index 6c356b8a5b13..a1a34c2041d5 100644 --- a/samples/server/petstore/springboot-paged-model/src/main/java/org/openapitools/model/PageMeta.java +++ b/samples/server/petstore/springboot-paged-model/src/main/java/org/openapitools/model/PageMeta.java @@ -2,6 +2,7 @@ import java.net.URI; import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import org.springframework.lang.Nullable; @@ -24,12 +25,16 @@ public class PageMeta implements Serializable { private static final long serialVersionUID = 1L; + @JsonInclude(JsonInclude.Include.NON_NULL) private Long size; + @JsonInclude(JsonInclude.Include.NON_NULL) private Long number; + @JsonInclude(JsonInclude.Include.NON_NULL) private Long totalElements; + @JsonInclude(JsonInclude.Include.NON_NULL) private Long totalPages; public PageMeta() { diff --git a/samples/server/petstore/springboot-paged-model/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-paged-model/src/main/java/org/openapitools/model/Pet.java index 477568049136..5bbe5fb75ae0 100644 --- a/samples/server/petstore/springboot-paged-model/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-paged-model/src/main/java/org/openapitools/model/Pet.java @@ -28,6 +28,7 @@ public class Pet implements Serializable { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Long id; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-petstore-with-api-response-examples/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-petstore-with-api-response-examples/src/main/java/org/openapitools/model/Pet.java index 37d29c32b8da..c16ac8affc4e 100644 --- a/samples/server/petstore/springboot-petstore-with-api-response-examples/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-petstore-with-api-response-examples/src/main/java/org/openapitools/model/Pet.java @@ -36,8 +36,10 @@ public class Pet { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Category category; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name; + @JsonInclude(JsonInclude.Include.NON_NULL) private List photoUrls = new ArrayList<>(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index 4798bc0c028d..fc4f770ac1d9 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -57,7 +57,6 @@ public class AdditionalPropertiesClass { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Object anytype1; - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable anytype2 = JsonNullable.undefined(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/Animal.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/Animal.java index 2f923496661e..7812e1c12382 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/Animal.java @@ -37,6 +37,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class Animal { + @JsonInclude(JsonInclude.Include.NON_NULL) private String className; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/Category.java index f6a38799c911..03999441f921 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/Category.java @@ -26,6 +26,7 @@ public class Category { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Long id; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name = "default-name"; public Category() { diff --git a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/ContainerDefaultValue.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/ContainerDefaultValue.java index 4a0936f8a784..a51bd99c90fc 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/ContainerDefaultValue.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/ContainerDefaultValue.java @@ -28,14 +28,14 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class ContainerDefaultValue { - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> nullableArray = JsonNullable.>undefined(); + @JsonInclude(JsonInclude.Include.ALWAYS) private JsonNullable> nullableRequiredArray = JsonNullable.>undefined(); + @JsonInclude(JsonInclude.Include.NON_NULL) private List requiredArray = new ArrayList<>(); - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> nullableArrayWithDefault = JsonNullable.>undefined(); public ContainerDefaultValue() { diff --git a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/EnumTest.java index cef26523d335..5bd8c11d9722 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/EnumTest.java @@ -104,6 +104,7 @@ public static EnumStringRequiredEnum fromValue(String value) { } } + @JsonInclude(JsonInclude.Include.NON_NULL) private EnumStringRequiredEnum enumStringRequired; /** diff --git a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/FormatTest.java index b4d90992ea4c..0cb8e0d45c2d 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/FormatTest.java @@ -40,6 +40,7 @@ public class FormatTest { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Long int64; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal number; @JsonInclude(JsonInclude.Include.NON_NULL) @@ -51,11 +52,13 @@ public class FormatTest { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable String string; + @JsonInclude(JsonInclude.Include.NON_NULL) private byte[] _byte; @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable org.springframework.core.io.Resource binary; + @JsonInclude(JsonInclude.Include.NON_NULL) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) private LocalDate date; @@ -66,6 +69,7 @@ public class FormatTest { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable UUID uuid; + @JsonInclude(JsonInclude.Include.NON_NULL) private String password; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/Name.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/Name.java index 2fc98b6fb666..4b44b936d3e2 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/Name.java @@ -24,6 +24,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class Name { + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer name; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/NullableMapProperty.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/NullableMapProperty.java index 7330185d2021..31127013b739 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/NullableMapProperty.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/NullableMapProperty.java @@ -2,7 +2,6 @@ import java.net.URI; import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Arrays; @@ -28,7 +27,6 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class NullableMapProperty { - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> languageValues = JsonNullable.>undefined(); public NullableMapProperty languageValues(Map languageValues) { diff --git a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/ParentWithNullable.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/ParentWithNullable.java index d095e6659db9..d394b3e38431 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/ParentWithNullable.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/ParentWithNullable.java @@ -75,7 +75,6 @@ public static TypeEnum fromValue(String value) { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable TypeEnum type; - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable nullableProperty = JsonNullable.undefined(); public ParentWithNullable type(@Nullable TypeEnum type) { diff --git a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/Pet.java index 673bb2e90254..728f7cad250d 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/Pet.java @@ -38,8 +38,10 @@ public class Pet { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Category category; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name; + @JsonInclude(JsonInclude.Include.NON_NULL) private Set photoUrls = new LinkedHashSet<>(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/TypeHolderDefault.java index 81f9284d385e..79d663d04658 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -2,6 +2,7 @@ import java.net.URI; import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.math.BigDecimal; @@ -26,14 +27,19 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class TypeHolderDefault { + @JsonInclude(JsonInclude.Include.NON_NULL) private String stringItem = "what"; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal numberItem = new BigDecimal("1.234"); + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer integerItem = -2; + @JsonInclude(JsonInclude.Include.NON_NULL) private Boolean boolItem = true; + @JsonInclude(JsonInclude.Include.NON_NULL) private List arrayItem = new ArrayList<>(Arrays.asList(0, 1, 2, 3)); public TypeHolderDefault() { diff --git a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/TypeHolderExample.java index 8b1470e92bf0..31461adcaef0 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -2,6 +2,7 @@ import java.net.URI; import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.math.BigDecimal; @@ -26,16 +27,22 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class TypeHolderExample { + @JsonInclude(JsonInclude.Include.NON_NULL) private String stringItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal numberItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Float floatItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer integerItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Boolean boolItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private List arrayItem = new ArrayList<>(); public TypeHolderExample() { diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index 4798bc0c028d..fc4f770ac1d9 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -57,7 +57,6 @@ public class AdditionalPropertiesClass { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Object anytype1; - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable anytype2 = JsonNullable.undefined(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Animal.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Animal.java index 2f923496661e..7812e1c12382 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Animal.java @@ -37,6 +37,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class Animal { + @JsonInclude(JsonInclude.Include.NON_NULL) private String className; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Category.java index f6a38799c911..03999441f921 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Category.java @@ -26,6 +26,7 @@ public class Category { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Long id; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name = "default-name"; public Category() { diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ContainerDefaultValue.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ContainerDefaultValue.java index 4a0936f8a784..a51bd99c90fc 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ContainerDefaultValue.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ContainerDefaultValue.java @@ -28,14 +28,14 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class ContainerDefaultValue { - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> nullableArray = JsonNullable.>undefined(); + @JsonInclude(JsonInclude.Include.ALWAYS) private JsonNullable> nullableRequiredArray = JsonNullable.>undefined(); + @JsonInclude(JsonInclude.Include.NON_NULL) private List requiredArray = new ArrayList<>(); - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> nullableArrayWithDefault = JsonNullable.>undefined(); public ContainerDefaultValue() { diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/EnumTest.java index cef26523d335..5bd8c11d9722 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/EnumTest.java @@ -104,6 +104,7 @@ public static EnumStringRequiredEnum fromValue(String value) { } } + @JsonInclude(JsonInclude.Include.NON_NULL) private EnumStringRequiredEnum enumStringRequired; /** diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/FormatTest.java index b4d90992ea4c..0cb8e0d45c2d 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/FormatTest.java @@ -40,6 +40,7 @@ public class FormatTest { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Long int64; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal number; @JsonInclude(JsonInclude.Include.NON_NULL) @@ -51,11 +52,13 @@ public class FormatTest { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable String string; + @JsonInclude(JsonInclude.Include.NON_NULL) private byte[] _byte; @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable org.springframework.core.io.Resource binary; + @JsonInclude(JsonInclude.Include.NON_NULL) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) private LocalDate date; @@ -66,6 +69,7 @@ public class FormatTest { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable UUID uuid; + @JsonInclude(JsonInclude.Include.NON_NULL) private String password; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Name.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Name.java index 2fc98b6fb666..4b44b936d3e2 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Name.java @@ -24,6 +24,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class Name { + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer name; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/NullableMapProperty.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/NullableMapProperty.java index 7330185d2021..31127013b739 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/NullableMapProperty.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/NullableMapProperty.java @@ -2,7 +2,6 @@ import java.net.URI; import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Arrays; @@ -28,7 +27,6 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class NullableMapProperty { - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> languageValues = JsonNullable.>undefined(); public NullableMapProperty languageValues(Map languageValues) { diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ParentWithNullable.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ParentWithNullable.java index d095e6659db9..d394b3e38431 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ParentWithNullable.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ParentWithNullable.java @@ -75,7 +75,6 @@ public static TypeEnum fromValue(String value) { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable TypeEnum type; - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable nullableProperty = JsonNullable.undefined(); public ParentWithNullable type(@Nullable TypeEnum type) { diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Pet.java index 673bb2e90254..728f7cad250d 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Pet.java @@ -38,8 +38,10 @@ public class Pet { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Category category; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name; + @JsonInclude(JsonInclude.Include.NON_NULL) private Set photoUrls = new LinkedHashSet<>(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/TypeHolderDefault.java index 81f9284d385e..79d663d04658 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -2,6 +2,7 @@ import java.net.URI; import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.math.BigDecimal; @@ -26,14 +27,19 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class TypeHolderDefault { + @JsonInclude(JsonInclude.Include.NON_NULL) private String stringItem = "what"; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal numberItem = new BigDecimal("1.234"); + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer integerItem = -2; + @JsonInclude(JsonInclude.Include.NON_NULL) private Boolean boolItem = true; + @JsonInclude(JsonInclude.Include.NON_NULL) private List arrayItem = new ArrayList<>(Arrays.asList(0, 1, 2, 3)); public TypeHolderDefault() { diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/TypeHolderExample.java index 8b1470e92bf0..31461adcaef0 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -2,6 +2,7 @@ import java.net.URI; import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.math.BigDecimal; @@ -26,16 +27,22 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class TypeHolderExample { + @JsonInclude(JsonInclude.Include.NON_NULL) private String stringItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal numberItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Float floatItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer integerItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Boolean boolItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private List arrayItem = new ArrayList<>(); public TypeHolderExample() { diff --git a/samples/server/petstore/springboot-sort-validation/src/main/java/org/openapitools/model/NullableModel.java b/samples/server/petstore/springboot-sort-validation/src/main/java/org/openapitools/model/NullableModel.java index cad9a99b10f5..e6fa1ccea8b4 100644 --- a/samples/server/petstore/springboot-sort-validation/src/main/java/org/openapitools/model/NullableModel.java +++ b/samples/server/petstore/springboot-sort-validation/src/main/java/org/openapitools/model/NullableModel.java @@ -28,14 +28,15 @@ public class NullableModel implements Serializable { private static final long serialVersionUID = 1L; + @JsonInclude(JsonInclude.Include.NON_NULL) private String requiredNonNullable; + @JsonInclude(JsonInclude.Include.ALWAYS) private JsonNullable requiredNullable = JsonNullable.undefined(); @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable String optionalNonNullable; - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable optionalNullable = JsonNullable.undefined(); public NullableModel() { diff --git a/samples/server/petstore/springboot-sort-validation/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-sort-validation/src/main/java/org/openapitools/model/Pet.java index 81f0dd9c6551..5ec773c75180 100644 --- a/samples/server/petstore/springboot-sort-validation/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-sort-validation/src/main/java/org/openapitools/model/Pet.java @@ -28,6 +28,7 @@ public class Pet implements Serializable { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Long id; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Animal.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Animal.java index 4e0c294dd76c..bceaaab0ee8e 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Animal.java @@ -36,6 +36,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class Animal { + @JsonInclude(JsonInclude.Include.NON_NULL) private String className; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Category.java index f6a38799c911..03999441f921 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Category.java @@ -26,6 +26,7 @@ public class Category { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Long id; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name = "default-name"; public Category() { diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/EnumTest.java index cef26523d335..5bd8c11d9722 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/EnumTest.java @@ -104,6 +104,7 @@ public static EnumStringRequiredEnum fromValue(String value) { } } + @JsonInclude(JsonInclude.Include.NON_NULL) private EnumStringRequiredEnum enumStringRequired; /** diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/FormatTest.java index cb174a615f9b..e24c2373ad81 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/FormatTest.java @@ -40,6 +40,7 @@ public class FormatTest { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Long int64; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal number; @JsonInclude(JsonInclude.Include.NON_NULL) @@ -51,11 +52,13 @@ public class FormatTest { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable String string; + @JsonInclude(JsonInclude.Include.NON_NULL) private byte[] _byte; @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable org.springframework.core.io.Resource binary; + @JsonInclude(JsonInclude.Include.NON_NULL) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) private LocalDate date; @@ -66,6 +69,7 @@ public class FormatTest { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable UUID uuid; + @JsonInclude(JsonInclude.Include.NON_NULL) private String password; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Name.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Name.java index 2fc98b6fb666..4b44b936d3e2 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Name.java @@ -24,6 +24,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class Name { + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer name; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Pet.java index e58434a4f202..63a0767c6aba 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Pet.java @@ -35,8 +35,10 @@ public class Pet { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Category category; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name; + @JsonInclude(JsonInclude.Include.NON_NULL) private List photoUrls = new ArrayList<>(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/TypeHolderDefault.java index e3ff9a400f74..94004510586d 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -2,6 +2,7 @@ import java.net.URI; import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.math.BigDecimal; @@ -26,14 +27,19 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class TypeHolderDefault { + @JsonInclude(JsonInclude.Include.NON_NULL) private String stringItem = "what"; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal numberItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer integerItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Boolean boolItem = true; + @JsonInclude(JsonInclude.Include.NON_NULL) private List arrayItem = new ArrayList<>(); public TypeHolderDefault() { diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/TypeHolderExample.java index 8b1470e92bf0..31461adcaef0 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -2,6 +2,7 @@ import java.net.URI; import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.math.BigDecimal; @@ -26,16 +27,22 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class TypeHolderExample { + @JsonInclude(JsonInclude.Include.NON_NULL) private String stringItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal numberItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Float floatItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer integerItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Boolean boolItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private List arrayItem = new ArrayList<>(); public TypeHolderExample() { diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Animal.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Animal.java index 4e0c294dd76c..bceaaab0ee8e 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Animal.java @@ -36,6 +36,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class Animal { + @JsonInclude(JsonInclude.Include.NON_NULL) private String className; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Category.java index f6a38799c911..03999441f921 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Category.java @@ -26,6 +26,7 @@ public class Category { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Long id; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name = "default-name"; public Category() { diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/EnumTest.java index cef26523d335..5bd8c11d9722 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/EnumTest.java @@ -104,6 +104,7 @@ public static EnumStringRequiredEnum fromValue(String value) { } } + @JsonInclude(JsonInclude.Include.NON_NULL) private EnumStringRequiredEnum enumStringRequired; /** diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/FormatTest.java index cb174a615f9b..e24c2373ad81 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/FormatTest.java @@ -40,6 +40,7 @@ public class FormatTest { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Long int64; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal number; @JsonInclude(JsonInclude.Include.NON_NULL) @@ -51,11 +52,13 @@ public class FormatTest { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable String string; + @JsonInclude(JsonInclude.Include.NON_NULL) private byte[] _byte; @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable org.springframework.core.io.Resource binary; + @JsonInclude(JsonInclude.Include.NON_NULL) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) private LocalDate date; @@ -66,6 +69,7 @@ public class FormatTest { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable UUID uuid; + @JsonInclude(JsonInclude.Include.NON_NULL) private String password; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Name.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Name.java index 2fc98b6fb666..4b44b936d3e2 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Name.java @@ -24,6 +24,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class Name { + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer name; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Pet.java index e58434a4f202..63a0767c6aba 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Pet.java @@ -35,8 +35,10 @@ public class Pet { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Category category; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name; + @JsonInclude(JsonInclude.Include.NON_NULL) private List photoUrls = new ArrayList<>(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/TypeHolderDefault.java index e3ff9a400f74..94004510586d 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -2,6 +2,7 @@ import java.net.URI; import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.math.BigDecimal; @@ -26,14 +27,19 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class TypeHolderDefault { + @JsonInclude(JsonInclude.Include.NON_NULL) private String stringItem = "what"; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal numberItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer integerItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Boolean boolItem = true; + @JsonInclude(JsonInclude.Include.NON_NULL) private List arrayItem = new ArrayList<>(); public TypeHolderDefault() { diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/TypeHolderExample.java index 8b1470e92bf0..31461adcaef0 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -2,6 +2,7 @@ import java.net.URI; import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.math.BigDecimal; @@ -26,16 +27,22 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class TypeHolderExample { + @JsonInclude(JsonInclude.Include.NON_NULL) private String stringItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal numberItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Float floatItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer integerItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Boolean boolItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private List arrayItem = new ArrayList<>(); public TypeHolderExample() { diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Animal.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Animal.java index 4e0c294dd76c..bceaaab0ee8e 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Animal.java @@ -36,6 +36,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class Animal { + @JsonInclude(JsonInclude.Include.NON_NULL) private String className; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Category.java index f6a38799c911..03999441f921 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Category.java @@ -26,6 +26,7 @@ public class Category { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Long id; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name = "default-name"; public Category() { diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/EnumTest.java index cef26523d335..5bd8c11d9722 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/EnumTest.java @@ -104,6 +104,7 @@ public static EnumStringRequiredEnum fromValue(String value) { } } + @JsonInclude(JsonInclude.Include.NON_NULL) private EnumStringRequiredEnum enumStringRequired; /** diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/FormatTest.java index cb174a615f9b..e24c2373ad81 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/FormatTest.java @@ -40,6 +40,7 @@ public class FormatTest { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Long int64; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal number; @JsonInclude(JsonInclude.Include.NON_NULL) @@ -51,11 +52,13 @@ public class FormatTest { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable String string; + @JsonInclude(JsonInclude.Include.NON_NULL) private byte[] _byte; @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable org.springframework.core.io.Resource binary; + @JsonInclude(JsonInclude.Include.NON_NULL) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) private LocalDate date; @@ -66,6 +69,7 @@ public class FormatTest { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable UUID uuid; + @JsonInclude(JsonInclude.Include.NON_NULL) private String password; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Name.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Name.java index 2fc98b6fb666..4b44b936d3e2 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Name.java @@ -24,6 +24,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class Name { + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer name; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Pet.java index e58434a4f202..63a0767c6aba 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Pet.java @@ -35,8 +35,10 @@ public class Pet { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Category category; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name; + @JsonInclude(JsonInclude.Include.NON_NULL) private List photoUrls = new ArrayList<>(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/TypeHolderDefault.java index e3ff9a400f74..94004510586d 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -2,6 +2,7 @@ import java.net.URI; import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.math.BigDecimal; @@ -26,14 +27,19 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class TypeHolderDefault { + @JsonInclude(JsonInclude.Include.NON_NULL) private String stringItem = "what"; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal numberItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer integerItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Boolean boolItem = true; + @JsonInclude(JsonInclude.Include.NON_NULL) private List arrayItem = new ArrayList<>(); public TypeHolderDefault() { diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/TypeHolderExample.java index 8b1470e92bf0..31461adcaef0 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -2,6 +2,7 @@ import java.net.URI; import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.math.BigDecimal; @@ -26,16 +27,22 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class TypeHolderExample { + @JsonInclude(JsonInclude.Include.NON_NULL) private String stringItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal numberItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Float floatItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer integerItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Boolean boolItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private List arrayItem = new ArrayList<>(); public TypeHolderExample() { diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Animal.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Animal.java index 4e0c294dd76c..bceaaab0ee8e 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Animal.java @@ -36,6 +36,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class Animal { + @JsonInclude(JsonInclude.Include.NON_NULL) private String className; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Category.java index f6a38799c911..03999441f921 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Category.java @@ -26,6 +26,7 @@ public class Category { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Long id; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name = "default-name"; public Category() { diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/EnumTest.java index cef26523d335..5bd8c11d9722 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/EnumTest.java @@ -104,6 +104,7 @@ public static EnumStringRequiredEnum fromValue(String value) { } } + @JsonInclude(JsonInclude.Include.NON_NULL) private EnumStringRequiredEnum enumStringRequired; /** diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/FormatTest.java index cb174a615f9b..e24c2373ad81 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/FormatTest.java @@ -40,6 +40,7 @@ public class FormatTest { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Long int64; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal number; @JsonInclude(JsonInclude.Include.NON_NULL) @@ -51,11 +52,13 @@ public class FormatTest { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable String string; + @JsonInclude(JsonInclude.Include.NON_NULL) private byte[] _byte; @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable org.springframework.core.io.Resource binary; + @JsonInclude(JsonInclude.Include.NON_NULL) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) private LocalDate date; @@ -66,6 +69,7 @@ public class FormatTest { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable UUID uuid; + @JsonInclude(JsonInclude.Include.NON_NULL) private String password; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Name.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Name.java index 2fc98b6fb666..4b44b936d3e2 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Name.java @@ -24,6 +24,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class Name { + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer name; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Pet.java index e58434a4f202..63a0767c6aba 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Pet.java @@ -35,8 +35,10 @@ public class Pet { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Category category; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name; + @JsonInclude(JsonInclude.Include.NON_NULL) private List photoUrls = new ArrayList<>(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/TypeHolderDefault.java index e3ff9a400f74..94004510586d 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -2,6 +2,7 @@ import java.net.URI; import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.math.BigDecimal; @@ -26,14 +27,19 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class TypeHolderDefault { + @JsonInclude(JsonInclude.Include.NON_NULL) private String stringItem = "what"; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal numberItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer integerItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Boolean boolItem = true; + @JsonInclude(JsonInclude.Include.NON_NULL) private List arrayItem = new ArrayList<>(); public TypeHolderDefault() { diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/TypeHolderExample.java index 8b1470e92bf0..31461adcaef0 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -2,6 +2,7 @@ import java.net.URI; import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.math.BigDecimal; @@ -26,16 +27,22 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class TypeHolderExample { + @JsonInclude(JsonInclude.Include.NON_NULL) private String stringItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal numberItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Float floatItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer integerItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Boolean boolItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private List arrayItem = new ArrayList<>(); public TypeHolderExample() { diff --git a/samples/server/petstore/springboot-spring-provide-args/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-spring-provide-args/src/main/java/org/openapitools/model/Pet.java index e58434a4f202..63a0767c6aba 100644 --- a/samples/server/petstore/springboot-spring-provide-args/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-spring-provide-args/src/main/java/org/openapitools/model/Pet.java @@ -35,8 +35,10 @@ public class Pet { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Category category; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name; + @JsonInclude(JsonInclude.Include.NON_NULL) private List photoUrls = new ArrayList<>(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java index faba16f61598..9d063bfe0199 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java @@ -27,7 +27,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class AdditionalPropertiesAnyType { - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional name = Optional.empty(); public AdditionalPropertiesAnyType name(String name) { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java index be7f41a81d7c..035b79379b51 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java @@ -28,7 +28,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class AdditionalPropertiesArray { - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional name = Optional.empty(); public AdditionalPropertiesArray name(String name) { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java index dca579c9121f..a43dab3cb168 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -27,7 +27,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class AdditionalPropertiesBoolean { - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional name = Optional.empty(); public AdditionalPropertiesBoolean name(String name) { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index 1b93d77f015d..fd92126ac8fa 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -30,37 +30,36 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class AdditionalPropertiesClass { - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Map mapString = new HashMap<>(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Map mapNumber = new HashMap<>(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Map mapInteger = new HashMap<>(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Map mapBoolean = new HashMap<>(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Map> mapArrayInteger = new HashMap<>(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Map> mapArrayAnytype = new HashMap<>(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Map> mapMapString = new HashMap<>(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Map> mapMapAnytype = new HashMap<>(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional anytype1 = Optional.empty(); - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable anytype2 = JsonNullable.undefined(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional anytype3 = Optional.empty(); public AdditionalPropertiesClass mapString(Map mapString) { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java index 936cfb48c631..a6865a84ca04 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java @@ -27,7 +27,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class AdditionalPropertiesInteger { - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional name = Optional.empty(); public AdditionalPropertiesInteger name(String name) { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java index 442516f4a9f6..949bb75ed136 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java @@ -28,7 +28,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class AdditionalPropertiesNumber { - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional name = Optional.empty(); public AdditionalPropertiesNumber name(String name) { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java index 0b99a6f53374..a08612ec602c 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java @@ -28,7 +28,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class AdditionalPropertiesObject { - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional name = Optional.empty(); public AdditionalPropertiesObject name(String name) { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesString.java index ee462f8abdb3..f63dd41ed5d8 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesString.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesString.java @@ -27,7 +27,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class AdditionalPropertiesString { - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional name = Optional.empty(); public AdditionalPropertiesString name(String name) { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Animal.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Animal.java index 1f7e2da6b646..f98b0648fa63 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Animal.java @@ -37,9 +37,10 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class Animal { + @JsonInclude(JsonInclude.Include.NON_NULL) private String className; - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional color = Optional.of("red"); public Animal() { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index eb02803d61a2..1fb0711e8121 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -27,7 +27,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class ArrayOfArrayOfNumberOnly { - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private List> arrayArrayNumber = new ArrayList<>(); public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java index 908d304908fa..2e19cf30c575 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -27,7 +27,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class ArrayOfNumberOnly { - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private List arrayNumber = new ArrayList<>(); public ArrayOfNumberOnly arrayNumber(List arrayNumber) { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ArrayTest.java index c30acc0cc68d..65f9d72d6131 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ArrayTest.java @@ -27,13 +27,13 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class ArrayTest { - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private List arrayOfString = new ArrayList<>(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private List> arrayArrayOfInteger = new ArrayList<>(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private List> arrayArrayOfModel = new ArrayList<>(); public ArrayTest arrayOfString(List arrayOfString) { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/BigCat.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/BigCat.java index 19008c1d5b60..c53ddd890eb2 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/BigCat.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/BigCat.java @@ -68,7 +68,7 @@ public static KindEnum fromValue(String value) { } } - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional kind = Optional.empty(); public BigCat() { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Capitalization.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Capitalization.java index 4fa1526c6c85..c67a38667963 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Capitalization.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Capitalization.java @@ -23,22 +23,22 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class Capitalization { - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional smallCamel = Optional.empty(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional capitalCamel = Optional.empty(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional smallSnake = Optional.empty(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional capitalSnake = Optional.empty(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional scAETHFlowPoints = Optional.empty(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional ATT_NAME = Optional.empty(); public Capitalization smallCamel(String smallCamel) { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Cat.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Cat.java index 181ba8ace110..c07c73c0b95a 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Cat.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Cat.java @@ -36,7 +36,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class Cat extends Animal { - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional declawed = Optional.empty(); public Cat() { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Category.java index 76970a34483f..7b78978d0f50 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Category.java @@ -23,9 +23,10 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class Category { - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional id = Optional.empty(); + @JsonInclude(JsonInclude.Include.NON_NULL) private String name = "default-name"; public Category() { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ChildWithNullable.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ChildWithNullable.java index 0d253af8ab1a..61b973fdaf73 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ChildWithNullable.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ChildWithNullable.java @@ -31,7 +31,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class ChildWithNullable extends ParentWithNullable { - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional otherProperty = Optional.empty(); public ChildWithNullable otherProperty(String otherProperty) { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ClassModel.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ClassModel.java index 9ebf293ee1d6..a1b8c345964a 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ClassModel.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ClassModel.java @@ -24,7 +24,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class ClassModel { - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional propertyClass = Optional.empty(); public ClassModel propertyClass(String propertyClass) { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Client.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Client.java index d2ff498d1869..345b1b7d736e 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Client.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Client.java @@ -23,7 +23,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class Client { - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional client = Optional.empty(); public Client client(String client) { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ContainerDefaultValue.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ContainerDefaultValue.java index ac5c31975e54..08ffd48ec9d6 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ContainerDefaultValue.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ContainerDefaultValue.java @@ -28,14 +28,14 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class ContainerDefaultValue { - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> nullableArray = JsonNullable.>undefined(); + @JsonInclude(JsonInclude.Include.ALWAYS) private JsonNullable> nullableRequiredArray = JsonNullable.>undefined(); + @JsonInclude(JsonInclude.Include.NON_NULL) private List requiredArray = new ArrayList<>(); - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> nullableArrayWithDefault = JsonNullable.>undefined(); public ContainerDefaultValue() { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Dog.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Dog.java index 2c11947f2a4a..5befb1bd09f8 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Dog.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Dog.java @@ -28,7 +28,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class Dog extends Animal { - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional breed = Optional.empty(); public Dog() { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/EnumArrays.java index 58a95aa7769e..538b17c4100b 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/EnumArrays.java @@ -62,7 +62,7 @@ public static JustSymbolEnum fromValue(String value) { } } - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional justSymbol = Optional.empty(); /** @@ -100,7 +100,7 @@ public static ArrayEnumEnum fromValue(String value) { } } - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private List arrayEnum = new ArrayList<>(); public EnumArrays justSymbol(JustSymbolEnum justSymbol) { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/EnumTest.java index 4d882356686c..c0cf00d98185 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/EnumTest.java @@ -64,7 +64,7 @@ public static EnumStringEnum fromValue(String value) { } } - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional enumString = Optional.empty(); /** @@ -104,6 +104,7 @@ public static EnumStringRequiredEnum fromValue(String value) { } } + @JsonInclude(JsonInclude.Include.NON_NULL) private EnumStringRequiredEnum enumStringRequired; /** @@ -141,7 +142,7 @@ public static EnumIntegerEnum fromValue(Integer value) { } } - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional enumInteger = Optional.empty(); /** @@ -179,10 +180,10 @@ public static EnumNumberEnum fromValue(Double value) { } } - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional enumNumber = Optional.empty(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional outerEnum = Optional.empty(); public EnumTest() { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/File.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/File.java index c30f7a211b46..3f537a2ef5ff 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/File.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/File.java @@ -24,7 +24,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class File { - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional sourceURI = Optional.empty(); public File sourceURI(String sourceURI) { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/FileSchemaTestClass.java index 429e0226689b..486543b0bca3 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/FileSchemaTestClass.java @@ -27,10 +27,10 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class FileSchemaTestClass { - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional file = Optional.empty(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private List<@Valid File> files = new ArrayList<>(); public FileSchemaTestClass file(File file) { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/FormatTest.java index 0584bf0b3730..a50f627cf3f3 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/FormatTest.java @@ -31,44 +31,48 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class FormatTest { - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional<@Min(value = 10) @Max(value = 100) Integer> integer = Optional.empty(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional<@Min(value = 20) @Max(value = 200) Integer> int32 = Optional.empty(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional int64 = Optional.empty(); + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal number; - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional<@DecimalMin(value = "54.3") @DecimalMax(value = "987.6") Float> _float = Optional.empty(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional<@DecimalMin(value = "67.8") @DecimalMax(value = "123.4") Double> _double = Optional.empty(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional<@Pattern(regexp = "[a-zA-Z]") String> string = Optional.empty(); + @JsonInclude(JsonInclude.Include.NON_NULL) private byte[] _byte; - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional binary = Optional.empty(); + @JsonInclude(JsonInclude.Include.NON_NULL) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) private LocalDate date; - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private Optional dateTime = Optional.empty(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional uuid = Optional.empty(); + @JsonInclude(JsonInclude.Include.NON_NULL) private String password; - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional bigDecimal = Optional.empty(); public FormatTest() { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/HasOnlyReadOnly.java index 48e42ebdf2bd..d69640bfccc9 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/HasOnlyReadOnly.java @@ -25,10 +25,10 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class HasOnlyReadOnly { - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional bar = Optional.empty(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional foo = Optional.empty(); public HasOnlyReadOnly bar(String bar) { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/MapTest.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/MapTest.java index 76f8c3918acc..aad8e2fbe1c4 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/MapTest.java @@ -26,7 +26,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class MapTest { - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Map> mapMapOfString = new HashMap<>(); /** @@ -64,13 +64,13 @@ public static InnerEnum fromValue(String value) { } } - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Map mapOfEnumString = new HashMap<>(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Map directMap = new HashMap<>(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Map indirectMap = new HashMap<>(); public MapTest mapMapOfString(Map> mapMapOfString) { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index 80f964b29671..cf88026327fb 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -29,14 +29,14 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class MixedPropertiesAndAdditionalPropertiesClass { - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional uuid = Optional.empty(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private Optional dateTime = Optional.empty(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Map map = new HashMap<>(); public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Model200Response.java index e17ede77c408..9ccd2e4a7990 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Model200Response.java @@ -26,10 +26,10 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class Model200Response { - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional name = Optional.empty(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional propertyClass = Optional.empty(); public Model200Response name(Integer name) { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelApiResponse.java index 043c8b622adf..ca42979461ea 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -25,13 +25,13 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class ModelApiResponse { - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional code = Optional.empty(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional type = Optional.empty(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional message = Optional.empty(); public ModelApiResponse code(Integer code) { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelList.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelList.java index 16f8f84a53d3..ca8d4b09d2f4 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelList.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelList.java @@ -25,7 +25,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class ModelList { - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional _123list = Optional.empty(); public ModelList _123list(String _123list) { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelReturn.java index 3de6333fb668..f0b7468ecf70 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelReturn.java @@ -26,7 +26,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class ModelReturn { - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional _return = Optional.empty(); public ModelReturn _return(Integer _return) { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Name.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Name.java index 390ab0989b32..ada16d1efe31 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Name.java @@ -24,15 +24,16 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class Name { + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer name; - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional snakeCase = Optional.empty(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional property = Optional.empty(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional _123number = Optional.empty(); public Name() { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/NullableMapProperty.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/NullableMapProperty.java index 9856b0d77cd6..ab4c11a99f4f 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/NullableMapProperty.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/NullableMapProperty.java @@ -2,7 +2,6 @@ import java.net.URI; import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Arrays; @@ -28,7 +27,6 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class NullableMapProperty { - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> languageValues = JsonNullable.>undefined(); public NullableMapProperty languageValues(Map languageValues) { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/NumberOnly.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/NumberOnly.java index e63a1408d3e5..04edef05907b 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/NumberOnly.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/NumberOnly.java @@ -24,7 +24,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class NumberOnly { - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional justNumber = Optional.empty(); public NumberOnly justNumber(BigDecimal justNumber) { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Order.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Order.java index 9bf54fd855e4..290f5e7585dd 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Order.java @@ -26,16 +26,16 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class Order { - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional id = Optional.empty(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional petId = Optional.empty(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional quantity = Optional.empty(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private Optional shipDate = Optional.empty(); @@ -76,10 +76,10 @@ public static StatusEnum fromValue(String value) { } } - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional status = Optional.empty(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional complete = Optional.of(false); public Order id(Long id) { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/OuterComposite.java index a2055ef94fc1..b9b2fdb21831 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/OuterComposite.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/OuterComposite.java @@ -24,13 +24,13 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class OuterComposite { - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional myNumber = Optional.empty(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional myString = Optional.empty(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional myBoolean = Optional.empty(); public OuterComposite myNumber(BigDecimal myNumber) { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ParentWithNullable.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ParentWithNullable.java index 22db1d786cd5..bf1970e3e5ff 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ParentWithNullable.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ParentWithNullable.java @@ -72,10 +72,9 @@ public static TypeEnum fromValue(String value) { } } - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional type = Optional.empty(); - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable nullableProperty = JsonNullable.undefined(); public ParentWithNullable type(TypeEnum type) { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Pet.java index 8d3f1d0cf422..71980b951aac 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Pet.java @@ -32,17 +32,19 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class Pet { - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional id = Optional.empty(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional category = Optional.empty(); + @JsonInclude(JsonInclude.Include.NON_NULL) private String name; + @JsonInclude(JsonInclude.Include.NON_NULL) private Set photoUrls = new LinkedHashSet<>(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private List<@Valid Tag> tags = new ArrayList<>(); /** @@ -82,7 +84,7 @@ public static StatusEnum fromValue(String value) { } } - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) @Deprecated private Optional status = Optional.empty(); diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ReadOnlyFirst.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ReadOnlyFirst.java index 1443c07c9e28..26ca43e45f89 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ReadOnlyFirst.java @@ -23,10 +23,10 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class ReadOnlyFirst { - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional bar = Optional.empty(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional baz = Optional.empty(); public ReadOnlyFirst bar(String bar) { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java index ec09530ef0a1..af3a2fa1a4b0 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java @@ -23,16 +23,16 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class ResponseObjectWithDifferentFieldNames { - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional normalPropertyName = Optional.empty(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional UPPER_CASE_PROPERTY_SNAKE = Optional.empty(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional lowerCasePropertyDashes = Optional.empty(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional propertyNameWithSpaces = Optional.empty(); public ResponseObjectWithDifferentFieldNames normalPropertyName(String normalPropertyName) { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/SpecialModelName.java index 6ed2b125a106..c995f2258724 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/SpecialModelName.java @@ -25,7 +25,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class SpecialModelName { - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional $specialPropertyName = Optional.empty(); public SpecialModelName $specialPropertyName(Long $specialPropertyName) { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Tag.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Tag.java index bf869af6a963..865bd81efc50 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Tag.java @@ -23,10 +23,10 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class Tag { - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional id = Optional.empty(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional name = Optional.empty(); public Tag id(Long id) { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/TypeHolderDefault.java index 2a1d1c058908..2bab3abf7d07 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -2,6 +2,7 @@ import java.net.URI; import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.math.BigDecimal; @@ -26,14 +27,19 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class TypeHolderDefault { + @JsonInclude(JsonInclude.Include.NON_NULL) private String stringItem = "what"; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal numberItem = new BigDecimal("1.234"); + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer integerItem = -2; + @JsonInclude(JsonInclude.Include.NON_NULL) private Boolean boolItem = true; + @JsonInclude(JsonInclude.Include.NON_NULL) private List arrayItem = new ArrayList<>(Arrays.asList(0, 1, 2, 3)); public TypeHolderDefault() { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/TypeHolderExample.java index 315db140f253..65193abb520e 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -2,6 +2,7 @@ import java.net.URI; import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.math.BigDecimal; @@ -26,16 +27,22 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class TypeHolderExample { + @JsonInclude(JsonInclude.Include.NON_NULL) private String stringItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal numberItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Float floatItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer integerItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Boolean boolItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private List arrayItem = new ArrayList<>(); public TypeHolderExample() { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/User.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/User.java index 0214c2053d51..5cc40be2fc1c 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/User.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/User.java @@ -23,28 +23,28 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class User { - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional id = Optional.empty(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional username = Optional.empty(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional firstName = Optional.empty(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional lastName = Optional.empty(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional email = Optional.empty(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional password = Optional.empty(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional phone = Optional.empty(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional userStatus = Optional.empty(); public User id(Long id) { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/XmlItem.java index 253bd465588f..4232cb95d7c0 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/XmlItem.java @@ -27,91 +27,91 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class XmlItem { - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional attributeString = Optional.empty(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional attributeNumber = Optional.empty(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional attributeInteger = Optional.empty(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional attributeBoolean = Optional.empty(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private List wrappedArray = new ArrayList<>(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional nameString = Optional.empty(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional nameNumber = Optional.empty(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional nameInteger = Optional.empty(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional nameBoolean = Optional.empty(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private List nameArray = new ArrayList<>(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private List nameWrappedArray = new ArrayList<>(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional prefixString = Optional.empty(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional prefixNumber = Optional.empty(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional prefixInteger = Optional.empty(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional prefixBoolean = Optional.empty(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private List prefixArray = new ArrayList<>(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private List prefixWrappedArray = new ArrayList<>(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional namespaceString = Optional.empty(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional namespaceNumber = Optional.empty(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional namespaceInteger = Optional.empty(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional namespaceBoolean = Optional.empty(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private List namespaceArray = new ArrayList<>(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private List namespaceWrappedArray = new ArrayList<>(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional prefixNsString = Optional.empty(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional prefixNsNumber = Optional.empty(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional prefixNsInteger = Optional.empty(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional prefixNsBoolean = Optional.empty(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private List prefixNsArray = new ArrayList<>(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private List prefixNsWrappedArray = new ArrayList<>(); public XmlItem attributeString(String attributeString) { diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesClass.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesClass.java index a38602c22da4..51f8239e6287 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesClass.java @@ -57,7 +57,6 @@ public class AdditionalPropertiesClass { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Object anytype1; - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable anytype2 = JsonNullable.undefined(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Animal.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Animal.java index b200b3f62188..9f6a83b4973f 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Animal.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Animal.java @@ -37,6 +37,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class Animal { + @JsonInclude(JsonInclude.Include.NON_NULL) private String className; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Category.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Category.java index 1114456a68a1..e4a77578766d 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Category.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Category.java @@ -26,6 +26,7 @@ public class Category { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Long id; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name = "default-name"; public Category() { diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ContainerDefaultValue.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ContainerDefaultValue.java index e969b98a302b..2bd4f51c4140 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ContainerDefaultValue.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ContainerDefaultValue.java @@ -28,14 +28,14 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class ContainerDefaultValue { - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> nullableArray = JsonNullable.>undefined(); + @JsonInclude(JsonInclude.Include.ALWAYS) private JsonNullable> nullableRequiredArray = JsonNullable.>undefined(); + @JsonInclude(JsonInclude.Include.NON_NULL) private List requiredArray = new ArrayList<>(); - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> nullableArrayWithDefault = JsonNullable.>undefined(); public ContainerDefaultValue() { diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/EnumTest.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/EnumTest.java index 7b02c6226925..65374acc591d 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/EnumTest.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/EnumTest.java @@ -104,6 +104,7 @@ public static EnumStringRequiredEnum fromValue(String value) { } } + @JsonInclude(JsonInclude.Include.NON_NULL) private EnumStringRequiredEnum enumStringRequired; /** diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/FormatTest.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/FormatTest.java index d1274d6cf08f..92a22136e7a7 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/FormatTest.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/FormatTest.java @@ -40,6 +40,7 @@ public class FormatTest { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Long int64; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal number; @JsonInclude(JsonInclude.Include.NON_NULL) @@ -51,11 +52,13 @@ public class FormatTest { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable String string; + @JsonInclude(JsonInclude.Include.NON_NULL) private byte[] _byte; @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable org.springframework.core.io.Resource binary; + @JsonInclude(JsonInclude.Include.NON_NULL) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) private LocalDate date; @@ -66,6 +69,7 @@ public class FormatTest { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable UUID uuid; + @JsonInclude(JsonInclude.Include.NON_NULL) private String password; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Name.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Name.java index 5e8a32edb738..736006c8b6f5 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Name.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Name.java @@ -24,6 +24,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class Name { + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer name; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/NullableMapProperty.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/NullableMapProperty.java index 7db52928c1c6..fc013fe70f4c 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/NullableMapProperty.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/NullableMapProperty.java @@ -2,7 +2,6 @@ import java.net.URI; import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Arrays; @@ -28,7 +27,6 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class NullableMapProperty { - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> languageValues = JsonNullable.>undefined(); public NullableMapProperty languageValues(Map languageValues) { diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ParentWithNullable.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ParentWithNullable.java index d092b2fc47d5..bb28729decdd 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ParentWithNullable.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ParentWithNullable.java @@ -75,7 +75,6 @@ public static TypeEnum fromValue(String value) { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable TypeEnum type; - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable nullableProperty = JsonNullable.undefined(); public ParentWithNullable type(@Nullable TypeEnum type) { diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Pet.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Pet.java index 68c3ebd77107..6c54f41ddd69 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Pet.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Pet.java @@ -38,8 +38,10 @@ public class Pet { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Category category; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name; + @JsonInclude(JsonInclude.Include.NON_NULL) private Set photoUrls = new LinkedHashSet<>(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/TypeHolderDefault.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/TypeHolderDefault.java index b4242f545bc2..b6e5a480c71e 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/TypeHolderDefault.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/TypeHolderDefault.java @@ -2,6 +2,7 @@ import java.net.URI; import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.math.BigDecimal; @@ -26,14 +27,19 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class TypeHolderDefault { + @JsonInclude(JsonInclude.Include.NON_NULL) private String stringItem = "what"; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal numberItem = new BigDecimal("1.234"); + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer integerItem = -2; + @JsonInclude(JsonInclude.Include.NON_NULL) private Boolean boolItem = true; + @JsonInclude(JsonInclude.Include.NON_NULL) private List arrayItem = new ArrayList<>(Arrays.asList(0, 1, 2, 3)); public TypeHolderDefault() { diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/TypeHolderExample.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/TypeHolderExample.java index c6167ecb0cd8..cba300e3a67e 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/TypeHolderExample.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/TypeHolderExample.java @@ -2,6 +2,7 @@ import java.net.URI; import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.math.BigDecimal; @@ -26,16 +27,22 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class TypeHolderExample { + @JsonInclude(JsonInclude.Include.NON_NULL) private String stringItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal numberItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Float floatItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer integerItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Boolean boolItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private List arrayItem = new ArrayList<>(); public TypeHolderExample() { diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/AnimalDto.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/AnimalDto.java index eacc2158fcdd..db9084f361ed 100644 --- a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/AnimalDto.java +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/AnimalDto.java @@ -37,6 +37,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class AnimalDto implements com.custompackage.InterfaceToKeep, com.custompackage.WithColor { + @JsonInclude(JsonInclude.Include.NON_NULL) private String className; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/CategoryDto.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/CategoryDto.java index b54dbbd66b7f..e62f4eb17757 100644 --- a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/CategoryDto.java +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/CategoryDto.java @@ -28,6 +28,7 @@ public class CategoryDto { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Long id; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name = "default-name"; public CategoryDto() { diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/EnumTestDto.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/EnumTestDto.java index e64c0995389d..1576c5046e33 100644 --- a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/EnumTestDto.java +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/EnumTestDto.java @@ -110,6 +110,7 @@ public static EnumStringRequiredEnum fromValue(String value) { } } + @JsonInclude(JsonInclude.Include.NON_NULL) private EnumStringRequiredEnum enumStringRequired; /** @@ -188,7 +189,6 @@ public static EnumNumberEnum fromValue(Double value) { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable EnumNumberEnum enumNumber; - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable outerEnum = JsonNullable.undefined(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/FormatTestDto.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/FormatTestDto.java index 9baeea9cc239..b2bcf9fec2d6 100644 --- a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/FormatTestDto.java +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/FormatTestDto.java @@ -40,6 +40,7 @@ public class FormatTestDto { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Long int64; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal number; @JsonInclude(JsonInclude.Include.NON_NULL) @@ -54,11 +55,13 @@ public class FormatTestDto { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable String string; + @JsonInclude(JsonInclude.Include.NON_NULL) private byte[] _byte; @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable org.springframework.core.io.Resource binary; + @JsonInclude(JsonInclude.Include.NON_NULL) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) private LocalDate date; @@ -69,6 +72,7 @@ public class FormatTestDto { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable UUID uuid; + @JsonInclude(JsonInclude.Include.NON_NULL) private String password; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/HealthCheckResultDto.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/HealthCheckResultDto.java index 2b3de797a45a..ac09a0a9834b 100644 --- a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/HealthCheckResultDto.java +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/HealthCheckResultDto.java @@ -2,7 +2,6 @@ import java.net.URI; import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -29,7 +28,6 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class HealthCheckResultDto { - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable nullableMessage = JsonNullable.undefined(); public HealthCheckResultDto nullableMessage(String nullableMessage) { diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/NameDto.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/NameDto.java index 6561257a70c2..6055fd7ceb2d 100644 --- a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/NameDto.java +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/NameDto.java @@ -26,6 +26,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class NameDto { + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer name; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/NullableClassDto.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/NullableClassDto.java index 99e4c9ecbf90..55fe5702be7f 100644 --- a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/NullableClassDto.java +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/NullableClassDto.java @@ -40,39 +40,29 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class NullableClassDto { - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable integerProp = JsonNullable.undefined(); - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable numberProp = JsonNullable.undefined(); - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable booleanProp = JsonNullable.undefined(); - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable stringProp = JsonNullable.undefined(); - @JsonInclude(JsonInclude.Include.NON_ABSENT) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) private JsonNullable dateProp = JsonNullable.undefined(); - @JsonInclude(JsonInclude.Include.NON_ABSENT) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private JsonNullable datetimeProp = JsonNullable.undefined(); - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> arrayNullableProp = JsonNullable.>undefined(); - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> arrayAndItemsNullableProp = JsonNullable.>undefined(); @JsonInclude(JsonInclude.Include.NON_NULL) private List arrayItemsNullable = new ArrayList<>(); - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> objectNullableProp = JsonNullable.>undefined(); - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> objectAndItemsNullableProp = JsonNullable.>undefined(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/OuterObjectWithEnumPropertyDto.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/OuterObjectWithEnumPropertyDto.java index 2bc2073abb6a..ab45923a4570 100644 --- a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/OuterObjectWithEnumPropertyDto.java +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/OuterObjectWithEnumPropertyDto.java @@ -2,6 +2,7 @@ import java.net.URI; import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -26,6 +27,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class OuterObjectWithEnumPropertyDto { + @JsonInclude(JsonInclude.Include.NON_NULL) private OuterEnumIntegerDto value; public OuterObjectWithEnumPropertyDto() { diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/ParentWithNullableDto.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/ParentWithNullableDto.java index b4a5e5095239..982f8d038258 100644 --- a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/ParentWithNullableDto.java +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/ParentWithNullableDto.java @@ -76,7 +76,6 @@ public static TypeEnum fromValue(String value) { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable TypeEnum type; - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable nullableProperty = JsonNullable.undefined(); public ParentWithNullableDto type(@Nullable TypeEnum type) { diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/PetDto.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/PetDto.java index 77a5d6571d54..5cbf751e6bd4 100644 --- a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/PetDto.java +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/PetDto.java @@ -40,8 +40,10 @@ public class PetDto { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable CategoryDto category; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name; + @JsonInclude(JsonInclude.Include.NON_NULL) private Set photoUrls = new LinkedHashSet<>(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesClassDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesClassDto.java index d04080bd138a..3115be7ad0b3 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesClassDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesClassDto.java @@ -59,7 +59,6 @@ public class AdditionalPropertiesClassDto { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Object anytype1; - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable anytype2 = JsonNullable.undefined(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AnimalDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AnimalDto.java index 9954743744b8..0ea4d126864a 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AnimalDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AnimalDto.java @@ -38,6 +38,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class AnimalDto { + @JsonInclude(JsonInclude.Include.NON_NULL) private String className; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/CategoryDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/CategoryDto.java index e9a8e17231e4..34487fc4bbc4 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/CategoryDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/CategoryDto.java @@ -28,6 +28,7 @@ public class CategoryDto { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Long id; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name = "default-name"; public CategoryDto() { diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ContainerDefaultValueDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ContainerDefaultValueDto.java index 935dbf3e6f4d..39f4e40b9ba0 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ContainerDefaultValueDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ContainerDefaultValueDto.java @@ -30,14 +30,14 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class ContainerDefaultValueDto { - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> nullableArray = JsonNullable.>undefined(); + @JsonInclude(JsonInclude.Include.ALWAYS) private JsonNullable> nullableRequiredArray = JsonNullable.>undefined(); + @JsonInclude(JsonInclude.Include.NON_NULL) private List requiredArray = new ArrayList<>(); - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> nullableArrayWithDefault = JsonNullable.>undefined(); public ContainerDefaultValueDto() { diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/EnumTestDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/EnumTestDto.java index 5ab270f93a2e..bf188bb1b01d 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/EnumTestDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/EnumTestDto.java @@ -105,6 +105,7 @@ public static EnumStringRequiredEnum fromValue(String value) { } } + @JsonInclude(JsonInclude.Include.NON_NULL) private EnumStringRequiredEnum enumStringRequired; /** diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/FormatTestDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/FormatTestDto.java index 13b1eb4fcd2e..4f54909c543d 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/FormatTestDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/FormatTestDto.java @@ -40,6 +40,7 @@ public class FormatTestDto { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Long int64; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal number; @JsonInclude(JsonInclude.Include.NON_NULL) @@ -51,11 +52,13 @@ public class FormatTestDto { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable String string; + @JsonInclude(JsonInclude.Include.NON_NULL) private byte[] _byte; @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable org.springframework.core.io.Resource binary; + @JsonInclude(JsonInclude.Include.NON_NULL) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) private LocalDate date; @@ -66,6 +69,7 @@ public class FormatTestDto { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable UUID uuid; + @JsonInclude(JsonInclude.Include.NON_NULL) private String password; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/NameDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/NameDto.java index 585d573dfecf..a4fdb5f297fd 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/NameDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/NameDto.java @@ -26,6 +26,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class NameDto { + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer name; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/NullableMapPropertyDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/NullableMapPropertyDto.java index e712397bff32..50958c247610 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/NullableMapPropertyDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/NullableMapPropertyDto.java @@ -2,7 +2,6 @@ import java.net.URI; import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -30,7 +29,6 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class NullableMapPropertyDto { - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> languageValues = JsonNullable.>undefined(); public NullableMapPropertyDto languageValues(Map languageValues) { diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ParentWithNullableDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ParentWithNullableDto.java index 2162ebf85db4..af2b3803d750 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ParentWithNullableDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ParentWithNullableDto.java @@ -77,7 +77,6 @@ public static TypeEnum fromValue(String value) { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable TypeEnum type; - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable nullableProperty = JsonNullable.undefined(); public ParentWithNullableDto type(@Nullable TypeEnum type) { diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/PetDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/PetDto.java index 3953250b4693..bbeb1cf7c867 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/PetDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/PetDto.java @@ -41,8 +41,10 @@ public class PetDto { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable CategoryDto category; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name; + @JsonInclude(JsonInclude.Include.NON_NULL) private Set photoUrls = new LinkedHashSet<>(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/TypeHolderDefaultDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/TypeHolderDefaultDto.java index d9d8b4f78585..0ef0624afb20 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/TypeHolderDefaultDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/TypeHolderDefaultDto.java @@ -2,6 +2,7 @@ import java.net.URI; import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -28,14 +29,19 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class TypeHolderDefaultDto { + @JsonInclude(JsonInclude.Include.NON_NULL) private String stringItem = "what"; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal numberItem = new BigDecimal("1.234"); + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer integerItem = -2; + @JsonInclude(JsonInclude.Include.NON_NULL) private Boolean boolItem = true; + @JsonInclude(JsonInclude.Include.NON_NULL) private List arrayItem = new ArrayList<>(Arrays.asList(0, 1, 2, 3)); public TypeHolderDefaultDto() { diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/TypeHolderExampleDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/TypeHolderExampleDto.java index aa7879602dc5..fbf86a0db3f3 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/TypeHolderExampleDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/TypeHolderExampleDto.java @@ -2,6 +2,7 @@ import java.net.URI; import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -28,16 +29,22 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class TypeHolderExampleDto { + @JsonInclude(JsonInclude.Include.NON_NULL) private String stringItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal numberItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Float floatItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer integerItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Boolean boolItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private List arrayItem = new ArrayList<>(); public TypeHolderExampleDto() {