From f2cf01f56e0b42546a5b2afe9c1e8b9cc88350d8 Mon Sep 17 00:00:00 2001 From: Jachym Metlicka Date: Fri, 24 Jul 2026 11:59:16 +0200 Subject: [PATCH 01/12] feat(json-include): introduce configurable JsonInclude policy for optional non-nullable properties --- .../languages/KotlinSpringServerCodegen.java | 105 ++++++++- .../codegen/languages/SpringCodegen.java | 95 ++++++-- .../main/resources/JavaSpring/pojo.mustache | 11 +- .../kotlin-spring/dataClassOptVar.mustache | 5 +- .../kotlin-spring/dataClassReqVar.mustache | 3 +- .../java/spring/SpringCodegenTest.java | 204 +++++++++++++++--- .../spring/KotlinSpringServerCodegenTest.java | 177 +++++++++++++-- .../issue_24401_json_include_override.yaml | 30 +++ .../issue_24401_json_include_per_schema.yaml | 81 +++++++ 9 files changed, 645 insertions(+), 66 deletions(-) create mode 100644 modules/openapi-generator/src/test/resources/3_0/spring/issue_24401_json_include_override.yaml create mode 100644 modules/openapi-generator/src/test/resources/3_0/spring/issue_24401_json_include_per_schema.yaml 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 4227feda5942..08555c967cd9 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 @@ -111,6 +111,14 @@ public class KotlinSpringServerCodegen extends AbstractKotlinCodegen public static final String USE_SEALED_RESPONSE_INTERFACES = "useSealedResponseInterfaces"; public static final String COMPANION_OBJECT = "companionObject"; public static final String SUSPEND_FUNCTIONS = "suspendFunctions"; + public static final String OPTIONAL_NON_NULL_PROPERTY_JSON_INCLUDE = "optionalNonNullPropertyJsonInclude"; + public static final String GENERATE_JSON_INCLUDE_ANNOTATIONS = "generateJsonIncludeAnnotations"; + /** + * Universal per-property vendor extension holding the resolved Jackson {@code @JsonInclude} policy + * (e.g. {@code NON_NULL}, {@code ALWAYS}). When absent, no {@code @JsonInclude} annotation is emitted. + * A value set directly in the spec is treated as a manual override and always wins. + */ + public static final String JSON_INCLUDE_POLICY_EXTENSION = "x-jackson-json-include-policy"; @Getter public enum DeclarativeInterfaceReactiveMode { @@ -183,6 +191,8 @@ public String getDescription() { @Setter private boolean useEnumValueInterface = false; private String valuedEnumClassName = "ValuedEnum"; @Setter private boolean suspendFunctions = false; + @Getter @Setter private String optionalNonNullPropertyJsonInclude = "NON_NULL"; + @Getter @Setter private boolean generateJsonIncludeAnnotations = true; @Getter @Setter private boolean openApiNullable = false; @Getter @Setter protected boolean useDeductionForOneOfInterfaces = false; @@ -314,6 +324,22 @@ 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(OPTIONAL_NON_NULL_PROPERTY_JSON_INCLUDE, + "The Jackson @JsonInclude policy emitted for optional, non-nullable model properties. " + + "NONE emits no annotation, deferring fully to the global ObjectMapper inclusion policy."); + optionalNonNullPropertyJsonIncludeOpt.addEnum("NON_NULL", "Omit the property when its value is null (default, spec-safe for non-nullable fields)."); + optionalNonNullPropertyJsonIncludeOpt.addEnum("NON_EMPTY", "Omit the property when its value is null or considered empty."); + optionalNonNullPropertyJsonIncludeOpt.addEnum("NON_DEFAULT", "Omit the property when its value equals the default."); + optionalNonNullPropertyJsonIncludeOpt.addEnum("NONE", "Emit no @JsonInclude annotation; defer to the global ObjectMapper."); + optionalNonNullPropertyJsonIncludeOpt.setDefault(optionalNonNullPropertyJsonInclude); + cliOptions.add(optionalNonNullPropertyJsonIncludeOpt); + + addSwitch(GENERATE_JSON_INCLUDE_ANNOTATIONS, + "Whether to generate policy @JsonInclude annotations on model properties. When false, all " + + "automatic @JsonInclude annotations (required-field protection and the optional non-nullable policy) " + + "are omitted so the global ObjectMapper owns inclusion. A per-property override set via the " + + "`x-jackson-json-include-policy` vendor extension is still honored.", generateJsonIncludeAnnotations); 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, @@ -733,6 +759,16 @@ public void processOpts() { } writePropertyBack(SUSPEND_FUNCTIONS, suspendFunctions); + if (additionalProperties.containsKey(GENERATE_JSON_INCLUDE_ANNOTATIONS)) { + this.setGenerateJsonIncludeAnnotations(convertPropertyToBoolean(GENERATE_JSON_INCLUDE_ANNOTATIONS)); + } + writePropertyBack(GENERATE_JSON_INCLUDE_ANNOTATIONS, generateJsonIncludeAnnotations); + if (additionalProperties.containsKey(OPTIONAL_NON_NULL_PROPERTY_JSON_INCLUDE)) { + this.setOptionalNonNullPropertyJsonInclude(additionalProperties.get(OPTIONAL_NON_NULL_PROPERTY_JSON_INCLUDE).toString()); + } + this.optionalNonNullPropertyJsonInclude = normalizeJsonIncludePolicy(this.optionalNonNullPropertyJsonInclude); + writePropertyBack(OPTIONAL_NON_NULL_PROPERTY_JSON_INCLUDE, optionalNonNullPropertyJsonInclude); + if (additionalProperties.containsKey(BEAN_QUALIFIERS) && library.equals(SPRING_BOOT)) { this.setBeanQualifiers(convertPropertyToBoolean(BEAN_QUALIFIERS)); } @@ -1285,6 +1321,9 @@ public void postProcessModelProperty(CodegenModel model, CodegenProperty propert // 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. + // 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). if (!property.required && !property.isNullable) { if (openApiNullable) { property.vendorExtensions.put("x-has-json-setter-nulls-fail", true); @@ -1293,7 +1332,6 @@ public void postProcessModelProperty(CodegenModel model, CodegenProperty propert } model.imports.add("JsonSetter"); model.imports.add("Nulls"); - model.imports.add("JsonInclude"); } // Scenario 4: optional + nullable with openApiNullable → use JsonNullable = JsonNullable.undefined() @@ -1303,6 +1341,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"); @@ -1322,6 +1362,65 @@ public void postProcessModelProperty(CodegenModel model, CodegenProperty propert } } + /** + * Resolve the {@code @JsonInclude} policy into the single universal + * {@code x-jackson-json-include-policy} vendor extension the template emits. 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 (nullable or not) → {@code ALWAYS} (Kotlin type prevents null for non-nullable; + * explicit null is valid for nullable and must be serialized)
    • + *
    • optional & non-nullable → {@code optionalNonNullPropertyJsonInclude} + * (default {@code NON_NULL}, {@code NONE} = omit)
    • + *
    • optional & nullable → none (JsonNullable module already governs inclusion)
    • + *
    + *
  4. + *
+ */ + private void resolveJsonIncludePolicy(CodegenModel model, CodegenProperty property) { + if (property.vendorExtensions.containsKey(JSON_INCLUDE_POLICY_EXTENSION)) { + if (isJsonIncludePolicyEmitted(property.vendorExtensions.get(JSON_INCLUDE_POLICY_EXTENSION))) { + model.imports.add("JsonInclude"); + } + return; + } + if (!generateJsonIncludeAnnotations) { + return; + } + String policy = null; + if (property.required) { + policy = "ALWAYS"; + } else if (!property.isNullable) { + policy = optionalNonNullPropertyJsonInclude; + } + if (isJsonIncludePolicyEmitted(policy)) { + property.vendorExtensions.put(JSON_INCLUDE_POLICY_EXTENSION, policy); + model.imports.add("JsonInclude"); + } + } + + private static boolean isJsonIncludePolicyEmitted(Object policy) { + return policy != null && !policy.toString().isEmpty() && !"NONE".equalsIgnoreCase(policy.toString()); + } + + private static String normalizeJsonIncludePolicy(String policy) { + if (policy == null) { + return "NON_NULL"; + } + String normalized = policy.trim().toUpperCase(Locale.ROOT); + switch (normalized) { + case "NON_NULL": + case "NON_EMPTY": + case "NON_DEFAULT": + case "NONE": + return normalized; + default: + throw new IllegalArgumentException(OPTIONAL_NON_NULL_PROPERTY_JSON_INCLUDE + + " must be one of NON_NULL, NON_EMPTY, NON_DEFAULT, NONE but was: " + policy); + } + } + @Override public void addImportsToOneOfInterface(List> imports) { if (additionalProperties.containsKey("jackson")) { @@ -1479,6 +1578,10 @@ public ModelsMap postProcessModelsEnum(ModelsMap objs) { 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); } } 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..9c401db07d4a 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 @@ -123,6 +123,14 @@ public class SpringCodegen extends AbstractJavaCodegen public static final String GENERATE_PAGEABLE_CONSTRAINT_VALIDATION = "generatePageableConstraintValidation"; public static final String SUBSTITUTE_GENERIC_PAGED_MODEL = "substituteGenericPagedModel"; public static final String CLIENT_REGISTRATION_ID = "clientRegistrationId"; + public static final String OPTIONAL_NON_NULL_PROPERTY_JSON_INCLUDE = "optionalNonNullPropertyJsonInclude"; + public static final String GENERATE_JSON_INCLUDE_ANNOTATIONS = "generateJsonIncludeAnnotations"; + /** + * Universal per-property vendor extension holding the resolved Jackson {@code @JsonInclude} policy + * (e.g. {@code NON_NULL}, {@code ALWAYS}). When absent, no {@code @JsonInclude} annotation is emitted. + * A value set directly in the spec is treated as a manual override and always wins. + */ + public static final String JSON_INCLUDE_POLICY_EXTENSION = "x-jackson-json-include-policy"; @Getter public enum RequestMappingMode { @@ -161,6 +169,8 @@ public enum RequestMappingMode { @Setter protected boolean apiFirst = false; protected boolean useOptional = false; @Setter protected boolean useSealed = false; + @Getter @Setter protected String optionalNonNullPropertyJsonInclude = "NON_NULL"; + @Getter @Setter protected boolean generateJsonIncludeAnnotations = true; @Setter protected boolean virtualService = false; @Setter protected boolean hateoas = false; @Setter protected boolean returnSuccessCode = false; @@ -284,6 +294,22 @@ 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(OPTIONAL_NON_NULL_PROPERTY_JSON_INCLUDE, + "The Jackson @JsonInclude policy emitted for optional, non-nullable model properties. " + + "NONE emits no annotation, deferring fully to the global ObjectMapper inclusion policy."); + optionalNonNullPropertyJsonIncludeOpt.addEnum("NON_NULL", "Omit the property when its value is null (default, spec-safe for non-nullable fields)."); + optionalNonNullPropertyJsonIncludeOpt.addEnum("NON_EMPTY", "Omit the property when its value is null or considered empty."); + optionalNonNullPropertyJsonIncludeOpt.addEnum("NON_DEFAULT", "Omit the property when its value equals the default."); + optionalNonNullPropertyJsonIncludeOpt.addEnum("NONE", "Emit no @JsonInclude annotation; defer to the global ObjectMapper."); + optionalNonNullPropertyJsonIncludeOpt.setDefault(optionalNonNullPropertyJsonInclude); + cliOptions.add(optionalNonNullPropertyJsonIncludeOpt); + + cliOptions.add(CliOption.newBoolean(GENERATE_JSON_INCLUDE_ANNOTATIONS, + "Whether to generate policy @JsonInclude annotations on model properties. When false, all " + + "automatic @JsonInclude annotations (required-field protection and the optional non-nullable policy) " + + "are omitted so the global ObjectMapper owns inclusion. A per-property override set via the " + + "`x-jackson-json-include-policy` vendor extension is still honored.", generateJsonIncludeAnnotations)); cliOptions.add(CliOption.newBoolean(API_FIRST, "Generate the API from the OAI spec at server compile time (API first approach)", apiFirst)); cliOptions @@ -558,6 +584,12 @@ public void processOpts() { convertPropertyToBooleanAndWriteBack(RETURN_SUCCESS_CODE, this::setReturnSuccessCode); convertPropertyToBooleanAndWriteBack(USE_SWAGGER_UI, this::setUseSwaggerUI); convertPropertyToBooleanAndWriteBack(USE_SEALED, this::setUseSealed); + convertPropertyToBooleanAndWriteBack(GENERATE_JSON_INCLUDE_ANNOTATIONS, this::setGenerateJsonIncludeAnnotations); + if (additionalProperties.containsKey(OPTIONAL_NON_NULL_PROPERTY_JSON_INCLUDE)) { + this.setOptionalNonNullPropertyJsonInclude(additionalProperties.get(OPTIONAL_NON_NULL_PROPERTY_JSON_INCLUDE).toString()); + } + this.optionalNonNullPropertyJsonInclude = normalizeJsonIncludePolicy(this.optionalNonNullPropertyJsonInclude); + additionalProperties.put(OPTIONAL_NON_NULL_PROPERTY_JSON_INCLUDE, optionalNonNullPropertyJsonInclude); if (DocumentationProvider.NONE.equals(getDocumentationProvider())) { this.setUseSwaggerUI(false); } @@ -1213,21 +1245,58 @@ 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 + 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. + if (!property.required && !property.isNullable && !openApiNullable) { + property.vendorExtensions.put("x-has-json-setter-nulls-skip", true); + model.imports.add("JsonSetter"); + model.imports.add("Nulls"); + } + + // Resolve the @JsonInclude policy into the single universal x-jackson-json-include-policy vendor + // extension the template emits. Precedence: + // 1. A value set directly on the property (manual override in the spec) always wins. + // 2. Otherwise, when generateJsonIncludeAnnotations=true, apply the automatic matrix: + // required & non-nullable -> NON_NULL (contract protection; omit rather than emit invalid null) + // required & nullable -> ALWAYS (explicit null is valid and must be serialized) + // optional & non-nullable -> optionalNonNullPropertyJsonInclude (default NON_NULL, NONE = omit) + // optional & nullable -> none (JsonNullable module already governs inclusion) + if (property.vendorExtensions.containsKey(JSON_INCLUDE_POLICY_EXTENSION)) { + if (isJsonIncludePolicyEmitted(property.vendorExtensions.get(JSON_INCLUDE_POLICY_EXTENSION))) { + model.imports.add("JsonInclude"); + } + } else if (generateJsonIncludeAnnotations) { + String policy = null; + if (property.required) { + policy = property.isNullable ? "ALWAYS" : "NON_NULL"; + } else if (!property.isNullable) { + policy = optionalNonNullPropertyJsonInclude; + } + if (isJsonIncludePolicyEmitted(policy)) { + property.vendorExtensions.put(JSON_INCLUDE_POLICY_EXTENSION, policy); + model.imports.add("JsonInclude"); } } - // 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"); + } + + private static boolean isJsonIncludePolicyEmitted(Object policy) { + return policy != null && !policy.toString().isEmpty() && !"NONE".equalsIgnoreCase(policy.toString()); + } + + private static String normalizeJsonIncludePolicy(String policy) { + if (policy == null) { + return "NON_NULL"; + } + String normalized = policy.trim().toUpperCase(Locale.ROOT); + switch (normalized) { + case "NON_NULL": + case "NON_EMPTY": + case "NON_DEFAULT": + case "NONE": + return normalized; + default: + throw new IllegalArgumentException(OPTIONAL_NON_NULL_PROPERTY_JSON_INCLUDE + + " must be one of NON_NULL, NON_EMPTY, NON_DEFAULT, NONE but was: " + policy); } } diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/pojo.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/pojo.mustache index 6dd2e6da00d2..bfd4acbfc98b 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/pojo.mustache @@ -62,14 +62,9 @@ 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}} {{/jackson}} {{#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..a3f5e136f066 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,213 @@ 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: default matrix for JAVA-SPRING (openApiNullable=true). + * required non-nullable -> NON_NULL, required nullable -> ALWAYS, + * optional non-nullable -> NON_NULL (default policy), optional nullable -> no annotation. */ @Test - void optionalNullableField_withoutOpenApiNullable_hasNoNonAbsentAnnotation() 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, "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)"); + 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"); } /** - * Optional+non-nullable fields must still have {@code @JsonInclude(NON_NULL)} regardless - * of the openApiNullable setting. + * Issue #24401: {@code optionalNonNullPropertyJsonInclude} changes the policy emitted for + * optional non-nullable properties. */ @Test - void optionalNonNullableField_alwaysHasNonNullAnnotation() throws IOException { + 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")); + Map.of(CodegenConstants.OPENAPI_NULLABLE, "true", + SpringCodegen.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", + SpringCodegen.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", + SpringCodegen.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(SpringCodegen.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")); + + // 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")); + + // 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(SpringCodegen.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")); } @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 c0d2cb18e3f0..079641006ed5 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 @@ -6690,28 +6690,173 @@ 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: 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", + new HashMap<>()); + + 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(KotlinSpringServerCodegen.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(KotlinSpringServerCodegen.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(KotlinSpringServerCodegen.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")); + + // 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(KotlinSpringServerCodegen.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"); } /** 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..c09979cb96c6 --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/spring/issue_24401_json_include_per_schema.yaml @@ -0,0 +1,81 @@ +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 From 6408e37698c48e204dc52ff8325a3e0bba23e1a9 Mon Sep 17 00:00:00 2001 From: Jachym Metlicka Date: Fri, 24 Jul 2026 13:52:00 +0200 Subject: [PATCH 02/12] update samples and documentation --- .../src/main/java/org/openapitools/model/Pet.java | 1 + .../src/main/java/org/openapitools/model/Pet.java | 2 ++ .../src/main/java/org/openapitools/model/Pet.java | 2 ++ .../src/main/java/org/openapitools/model/Pet.java | 2 ++ .../src/main/java/org/openapitools/model/Pet.java | 2 ++ .../model/AdditionalPropertiesClassDto.java | 1 - .../main/java/org/openapitools/model/AnimalDto.java | 1 + .../main/java/org/openapitools/model/CategoryDto.java | 1 + .../openapitools/model/ContainerDefaultValueDto.java | 4 ++-- .../main/java/org/openapitools/model/EnumTestDto.java | 1 + .../java/org/openapitools/model/FormatTestDto.java | 4 ++++ .../src/main/java/org/openapitools/model/NameDto.java | 1 + .../org/openapitools/model/NullableMapPropertyDto.java | 2 -- .../org/openapitools/model/ParentWithNullableDto.java | 1 - .../src/main/java/org/openapitools/model/PetDto.java | 2 ++ .../org/openapitools/model/TypeHolderDefaultDto.java | 6 ++++++ .../org/openapitools/model/TypeHolderExampleDto.java | 7 +++++++ .../model/AdditionalPropertiesClassDto.java | 1 - .../main/java/org/openapitools/model/AnimalDto.java | 1 + .../main/java/org/openapitools/model/CategoryDto.java | 1 + .../openapitools/model/ContainerDefaultValueDto.java | 4 ++-- .../main/java/org/openapitools/model/EnumTestDto.java | 1 + .../java/org/openapitools/model/FormatTestDto.java | 4 ++++ .../src/main/java/org/openapitools/model/NameDto.java | 1 + .../org/openapitools/model/NullableMapPropertyDto.java | 2 -- .../org/openapitools/model/ParentWithNullableDto.java | 1 - .../src/main/java/org/openapitools/model/PetDto.java | 2 ++ .../org/openapitools/model/TypeHolderDefaultDto.java | 6 ++++++ .../org/openapitools/model/TypeHolderExampleDto.java | 7 +++++++ .../src/main/java/org/openapitools/model/PetDto.java | 2 ++ .../openapitools/model/AdditionalPropertiesClass.java | 1 - .../src/main/java/org/openapitools/model/Animal.java | 1 + .../src/main/java/org/openapitools/model/Category.java | 1 + .../org/openapitools/model/ContainerDefaultValue.java | 4 ++-- .../src/main/java/org/openapitools/model/EnumTest.java | 1 + .../main/java/org/openapitools/model/FormatTest.java | 4 ++++ .../src/main/java/org/openapitools/model/Name.java | 1 + .../org/openapitools/model/NullableMapProperty.java | 2 -- .../org/openapitools/model/ParentWithNullable.java | 1 - .../src/main/java/org/openapitools/model/Pet.java | 2 ++ .../java/org/openapitools/model/TypeHolderDefault.java | 6 ++++++ .../java/org/openapitools/model/TypeHolderExample.java | 7 +++++++ .../openapitools/model/AdditionalPropertiesClass.java | 1 - .../src/main/java/org/openapitools/model/Animal.java | 1 + .../src/main/java/org/openapitools/model/Category.java | 1 + .../org/openapitools/model/ContainerDefaultValue.java | 4 ++-- .../src/main/java/org/openapitools/model/EnumTest.java | 1 + .../main/java/org/openapitools/model/FormatTest.java | 4 ++++ .../src/main/java/org/openapitools/model/Name.java | 1 + .../org/openapitools/model/NullableMapProperty.java | 2 -- .../org/openapitools/model/ParentWithNullable.java | 1 - .../src/main/java/org/openapitools/model/Pet.java | 2 ++ .../java/org/openapitools/model/TypeHolderDefault.java | 6 ++++++ .../java/org/openapitools/model/TypeHolderExample.java | 7 +++++++ .../openapitools/model/AdditionalPropertiesClass.java | 1 - .../src/main/java/org/openapitools/model/Animal.java | 1 + .../src/main/java/org/openapitools/model/Category.java | 1 + .../org/openapitools/model/ContainerDefaultValue.java | 4 ++-- .../src/main/java/org/openapitools/model/EnumTest.java | 1 + .../main/java/org/openapitools/model/FormatTest.java | 4 ++++ .../src/main/java/org/openapitools/model/Name.java | 1 + .../org/openapitools/model/NullableMapProperty.java | 2 -- .../org/openapitools/model/ParentWithNullable.java | 1 - .../src/main/java/org/openapitools/model/Pet.java | 2 ++ .../java/org/openapitools/model/TypeHolderDefault.java | 6 ++++++ .../java/org/openapitools/model/TypeHolderExample.java | 7 +++++++ .../main/java/org/openapitools/model/AnimalDto.java | 1 + .../main/java/org/openapitools/model/CategoryDto.java | 1 + .../openapitools/model/ContainerDefaultValueDto.java | 3 +++ .../main/java/org/openapitools/model/EnumTestDto.java | 1 + .../java/org/openapitools/model/FormatTestDto.java | 4 ++++ .../src/main/java/org/openapitools/model/NameDto.java | 1 + .../src/main/java/org/openapitools/model/PetDto.java | 2 ++ .../org/openapitools/model/TypeHolderDefaultDto.java | 6 ++++++ .../org/openapitools/model/TypeHolderExampleDto.java | 7 +++++++ .../openapitools/model/AdditionalPropertiesClass.java | 1 - .../src/main/java/org/openapitools/model/Animal.java | 1 + .../src/main/java/org/openapitools/model/Category.java | 1 + .../org/openapitools/model/ContainerDefaultValue.java | 4 ++-- .../src/main/java/org/openapitools/model/EnumTest.java | 1 + .../main/java/org/openapitools/model/FormatTest.java | 4 ++++ .../src/main/java/org/openapitools/model/Name.java | 1 + .../org/openapitools/model/NullableMapProperty.java | 2 -- .../org/openapitools/model/ParentWithNullable.java | 1 - .../src/main/java/org/openapitools/model/Pet.java | 2 ++ .../java/org/openapitools/model/TypeHolderDefault.java | 6 ++++++ .../java/org/openapitools/model/TypeHolderExample.java | 7 +++++++ .../model/AdditionalPropertiesClassDto.java | 1 - .../main/java/org/openapitools/model/AnimalDto.java | 1 + .../main/java/org/openapitools/model/CategoryDto.java | 1 + .../openapitools/model/ContainerDefaultValueDto.java | 4 ++-- .../main/java/org/openapitools/model/EnumTestDto.java | 1 + .../java/org/openapitools/model/FormatTestDto.java | 4 ++++ .../src/main/java/org/openapitools/model/NameDto.java | 1 + .../org/openapitools/model/NullableMapPropertyDto.java | 2 -- .../org/openapitools/model/ParentWithNullableDto.java | 1 - .../src/main/java/org/openapitools/model/PetDto.java | 2 ++ .../org/openapitools/model/TypeHolderDefaultDto.java | 6 ++++++ .../org/openapitools/model/TypeHolderExampleDto.java | 7 +++++++ .../src/main/java/org/openapitools/model/Pet.java | 2 ++ .../src/main/java/org/openapitools/model/Pet.java | 2 ++ .../src/main/java/org/openapitools/model/Pet.java | 2 ++ .../src/main/java/org/openapitools/model/Pet.java | 2 ++ .../src/main/java/org/openapitools/model/Pet.java | 1 + .../src/main/java/org/openapitools/model/Pet.java | 2 ++ .../openapitools/model/AdditionalPropertiesClass.java | 1 - .../src/main/java/org/openapitools/model/Animal.java | 1 + .../src/main/java/org/openapitools/model/Category.java | 1 + .../org/openapitools/model/ContainerDefaultValue.java | 4 ++-- .../src/main/java/org/openapitools/model/EnumTest.java | 1 + .../main/java/org/openapitools/model/FormatTest.java | 4 ++++ .../src/main/java/org/openapitools/model/Name.java | 1 + .../org/openapitools/model/NullableMapProperty.java | 2 -- .../org/openapitools/model/ParentWithNullable.java | 1 - .../src/main/java/org/openapitools/model/Pet.java | 2 ++ .../java/org/openapitools/model/TypeHolderDefault.java | 6 ++++++ .../java/org/openapitools/model/TypeHolderExample.java | 7 +++++++ .../src/main/java/org/openapitools/model/Pet.java | 2 ++ .../src/main/java/org/openapitools/model/Pet.java | 2 ++ .../src/main/java/org/openapitools/model/Pet.java | 2 ++ .../src/main/java/org/openapitools/model/Pet.java | 2 ++ .../src/main/java/org/openapitools/model/Apple.java | 3 +++ .../src/main/java/org/openapitools/model/Banana.java | 3 +++ .../src/main/java/org/openapitools/model/Bar.java | 1 + .../src/main/java/org/openapitools/model/Entity.java | 1 + .../main/java/org/openapitools/model/EntityRef.java | 1 + .../main/java/org/openapitools/model/Extensible.java | 1 + .../src/main/java/org/openapitools/model/Fruit.java | 1 + .../src/main/java/org/openapitools/model/Apple.java | 3 +++ .../src/main/java/org/openapitools/model/Banana.java | 3 +++ .../src/main/java/org/openapitools/model/Bar.java | 1 + .../src/main/java/org/openapitools/model/Entity.java | 1 + .../main/java/org/openapitools/model/EntityRef.java | 1 + .../main/java/org/openapitools/model/Extensible.java | 1 + .../src/main/java/org/openapitools/model/Fruit.java | 1 + .../src/main/java/org/openapitools/model/Apple.java | 3 +++ .../src/main/java/org/openapitools/model/Banana.java | 3 +++ .../src/main/java/org/openapitools/model/Bar.java | 1 + .../src/main/java/org/openapitools/model/Entity.java | 1 + .../main/java/org/openapitools/model/EntityRef.java | 1 + .../main/java/org/openapitools/model/Extensible.java | 1 + .../src/main/java/org/openapitools/model/Fruit.java | 1 + .../src/main/java/org/openapitools/model/Pet.java | 2 ++ .../src/main/java/org/openapitools/model/Pet.java | 2 ++ .../src/main/java/org/openapitools/model/Pet.java | 2 ++ .../src/main/java/org/openapitools/model/Foo.java | 1 + .../src/main/java/org/openapitools/model/Pet.java | 2 ++ .../openapitools/model/AdditionalPropertiesClass.java | 1 - .../src/main/java/org/openapitools/model/Animal.java | 1 + .../src/main/java/org/openapitools/model/Category.java | 1 + .../org/openapitools/model/ContainerDefaultValue.java | 4 ++-- .../src/main/java/org/openapitools/model/EnumTest.java | 1 + .../main/java/org/openapitools/model/FormatTest.java | 4 ++++ .../src/main/java/org/openapitools/model/Name.java | 1 + .../org/openapitools/model/NullableMapProperty.java | 2 -- .../org/openapitools/model/ParentWithNullable.java | 1 - .../src/main/java/org/openapitools/model/Pet.java | 2 ++ .../java/org/openapitools/model/TypeHolderDefault.java | 6 ++++++ .../java/org/openapitools/model/TypeHolderExample.java | 7 +++++++ .../openapitools/model/AdditionalPropertiesClass.java | 1 - .../src/main/java/org/openapitools/model/Animal.java | 1 + .../src/main/java/org/openapitools/model/Category.java | 1 + .../org/openapitools/model/ContainerDefaultValue.java | 4 ++-- .../src/main/java/org/openapitools/model/EnumTest.java | 1 + .../main/java/org/openapitools/model/FormatTest.java | 4 ++++ .../src/main/java/org/openapitools/model/Name.java | 1 + .../org/openapitools/model/NullableMapProperty.java | 2 -- .../org/openapitools/model/ParentWithNullable.java | 1 - .../src/main/java/org/openapitools/model/Pet.java | 2 ++ .../java/org/openapitools/model/TypeHolderDefault.java | 6 ++++++ .../java/org/openapitools/model/TypeHolderExample.java | 7 +++++++ .../src/main/java/org/openapitools/model/Pet.java | 2 ++ .../src/main/java/org/openapitools/model/Pet.java | 2 ++ .../src/main/kotlin/org/openapitools/model/Cat.kt | 2 ++ .../src/main/kotlin/org/openapitools/model/Dog.kt | 3 +++ .../src/main/kotlin/org/openapitools/model/Pet.kt | 1 + .../src/main/kotlin/org/openapitools/model/Bird.kt | 2 ++ .../src/main/kotlin/org/openapitools/model/Robobird.kt | 2 ++ .../src/main/kotlin/org/openapitools/model/Car.kt | 3 +++ .../src/main/kotlin/org/openapitools/model/Truck.kt | 3 +++ .../src/main/kotlin/org/openapitools/model/Vehicle.kt | 1 + .../src/main/kotlin/org/openapitools/model/Pet.kt | 2 ++ .../src/main/kotlin/org/openapitools/model/Pet.kt | 2 ++ .../src/main/kotlin/org/openapitools/model/Pet.kt | 2 ++ .../src/main/kotlin/org/openapitools/model/Pet.kt | 2 ++ .../src/main/kotlin/org/openapitools/model/Pet.kt | 2 ++ .../src/main/kotlin/org/openapitools/model/Pet.kt | 2 ++ .../kotlin/org/openapitools/model/AnyOfUserOrPet.kt | 3 +++ .../openapitools/model/AnyOfUserOrPetOrArrayString.kt | 3 +++ .../src/main/kotlin/org/openapitools/model/Pet.kt | 2 ++ .../src/main/kotlin/org/openapitools/model/User.kt | 1 + .../src/main/kotlin/org/openapitools/model/Pet.kt | 2 ++ .../src/main/kotlin/org/openapitools/model/Pet.kt | 2 ++ .../src/main/kotlin/org/openapitools/model/Pet.kt | 2 ++ .../src/main/kotlin/org/openapitools/model/Pet.kt | 2 ++ .../src/main/kotlin/org/openapitools/model/Pet.kt | 2 ++ .../src/main/kotlin/org/openapitools/model/Apa.kt | 2 ++ .../src/main/kotlin/org/openapitools/model/Pet.kt | 2 ++ .../src/main/kotlin/org/openapitools/model/Pet.kt | 2 ++ .../src/main/kotlin/org/openapitools/model/Cat.kt | 3 +++ .../src/main/kotlin/org/openapitools/model/Dog.kt | 6 ++++++ .../src/main/kotlin/org/openapitools/model/ApiError.kt | 1 + .../src/main/kotlin/org/openapitools/model/Pet.kt | 2 ++ .../src/main/kotlin/org/openapitools/model/Pet.kt | 2 ++ .../src/main/kotlin/org/openapitools/model/Pet.kt | 2 ++ .../src/main/kotlin/org/openapitools/model/PageMeta.kt | 5 +++++ .../src/main/kotlin/org/openapitools/model/Pet.kt | 1 + .../src/main/kotlin/org/openapitools/model/Pet.kt | 2 ++ .../src/main/kotlin/org/openapitools/model/Pet.kt | 2 ++ .../src/main/kotlin/org/openapitools/model/Cat.kt | 1 + .../src/main/kotlin/org/openapitools/model/Category.kt | 1 + .../src/main/kotlin/org/openapitools/model/Dog.kt | 1 + .../src/main/kotlin/org/openapitools/model/Pet.kt | 2 ++ .../kotlin/org/openapitools/model/NullableModel.kt | 3 ++- .../src/main/kotlin/org/openapitools/model/Pet.kt | 1 + .../src/main/kotlin/org/openapitools/model/Pet.kt | 2 ++ .../src/main/kotlin/org/openapitools/model/Pet.kt | 2 ++ .../src/main/kotlin/org/openapitools/model/Cat.kt | 3 +++ .../src/main/kotlin/org/openapitools/model/Dog.kt | 6 ++++++ .../src/main/kotlin/org/openapitools/model/Pet.kt | 2 ++ .../openapitools/model/AdditionalPropertiesClass.java | 1 - .../src/main/java/org/openapitools/model/Animal.java | 1 + .../src/main/java/org/openapitools/model/Category.java | 1 + .../org/openapitools/model/ContainerDefaultValue.java | 4 ++-- .../src/main/java/org/openapitools/model/EnumTest.java | 1 + .../main/java/org/openapitools/model/FormatTest.java | 4 ++++ .../src/main/java/org/openapitools/model/Name.java | 1 + .../org/openapitools/model/NullableMapProperty.java | 2 -- .../org/openapitools/model/ParentWithNullable.java | 1 - .../src/main/java/org/openapitools/model/Pet.java | 2 ++ .../java/org/openapitools/model/TypeHolderDefault.java | 6 ++++++ .../java/org/openapitools/model/TypeHolderExample.java | 7 +++++++ .../org/openapitools/model/ObjectWithUniqueItems.java | 2 -- .../src/main/java/org/openapitools/model/Animal.java | 1 + .../src/main/java/org/openapitools/model/Category.java | 1 + .../org/openapitools/model/ContainerDefaultValue.java | 3 +++ .../src/main/java/org/openapitools/model/EnumTest.java | 1 + .../main/java/org/openapitools/model/FormatTest.java | 4 ++++ .../src/main/java/org/openapitools/model/Name.java | 1 + .../src/main/java/org/openapitools/model/Pet.java | 2 ++ .../java/org/openapitools/model/TypeHolderDefault.java | 6 ++++++ .../java/org/openapitools/model/TypeHolderExample.java | 7 +++++++ .../openapitools/model/AdditionalPropertiesClass.java | 1 - .../src/main/java/org/openapitools/model/Animal.java | 1 + .../src/main/java/org/openapitools/model/Category.java | 1 + .../org/openapitools/model/ContainerDefaultValue.java | 4 ++-- .../src/main/java/org/openapitools/model/EnumTest.java | 1 + .../main/java/org/openapitools/model/FormatTest.java | 4 ++++ .../src/main/java/org/openapitools/model/Name.java | 1 + .../org/openapitools/model/NullableMapProperty.java | 2 -- .../org/openapitools/model/ParentWithNullable.java | 1 - .../src/main/java/org/openapitools/model/Pet.java | 2 ++ .../java/org/openapitools/model/TypeHolderDefault.java | 6 ++++++ .../java/org/openapitools/model/TypeHolderExample.java | 7 +++++++ .../openapitools/model/AdditionalPropertiesClass.java | 1 - .../src/main/java/org/openapitools/model/Animal.java | 1 + .../src/main/java/org/openapitools/model/Category.java | 1 + .../org/openapitools/model/ContainerDefaultValue.java | 4 ++-- .../src/main/java/org/openapitools/model/EnumTest.java | 1 + .../main/java/org/openapitools/model/FormatTest.java | 4 ++++ .../src/main/java/org/openapitools/model/Name.java | 1 + .../org/openapitools/model/NullableMapProperty.java | 2 -- .../org/openapitools/model/ParentWithNullable.java | 1 - .../src/main/java/org/openapitools/model/Pet.java | 2 ++ .../java/org/openapitools/model/TypeHolderDefault.java | 6 ++++++ .../java/org/openapitools/model/TypeHolderExample.java | 7 +++++++ .../openapitools/model/AdditionalPropertiesClass.java | 1 - .../src/main/java/org/openapitools/model/Animal.java | 1 + .../src/main/java/org/openapitools/model/Category.java | 1 + .../org/openapitools/model/ContainerDefaultValue.java | 4 ++-- .../src/main/java/org/openapitools/model/EnumTest.java | 1 + .../main/java/org/openapitools/model/FormatTest.java | 4 ++++ .../src/main/java/org/openapitools/model/Name.java | 1 + .../org/openapitools/model/NullableMapProperty.java | 2 -- .../org/openapitools/model/ParentWithNullable.java | 1 - .../src/main/java/org/openapitools/model/Pet.java | 2 ++ .../java/org/openapitools/model/TypeHolderDefault.java | 6 ++++++ .../java/org/openapitools/model/TypeHolderExample.java | 7 +++++++ .../src/main/java/org/openapitools/model/Pet.java | 2 ++ .../openapitools/model/AdditionalPropertiesClass.java | 1 - .../src/main/java/org/openapitools/model/Animal.java | 1 + .../src/main/java/org/openapitools/model/Category.java | 1 + .../org/openapitools/model/ContainerDefaultValue.java | 4 ++-- .../src/main/java/org/openapitools/model/EnumTest.java | 1 + .../main/java/org/openapitools/model/FormatTest.java | 4 ++++ .../src/main/java/org/openapitools/model/Name.java | 1 + .../org/openapitools/model/NullableMapProperty.java | 2 -- .../org/openapitools/model/ParentWithNullable.java | 1 - .../src/main/java/org/openapitools/model/Pet.java | 2 ++ .../java/org/openapitools/model/TypeHolderDefault.java | 6 ++++++ .../java/org/openapitools/model/TypeHolderExample.java | 7 +++++++ .../src/main/java/org/openapitools/model/Pet.java | 2 ++ .../openapitools/model/AdditionalPropertiesClass.java | 1 - .../src/main/java/org/openapitools/model/Animal.java | 1 + .../src/main/java/org/openapitools/model/Category.java | 1 + .../org/openapitools/model/ContainerDefaultValue.java | 4 ++-- .../src/main/java/org/openapitools/model/EnumTest.java | 1 + .../main/java/org/openapitools/model/FormatTest.java | 4 ++++ .../src/main/java/org/openapitools/model/Name.java | 1 + .../org/openapitools/model/NullableMapProperty.java | 2 -- .../org/openapitools/model/ParentWithNullable.java | 1 - .../src/main/java/org/openapitools/model/Pet.java | 2 ++ .../java/org/openapitools/model/TypeHolderDefault.java | 6 ++++++ .../java/org/openapitools/model/TypeHolderExample.java | 7 +++++++ .../model/AdditionalPropertiesClassDto.java | 1 - .../main/java/org/openapitools/model/AnimalDto.java | 1 + .../main/java/org/openapitools/model/CategoryDto.java | 1 + .../openapitools/model/ContainerDefaultValueDto.java | 4 ++-- .../main/java/org/openapitools/model/EnumTestDto.java | 1 + .../java/org/openapitools/model/FormatTestDto.java | 4 ++++ .../src/main/java/org/openapitools/model/NameDto.java | 1 + .../org/openapitools/model/NullableMapPropertyDto.java | 2 -- .../org/openapitools/model/ParentWithNullableDto.java | 1 - .../src/main/java/org/openapitools/model/PetDto.java | 2 ++ .../org/openapitools/model/TypeHolderDefaultDto.java | 6 ++++++ .../org/openapitools/model/TypeHolderExampleDto.java | 7 +++++++ .../src/main/java/org/openapitools/model/Pet.java | 2 ++ .../src/main/java/org/openapitools/model/Pet.java | 2 ++ .../src/main/java/org/openapitools/model/PageMeta.java | 5 +++++ .../src/main/java/org/openapitools/model/Pet.java | 1 + .../src/main/java/org/openapitools/model/Pet.java | 2 ++ .../openapitools/model/AdditionalPropertiesClass.java | 1 - .../src/main/java/org/openapitools/model/Animal.java | 1 + .../src/main/java/org/openapitools/model/Category.java | 1 + .../org/openapitools/model/ContainerDefaultValue.java | 4 ++-- .../src/main/java/org/openapitools/model/EnumTest.java | 1 + .../main/java/org/openapitools/model/FormatTest.java | 4 ++++ .../src/main/java/org/openapitools/model/Name.java | 1 + .../org/openapitools/model/NullableMapProperty.java | 2 -- .../org/openapitools/model/ParentWithNullable.java | 1 - .../src/main/java/org/openapitools/model/Pet.java | 2 ++ .../java/org/openapitools/model/TypeHolderDefault.java | 6 ++++++ .../java/org/openapitools/model/TypeHolderExample.java | 7 +++++++ .../openapitools/model/AdditionalPropertiesClass.java | 1 - .../src/main/java/org/openapitools/model/Animal.java | 1 + .../src/main/java/org/openapitools/model/Category.java | 1 + .../org/openapitools/model/ContainerDefaultValue.java | 4 ++-- .../src/main/java/org/openapitools/model/EnumTest.java | 1 + .../main/java/org/openapitools/model/FormatTest.java | 4 ++++ .../src/main/java/org/openapitools/model/Name.java | 1 + .../org/openapitools/model/NullableMapProperty.java | 2 -- .../org/openapitools/model/ParentWithNullable.java | 1 - .../src/main/java/org/openapitools/model/Pet.java | 2 ++ .../java/org/openapitools/model/TypeHolderDefault.java | 6 ++++++ .../java/org/openapitools/model/TypeHolderExample.java | 7 +++++++ .../java/org/openapitools/model/NullableModel.java | 3 ++- .../src/main/java/org/openapitools/model/Pet.java | 1 + .../src/main/java/org/openapitools/model/Animal.java | 1 + .../src/main/java/org/openapitools/model/Category.java | 1 + .../src/main/java/org/openapitools/model/EnumTest.java | 1 + .../main/java/org/openapitools/model/FormatTest.java | 4 ++++ .../src/main/java/org/openapitools/model/Name.java | 1 + .../src/main/java/org/openapitools/model/Pet.java | 2 ++ .../java/org/openapitools/model/TypeHolderDefault.java | 6 ++++++ .../java/org/openapitools/model/TypeHolderExample.java | 7 +++++++ .../src/main/java/org/openapitools/model/Animal.java | 1 + .../src/main/java/org/openapitools/model/Category.java | 1 + .../src/main/java/org/openapitools/model/EnumTest.java | 1 + .../main/java/org/openapitools/model/FormatTest.java | 4 ++++ .../src/main/java/org/openapitools/model/Name.java | 1 + .../src/main/java/org/openapitools/model/Pet.java | 2 ++ .../java/org/openapitools/model/TypeHolderDefault.java | 6 ++++++ .../java/org/openapitools/model/TypeHolderExample.java | 7 +++++++ .../src/main/java/org/openapitools/model/Animal.java | 1 + .../src/main/java/org/openapitools/model/Category.java | 1 + .../src/main/java/org/openapitools/model/EnumTest.java | 1 + .../main/java/org/openapitools/model/FormatTest.java | 4 ++++ .../src/main/java/org/openapitools/model/Name.java | 1 + .../src/main/java/org/openapitools/model/Pet.java | 2 ++ .../java/org/openapitools/model/TypeHolderDefault.java | 6 ++++++ .../java/org/openapitools/model/TypeHolderExample.java | 7 +++++++ .../src/main/java/org/openapitools/model/Animal.java | 1 + .../src/main/java/org/openapitools/model/Category.java | 1 + .../src/main/java/org/openapitools/model/EnumTest.java | 1 + .../main/java/org/openapitools/model/FormatTest.java | 4 ++++ .../src/main/java/org/openapitools/model/Name.java | 1 + .../src/main/java/org/openapitools/model/Pet.java | 2 ++ .../java/org/openapitools/model/TypeHolderDefault.java | 6 ++++++ .../java/org/openapitools/model/TypeHolderExample.java | 7 +++++++ .../src/main/java/org/openapitools/model/Pet.java | 2 ++ .../openapitools/model/AdditionalPropertiesClass.java | 1 - .../src/main/java/org/openapitools/model/Animal.java | 1 + .../src/main/java/org/openapitools/model/Category.java | 1 + .../org/openapitools/model/ContainerDefaultValue.java | 4 ++-- .../src/main/java/org/openapitools/model/EnumTest.java | 1 + .../main/java/org/openapitools/model/FormatTest.java | 4 ++++ .../src/main/java/org/openapitools/model/Name.java | 1 + .../org/openapitools/model/NullableMapProperty.java | 2 -- .../org/openapitools/model/ParentWithNullable.java | 1 - .../src/main/java/org/openapitools/model/Pet.java | 2 ++ .../java/org/openapitools/model/TypeHolderDefault.java | 6 ++++++ .../java/org/openapitools/model/TypeHolderExample.java | 7 +++++++ .../virtualan/model/AdditionalPropertiesClass.java | 1 - .../java/org/openapitools/virtualan/model/Animal.java | 1 + .../org/openapitools/virtualan/model/Category.java | 1 + .../virtualan/model/ContainerDefaultValue.java | 4 ++-- .../org/openapitools/virtualan/model/EnumTest.java | 1 + .../org/openapitools/virtualan/model/FormatTest.java | 4 ++++ .../java/org/openapitools/virtualan/model/Name.java | 1 + .../virtualan/model/NullableMapProperty.java | 2 -- .../virtualan/model/ParentWithNullable.java | 1 - .../java/org/openapitools/virtualan/model/Pet.java | 2 ++ .../virtualan/model/TypeHolderDefault.java | 6 ++++++ .../virtualan/model/TypeHolderExample.java | 7 +++++++ .../main/java/org/openapitools/model/AnimalDto.java | 1 + .../main/java/org/openapitools/model/CategoryDto.java | 1 + .../main/java/org/openapitools/model/EnumTestDto.java | 2 +- .../java/org/openapitools/model/FormatTestDto.java | 4 ++++ .../org/openapitools/model/HealthCheckResultDto.java | 2 -- .../src/main/java/org/openapitools/model/NameDto.java | 1 + .../java/org/openapitools/model/NullableClassDto.java | 10 ---------- .../model/OuterObjectWithEnumPropertyDto.java | 2 ++ .../org/openapitools/model/ParentWithNullableDto.java | 1 - .../src/main/java/org/openapitools/model/PetDto.java | 2 ++ .../model/AdditionalPropertiesClassDto.java | 1 - .../main/java/org/openapitools/model/AnimalDto.java | 1 + .../main/java/org/openapitools/model/CategoryDto.java | 1 + .../openapitools/model/ContainerDefaultValueDto.java | 4 ++-- .../main/java/org/openapitools/model/EnumTestDto.java | 1 + .../java/org/openapitools/model/FormatTestDto.java | 4 ++++ .../src/main/java/org/openapitools/model/NameDto.java | 1 + .../org/openapitools/model/NullableMapPropertyDto.java | 2 -- .../org/openapitools/model/ParentWithNullableDto.java | 1 - .../src/main/java/org/openapitools/model/PetDto.java | 2 ++ .../org/openapitools/model/TypeHolderDefaultDto.java | 6 ++++++ .../org/openapitools/model/TypeHolderExampleDto.java | 7 +++++++ 426 files changed, 906 insertions(+), 150 deletions(-) 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/PetDto.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/PetDto.java index 2bec6c231fc2..72a715bd0e20 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 @@ -36,8 +36,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 List photoUrls = new ArrayList<>(); @JsonInclude(JsonInclude.Include.NON_NULL) 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/AnimalDto.java b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/AnimalDto.java index 79eb758c01f0..3e9eafcccd85 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,6 +39,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-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..13fb12b7ecd2 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 @@ -29,6 +29,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-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/EnumTestDto.java b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/EnumTestDto.java index f94de0c9c545..cf17977dfcac 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 @@ -105,6 +105,7 @@ public static EnumStringRequiredEnum fromValue(String value) { } } + @JsonInclude(JsonInclude.Include.NON_NULL) private EnumStringRequiredEnum enumStringRequired; /** 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..9b9fcb4d1bf8 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 @@ -41,6 +41,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) @@ -52,11 +53,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; @@ -67,6 +70,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-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..bc3e2c3c5da0 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,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/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..8e339b8f2701 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 @@ -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/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-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/Pet.java b/samples/openapi3/client/petstore/spring-cloud-4-with-optional/src/main/java/org/openapitools/model/Pet.java index e7ed1e26b8fa..9308a4a8eed9 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 @@ -35,8 +35,10 @@ public class Pet { @JsonInclude(JsonInclude.Include.NON_NULL) 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) 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..127fd2f64399 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 @@ -50,6 +50,7 @@ public class Foo { @JsonInclude(JsonInclude.Include.NON_NULL) private List listMinIntems = new ArrayList<>(); + @JsonInclude(JsonInclude.Include.NON_NULL) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime requiredDt; 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..93a856e10555 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 @@ -45,8 +45,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-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/Pet.java b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/Pet.java index 37d29c32b8da..c16ac8affc4e 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 @@ -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/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/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/Pet.kt b/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/model/Pet.kt index 56c523367969..7cf3de7d9c48 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,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-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/Pet.kt b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Pet.kt index 3f3a4d005b5b..5be374053e68 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,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) 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, 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/Pet.kt b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Pet.kt index a94d6438c2b5..c98aeda868da 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,9 +31,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/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/Animal.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Animal.java index 0364cbeb451f..d5fdd45f18f4 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,6 +38,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-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..cca98c14da84 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 @@ -27,6 +27,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-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/EnumTest.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumTest.java index c5b52e5f1168..171acfa4ae03 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 @@ -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-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..e48c14544a78 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 @@ -41,6 +41,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) @@ -52,11 +53,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; @@ -67,6 +70,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-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..78dc53df6d91 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,6 +25,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-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..26e826f8fbc9 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 @@ -39,8 +39,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-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/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/Pet.java b/samples/server/petstore/springboot-lombok-data/src/main/java/org/openapitools/model/Pet.java index abb9aa57acef..d4c997738f18 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 @@ -52,6 +52,7 @@ public class Pet { @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<>(); 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/AdditionalPropertiesClass.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index 1b93d77f015d..00053ec24f51 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 @@ -57,7 +57,6 @@ public class AdditionalPropertiesClass { @JsonInclude(JsonInclude.Include.NON_NULL) private Optional anytype1 = Optional.empty(); - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable anytype2 = JsonNullable.undefined(); @JsonInclude(JsonInclude.Include.NON_NULL) 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..b4710c3479a4 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,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-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..7b32f50b3b7b 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 @@ -26,6 +26,7 @@ public class Category { @JsonInclude(JsonInclude.Include.NON_NULL) 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/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/EnumTest.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/EnumTest.java index 4d882356686c..161dc129156c 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 @@ -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-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..83c03f906fc6 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 @@ -40,6 +40,7 @@ public class FormatTest { @JsonInclude(JsonInclude.Include.NON_NULL) private Optional int64 = Optional.empty(); + @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 Optional<@Pattern(regexp = "[a-zA-Z]") String> string = Optional.empty(); + @JsonInclude(JsonInclude.Include.NON_NULL) private byte[] _byte; @JsonInclude(JsonInclude.Include.NON_NULL) private Optional binary = Optional.empty(); + @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 Optional uuid = Optional.empty(); + @JsonInclude(JsonInclude.Include.NON_NULL) private String password; @JsonInclude(JsonInclude.Include.NON_NULL) 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..773544c5edf4 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,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-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/ParentWithNullable.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ParentWithNullable.java index 22db1d786cd5..e5e63411d868 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 @@ -75,7 +75,6 @@ public static TypeEnum fromValue(String value) { @JsonInclude(JsonInclude.Include.NON_NULL) 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..ceab4bd69ef0 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 @@ -38,8 +38,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 Set photoUrls = new LinkedHashSet<>(); @JsonInclude(JsonInclude.Include.NON_NULL) 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-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() { From ed876b9395fffa557c208d1053999ee1a31a048a Mon Sep 17 00:00:00 2001 From: Jachym Metlicka Date: Fri, 24 Jul 2026 13:52:17 +0200 Subject: [PATCH 03/12] update documentation --- docs/generators/java-camel.md | 2 ++ docs/generators/kotlin-spring.md | 2 ++ docs/generators/spring.md | 2 ++ 3 files changed, 6 insertions(+) diff --git a/docs/generators/java-camel.md b/docs/generators/java-camel.md index 2e2d5191f02f..97c2304f5b83 100644 --- a/docs/generators/java-camel.md +++ b/docs/generators/java-camel.md @@ -64,6 +64,7 @@ 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 false, all automatic @JsonInclude annotations (required-field protection and the optional non-nullable policy) are omitted so the global ObjectMapper owns inclusion. A per-property override set via the `x-jackson-json-include-policy` vendor extension is still honored.| |true| |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 +84,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. 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| diff --git a/docs/generators/kotlin-spring.md b/docs/generators/kotlin-spring.md index f42388d53000..54d80c1ea7b1 100644 --- a/docs/generators/kotlin-spring.md +++ b/docs/generators/kotlin-spring.md @@ -33,6 +33,7 @@ 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 false, all automatic @JsonInclude annotations (required-field protection and the optional non-nullable policy) are omitted so the global ObjectMapper owns inclusion. A per-property override set via the `x-jackson-json-include-policy` vendor extension is still honored.| |true| |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 +45,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. 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| diff --git a/docs/generators/spring.md b/docs/generators/spring.md index 31f5f55ff4a5..194a1c7a1b40 100644 --- a/docs/generators/spring.md +++ b/docs/generators/spring.md @@ -57,6 +57,7 @@ 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 false, all automatic @JsonInclude annotations (required-field protection and the optional non-nullable policy) are omitted so the global ObjectMapper owns inclusion. A per-property override set via the `x-jackson-json-include-policy` vendor extension is still honored.| |true| |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 +77,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. 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| From 3dc68ed9fde92ce0665dd37994a2a664ba77171c Mon Sep 17 00:00:00 2001 From: Jachym Metlicka Date: Fri, 24 Jul 2026 15:31:28 +0200 Subject: [PATCH 04/12] feat(json-include): add support for configurable @JsonSetter(nulls) annotations on optional non-nullable properties --- .../languages/KotlinSpringServerCodegen.java | 63 ++++++++++++++----- .../codegen/languages/SpringCodegen.java | 51 ++++++++++++--- .../java/spring/SpringCodegenTest.java | 56 +++++++++++++++-- .../spring/KotlinSpringServerCodegenTest.java | 36 +++++++++-- 4 files changed, 168 insertions(+), 38 deletions(-) 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 08555c967cd9..27f7d287ade5 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 @@ -113,6 +113,7 @@ public class KotlinSpringServerCodegen extends AbstractKotlinCodegen public static final String SUSPEND_FUNCTIONS = "suspendFunctions"; 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"; /** * Universal per-property vendor extension holding the resolved Jackson {@code @JsonInclude} policy * (e.g. {@code NON_NULL}, {@code ALWAYS}). When absent, no {@code @JsonInclude} annotation is emitted. @@ -192,7 +193,9 @@ public String getDescription() { private String valuedEnumClassName = "ValuedEnum"; @Setter private boolean suspendFunctions = false; @Getter @Setter private String optionalNonNullPropertyJsonInclude = "NON_NULL"; - @Getter @Setter private boolean generateJsonIncludeAnnotations = true; + // Tri-state: null = unset (weak default + warning), Boolean.FALSE = weak (muted), Boolean.TRUE = strict emission. + @Getter @Setter private Boolean generateJsonIncludeAnnotations = null; + @Getter @Setter private Boolean generateJsonSetterNullsAnnotations = null; @Getter @Setter private boolean openApiNullable = false; @Getter @Setter protected boolean useDeductionForOneOfInterfaces = false; @@ -326,7 +329,8 @@ public KotlinSpringServerCodegen() { 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(OPTIONAL_NON_NULL_PROPERTY_JSON_INCLUDE, - "The Jackson @JsonInclude policy emitted for optional, non-nullable model properties. " + "The Jackson @JsonInclude policy emitted for optional, non-nullable model properties when " + + GENERATE_JSON_INCLUDE_ANNOTATIONS + " is true. " + "NONE emits no annotation, deferring fully to the global ObjectMapper inclusion policy."); optionalNonNullPropertyJsonIncludeOpt.addEnum("NON_NULL", "Omit the property when its value is null (default, spec-safe for non-nullable fields)."); optionalNonNullPropertyJsonIncludeOpt.addEnum("NON_EMPTY", "Omit the property when its value is null or considered empty."); @@ -336,10 +340,18 @@ public KotlinSpringServerCodegen() { cliOptions.add(optionalNonNullPropertyJsonIncludeOpt); addSwitch(GENERATE_JSON_INCLUDE_ANNOTATIONS, - "Whether to generate policy @JsonInclude annotations on model properties. When false, all " - + "automatic @JsonInclude annotations (required-field protection and the optional non-nullable policy) " - + "are omitted so the global ObjectMapper owns inclusion. A per-property override set via the " - + "`x-jackson-json-include-policy` vendor extension is still honored.", 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 " + + 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.", false); + addSwitch(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, @@ -762,12 +774,33 @@ public void processOpts() { if (additionalProperties.containsKey(GENERATE_JSON_INCLUDE_ANNOTATIONS)) { this.setGenerateJsonIncludeAnnotations(convertPropertyToBoolean(GENERATE_JSON_INCLUDE_ANNOTATIONS)); } - writePropertyBack(GENERATE_JSON_INCLUDE_ANNOTATIONS, generateJsonIncludeAnnotations); + writePropertyBack(GENERATE_JSON_INCLUDE_ANNOTATIONS, Boolean.TRUE.equals(generateJsonIncludeAnnotations)); + if (additionalProperties.containsKey(GENERATE_JSON_SETTER_NULLS_ANNOTATIONS)) { + this.setGenerateJsonSetterNullsAnnotations(convertPropertyToBoolean(GENERATE_JSON_SETTER_NULLS_ANNOTATIONS)); + } + writePropertyBack(GENERATE_JSON_SETTER_NULLS_ANNOTATIONS, Boolean.TRUE.equals(generateJsonSetterNullsAnnotations)); if (additionalProperties.containsKey(OPTIONAL_NON_NULL_PROPERTY_JSON_INCLUDE)) { this.setOptionalNonNullPropertyJsonInclude(additionalProperties.get(OPTIONAL_NON_NULL_PROPERTY_JSON_INCLUDE).toString()); } this.optionalNonNullPropertyJsonInclude = normalizeJsonIncludePolicy(this.optionalNonNullPropertyJsonInclude); writePropertyBack(OPTIONAL_NON_NULL_PROPERTY_JSON_INCLUDE, optionalNonNullPropertyJsonInclude); + if (generateJsonIncludeAnnotations == null) { + 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.", + GENERATE_JSON_INCLUDE_ANNOTATIONS, GENERATE_JSON_INCLUDE_ANNOTATIONS, + GENERATE_JSON_INCLUDE_ANNOTATIONS, OPTIONAL_NON_NULL_PROPERTY_JSON_INCLUDE); + } + if (generateJsonSetterNullsAnnotations == null) { + 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.", + GENERATE_JSON_SETTER_NULLS_ANNOTATIONS, GENERATE_JSON_SETTER_NULLS_ANNOTATIONS, + GENERATE_JSON_SETTER_NULLS_ANNOTATIONS); + } if (additionalProperties.containsKey(BEAN_QUALIFIERS) && library.equals(SPRING_BOOT)) { this.setBeanQualifiers(convertPropertyToBoolean(BEAN_QUALIFIERS)); @@ -1316,15 +1349,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. - // Scenario 3: optional + non-nullable → always emit @JsonSetter to handle explicit JSON nulls. + // Scenario 3: optional + non-nullable → emit @JsonSetter to handle explicit JSON nulls, only when + // generateJsonSetterNullsAnnotations is explicitly enabled. // When openApiNullable=true: Nulls.FAIL → reject explicit null (strict PATCH semantics). // When openApiNullable=false: Nulls.SKIP → silently ignore explicit null (lenient, protects defaults). - if (!property.required && !property.isNullable) { + if (Boolean.TRUE.equals(generateJsonSetterNullsAnnotations) && !property.required && !property.isNullable) { if (openApiNullable) { property.vendorExtensions.put("x-has-json-setter-nulls-fail", true); } else { @@ -1385,7 +1414,7 @@ private void resolveJsonIncludePolicy(CodegenModel model, CodegenProperty proper } return; } - if (!generateJsonIncludeAnnotations) { + if (!Boolean.TRUE.equals(generateJsonIncludeAnnotations)) { return; } String policy = null; @@ -1565,9 +1594,9 @@ 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 (Boolean.TRUE.equals(generateJsonSetterNullsAnnotations) && !var.required && !var.isNullable) { if (openApiNullable) { var.vendorExtensions.put("x-has-json-setter-nulls-fail", true); } else { 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 9c401db07d4a..0e766dbeb71d 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 @@ -125,6 +125,7 @@ public class SpringCodegen extends AbstractJavaCodegen public static final String CLIENT_REGISTRATION_ID = "clientRegistrationId"; 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"; /** * Universal per-property vendor extension holding the resolved Jackson {@code @JsonInclude} policy * (e.g. {@code NON_NULL}, {@code ALWAYS}). When absent, no {@code @JsonInclude} annotation is emitted. @@ -170,7 +171,9 @@ public enum RequestMappingMode { protected boolean useOptional = false; @Setter protected boolean useSealed = false; @Getter @Setter protected String optionalNonNullPropertyJsonInclude = "NON_NULL"; - @Getter @Setter protected boolean generateJsonIncludeAnnotations = true; + // Tri-state: null = unset (weak default + warning), Boolean.FALSE = weak (muted), Boolean.TRUE = strict emission. + @Getter @Setter protected Boolean generateJsonIncludeAnnotations = null; + @Getter @Setter protected Boolean generateJsonSetterNullsAnnotations = null; @Setter protected boolean virtualService = false; @Setter protected boolean hateoas = false; @Setter protected boolean returnSuccessCode = false; @@ -296,7 +299,8 @@ public SpringCodegen() { "Whether to generate sealed model interfaces and classes")); CliOption optionalNonNullPropertyJsonIncludeOpt = CliOption.newString(OPTIONAL_NON_NULL_PROPERTY_JSON_INCLUDE, - "The Jackson @JsonInclude policy emitted for optional, non-nullable model properties. " + "The Jackson @JsonInclude policy emitted for optional, non-nullable model properties when " + + GENERATE_JSON_INCLUDE_ANNOTATIONS + " is true. " + "NONE emits no annotation, deferring fully to the global ObjectMapper inclusion policy."); optionalNonNullPropertyJsonIncludeOpt.addEnum("NON_NULL", "Omit the property when its value is null (default, spec-safe for non-nullable fields)."); optionalNonNullPropertyJsonIncludeOpt.addEnum("NON_EMPTY", "Omit the property when its value is null or considered empty."); @@ -306,10 +310,18 @@ public SpringCodegen() { cliOptions.add(optionalNonNullPropertyJsonIncludeOpt); cliOptions.add(CliOption.newBoolean(GENERATE_JSON_INCLUDE_ANNOTATIONS, - "Whether to generate policy @JsonInclude annotations on model properties. When false, all " - + "automatic @JsonInclude annotations (required-field protection and the optional non-nullable policy) " - + "are omitted so the global ObjectMapper owns inclusion. A per-property override set via the " - + "`x-jackson-json-include-policy` vendor extension is still honored.", 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 " + + 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.", false)); + cliOptions.add(CliOption.newBoolean(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 @@ -585,11 +597,31 @@ public void processOpts() { convertPropertyToBooleanAndWriteBack(USE_SWAGGER_UI, this::setUseSwaggerUI); convertPropertyToBooleanAndWriteBack(USE_SEALED, this::setUseSealed); convertPropertyToBooleanAndWriteBack(GENERATE_JSON_INCLUDE_ANNOTATIONS, this::setGenerateJsonIncludeAnnotations); + convertPropertyToBooleanAndWriteBack(GENERATE_JSON_SETTER_NULLS_ANNOTATIONS, this::setGenerateJsonSetterNullsAnnotations); if (additionalProperties.containsKey(OPTIONAL_NON_NULL_PROPERTY_JSON_INCLUDE)) { this.setOptionalNonNullPropertyJsonInclude(additionalProperties.get(OPTIONAL_NON_NULL_PROPERTY_JSON_INCLUDE).toString()); } this.optionalNonNullPropertyJsonInclude = normalizeJsonIncludePolicy(this.optionalNonNullPropertyJsonInclude); additionalProperties.put(OPTIONAL_NON_NULL_PROPERTY_JSON_INCLUDE, optionalNonNullPropertyJsonInclude); + if (jackson) { + if (generateJsonIncludeAnnotations == null) { + 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.", + GENERATE_JSON_INCLUDE_ANNOTATIONS, GENERATE_JSON_INCLUDE_ANNOTATIONS, + GENERATE_JSON_INCLUDE_ANNOTATIONS, OPTIONAL_NON_NULL_PROPERTY_JSON_INCLUDE); + } + if (generateJsonSetterNullsAnnotations == null) { + 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.", + GENERATE_JSON_SETTER_NULLS_ANNOTATIONS, GENERATE_JSON_SETTER_NULLS_ANNOTATIONS, + GENERATE_JSON_SETTER_NULLS_ANNOTATIONS); + } + } if (DocumentationProvider.NONE.equals(getDocumentationProvider())) { this.setUseSwaggerUI(false); } @@ -1246,8 +1278,9 @@ public void postProcessModelProperty(CodegenModel model, CodegenProperty propert } // 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. - if (!property.required && !property.isNullable && !openApiNullable) { + // 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. + if (Boolean.TRUE.equals(generateJsonSetterNullsAnnotations) && !property.required && !property.isNullable && !openApiNullable) { property.vendorExtensions.put("x-has-json-setter-nulls-skip", true); model.imports.add("JsonSetter"); model.imports.add("Nulls"); @@ -1265,7 +1298,7 @@ public void postProcessModelProperty(CodegenModel model, CodegenProperty propert if (isJsonIncludePolicyEmitted(property.vendorExtensions.get(JSON_INCLUDE_POLICY_EXTENSION))) { model.imports.add("JsonInclude"); } - } else if (generateJsonIncludeAnnotations) { + } else if (Boolean.TRUE.equals(generateJsonIncludeAnnotations)) { String policy = null; if (property.required) { policy = property.isNullable ? "ALWAYS" : "NON_NULL"; 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 a3f5e136f066..7b1e63c40247 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 @@ -8312,8 +8312,25 @@ void optionalNullableField_withOpenApiNullable_hasNoJsonIncludeAnnotation() thro } /** - * Issue #24401: default matrix for JAVA-SPRING (openApiNullable=true). - * required non-nullable -> NON_NULL, required nullable -> ALWAYS, + * 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 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, "true")); + + Path modelFile = files.get("TestModel.java").toPath(); + assertFileNotContains(modelFile, "@JsonInclude("); + assertFileNotContains(modelFile, "@JsonSetter("); + } + + /** + * 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 @@ -8321,7 +8338,8 @@ 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", + SpringCodegen.GENERATE_JSON_INCLUDE_ANNOTATIONS, "true")); JavaFileAssert.assertThat(files.get("TestModel.java")) .assertProperty("requiredNonNullable").assertPropertyAnnotations() @@ -8334,9 +8352,30 @@ void jsonInclude_defaultMatrix() throws IOException { .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", + SpringCodegen.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: {@code optionalNonNullPropertyJsonInclude} changes the policy emitted for - * optional non-nullable properties. + * optional non-nullable properties (when {@code generateJsonIncludeAnnotations=true}). */ @Test void jsonInclude_optionalNonNullPolicy_nonEmpty() throws IOException { @@ -8344,6 +8383,7 @@ void jsonInclude_optionalNonNullPolicy_nonEmpty() throws IOException { "src/test/resources/3_0/kotlin/required-nullable-4-states.yaml", SPRING_BOOT, Map.of(CodegenConstants.OPENAPI_NULLABLE, "true", + SpringCodegen.GENERATE_JSON_INCLUDE_ANNOTATIONS, "true", SpringCodegen.OPTIONAL_NON_NULL_PROPERTY_JSON_INCLUDE, "NON_EMPTY")); JavaFileAssert.assertThat(files.get("TestModel.java")) @@ -8364,6 +8404,7 @@ void jsonInclude_optionalNonNullPolicy_none() throws IOException { "src/test/resources/3_0/kotlin/required-nullable-4-states.yaml", SPRING_BOOT, Map.of(CodegenConstants.OPENAPI_NULLABLE, "true", + SpringCodegen.GENERATE_JSON_INCLUDE_ANNOTATIONS, "true", SpringCodegen.OPTIONAL_NON_NULL_PROPERTY_JSON_INCLUDE, "NONE")); JavaFileAssert.assertThat(files.get("TestModel.java")) @@ -8422,7 +8463,8 @@ void jsonInclude_perSchemaImports() throws IOException { Map files = generateFromContract( "src/test/resources/3_0/spring/issue_24401_json_include_per_schema.yaml", SPRING_BOOT, - Map.of(CodegenConstants.OPENAPI_NULLABLE, "true")); + Map.of(CodegenConstants.OPENAPI_NULLABLE, "true", + SpringCodegen.GENERATE_JSON_INCLUDE_ANNOTATIONS, "true")); // required non-nullable -> @JsonInclude(NON_NULL); no setter machinery JavaFileAssert.assertThat(files.get("RequiredNonNullable.java")) @@ -8452,7 +8494,9 @@ void jsonInclude_perSchemaImports_withoutOpenApiNullable() throws IOException { Map files = generateFromContract( "src/test/resources/3_0/spring/issue_24401_json_include_per_schema.yaml", SPRING_BOOT, - Map.of(CodegenConstants.OPENAPI_NULLABLE, "false")); + Map.of(CodegenConstants.OPENAPI_NULLABLE, "false", + SpringCodegen.GENERATE_JSON_INCLUDE_ANNOTATIONS, "true", + SpringCodegen.GENERATE_JSON_SETTER_NULLS_ANNOTATIONS, "true")); // optional non-nullable -> @JsonInclude(NON_NULL) + @JsonSetter(Nulls.SKIP) JavaFileAssert.assertThat(files.get("OptionalNonNullable.java")) 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 079641006ed5..e05593f4cfc6 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 @@ -6540,7 +6540,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(KotlinSpringServerCodegen.GENERATE_JSON_INCLUDE_ANNOTATIONS, "true", + KotlinSpringServerCodegen.GENERATE_JSON_SETTER_NULLS_ANNOTATIONS, "true")); Path modelFile = files.get("TestModel.kt").toPath(); String content = Files.readString(modelFile); @@ -6570,7 +6571,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", + KotlinSpringServerCodegen.GENERATE_JSON_INCLUDE_ANNOTATIONS, "true", + KotlinSpringServerCodegen.GENERATE_JSON_SETTER_NULLS_ANNOTATIONS, "true")); Path modelFile = files.get("TestModel.kt").toPath(); String content = Files.readString(modelFile); @@ -6598,7 +6601,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(KotlinSpringServerCodegen.GENERATE_JSON_INCLUDE_ANNOTATIONS, "true", + KotlinSpringServerCodegen.GENERATE_JSON_SETTER_NULLS_ANNOTATIONS, "true")); Path modelFile = files.get("TestModel.kt").toPath(); String content = Files.readString(modelFile); @@ -6674,6 +6678,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(KotlinSpringServerCodegen.GENERATE_JSON_SETTER_NULLS_ANNOTATIONS, "true"); Map files = generateFromContract( "src/test/resources/3_0/kotlin/required-nullable-4-states.yaml", props); @@ -6706,6 +6711,21 @@ public void requiredNullable_scenario4_optionalNullable_hasNoJsonIncludeAnnotati 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. @@ -6714,7 +6734,7 @@ public void requiredNullable_scenario4_optionalNullable_hasNoJsonIncludeAnnotati public void jsonInclude_kotlinMatrix_default() throws IOException { Map files = generateFromContract( "src/test/resources/3_0/kotlin/required-nullable-4-states.yaml", - new HashMap<>()); + Map.of(KotlinSpringServerCodegen.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)"), @@ -6735,7 +6755,8 @@ public void jsonInclude_kotlinMatrix_default() throws IOException { public void jsonInclude_optionalNonNullPolicy_none() throws IOException { Map files = generateFromContract( "src/test/resources/3_0/kotlin/required-nullable-4-states.yaml", - Map.of(KotlinSpringServerCodegen.OPTIONAL_NON_NULL_PROPERTY_JSON_INCLUDE, "NONE")); + Map.of(KotlinSpringServerCodegen.GENERATE_JSON_INCLUDE_ANNOTATIONS, "true", + KotlinSpringServerCodegen.OPTIONAL_NON_NULL_PROPERTY_JSON_INCLUDE, "NONE")); String content = Files.readString(files.get("TestModel.kt").toPath()); Assert.assertFalse(jsonIncludeBlockFor(content, "optionalNonNullable").contains("@field:JsonInclude"), @@ -6798,7 +6819,9 @@ public void jsonInclude_perSchemaImports() throws IOException { Map files = generateFromContract( "src/test/resources/3_0/spring/issue_24401_json_include_per_schema.yaml", - Map.of(CodegenConstants.OPENAPI_NULLABLE, "true")); + Map.of(CodegenConstants.OPENAPI_NULLABLE, "true", + KotlinSpringServerCodegen.GENERATE_JSON_INCLUDE_ANNOTATIONS, "true", + KotlinSpringServerCodegen.GENERATE_JSON_SETTER_NULLS_ANNOTATIONS, "true")); // required non-nullable -> @field:JsonInclude(ALWAYS); no setter/nullable machinery Path requiredNonNullable = files.get("RequiredNonNullable.kt").toPath(); @@ -7143,6 +7166,7 @@ public void testIssue24139NullableRefNoJsonSetterNullsFail() throws IOException Map additionalProperties = new HashMap<>(); additionalProperties.put("useBeanValidation", true); additionalProperties.put("openApiNullable", "true"); + additionalProperties.put(KotlinSpringServerCodegen.GENERATE_JSON_SETTER_NULLS_ANNOTATIONS, "true"); Map files = generateFromContract( "src/test/resources/3_1/issue_24139.yaml", From 36ddf95271b9f21de49110c5eb2025652fd3a7dc Mon Sep 17 00:00:00 2001 From: Jachym Metlicka Date: Fri, 24 Jul 2026 15:34:58 +0200 Subject: [PATCH 05/12] docs(migration-guide): update migration guide for Jackson annotations changes in 7.25.0 --- docs/migration-guide.adoc | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/docs/migration-guide.adoc b/docs/migration-guide.adoc index 591aebe82c91..d8cde8b16713 100644 --- a/docs/migration-guide.adoc +++ b/docs/migration-guide.adoc @@ -11,6 +11,38 @@ 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 + +`@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. From cf57992f96becd773804630f49022c7a5a331cc3 Mon Sep 17 00:00:00 2001 From: Jachym Metlicka Date: Fri, 24 Jul 2026 15:35:13 +0200 Subject: [PATCH 06/12] Revert "update documentation" This reverts commit ed876b9395fffa557c208d1053999ee1a31a048a. --- docs/generators/java-camel.md | 2 -- docs/generators/kotlin-spring.md | 2 -- docs/generators/spring.md | 2 -- 3 files changed, 6 deletions(-) diff --git a/docs/generators/java-camel.md b/docs/generators/java-camel.md index 97c2304f5b83..2e2d5191f02f 100644 --- a/docs/generators/java-camel.md +++ b/docs/generators/java-camel.md @@ -64,7 +64,6 @@ 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 false, all automatic @JsonInclude annotations (required-field protection and the optional non-nullable policy) are omitted so the global ObjectMapper owns inclusion. A per-property override set via the `x-jackson-json-include-policy` vendor extension is still honored.| |true| |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| @@ -84,7 +83,6 @@ 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. 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| diff --git a/docs/generators/kotlin-spring.md b/docs/generators/kotlin-spring.md index 54d80c1ea7b1..f42388d53000 100644 --- a/docs/generators/kotlin-spring.md +++ b/docs/generators/kotlin-spring.md @@ -33,7 +33,6 @@ 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 false, all automatic @JsonInclude annotations (required-field protection and the optional non-nullable policy) are omitted so the global ObjectMapper owns inclusion. A per-property override set via the `x-jackson-json-include-policy` vendor extension is still honored.| |true| |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| @@ -45,7 +44,6 @@ 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. 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| diff --git a/docs/generators/spring.md b/docs/generators/spring.md index 194a1c7a1b40..31f5f55ff4a5 100644 --- a/docs/generators/spring.md +++ b/docs/generators/spring.md @@ -57,7 +57,6 @@ 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 false, all automatic @JsonInclude annotations (required-field protection and the optional non-nullable policy) are omitted so the global ObjectMapper owns inclusion. A per-property override set via the `x-jackson-json-include-policy` vendor extension is still honored.| |true| |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| @@ -77,7 +76,6 @@ 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. 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| From d34ea7ee16321264f2e1b5d472ab9471d79354bb Mon Sep 17 00:00:00 2001 From: Jachym Metlicka Date: Fri, 24 Jul 2026 15:35:14 +0200 Subject: [PATCH 07/12] Revert "update samples and documentation" This reverts commit 6408e37698c48e204dc52ff8325a3e0bba23e1a9. --- .../src/main/java/org/openapitools/model/Pet.java | 1 - .../src/main/java/org/openapitools/model/Pet.java | 2 -- .../src/main/java/org/openapitools/model/Pet.java | 2 -- .../src/main/java/org/openapitools/model/Pet.java | 2 -- .../src/main/java/org/openapitools/model/Pet.java | 2 -- .../model/AdditionalPropertiesClassDto.java | 1 + .../main/java/org/openapitools/model/AnimalDto.java | 1 - .../main/java/org/openapitools/model/CategoryDto.java | 1 - .../openapitools/model/ContainerDefaultValueDto.java | 4 ++-- .../main/java/org/openapitools/model/EnumTestDto.java | 1 - .../java/org/openapitools/model/FormatTestDto.java | 4 ---- .../src/main/java/org/openapitools/model/NameDto.java | 1 - .../org/openapitools/model/NullableMapPropertyDto.java | 2 ++ .../org/openapitools/model/ParentWithNullableDto.java | 1 + .../src/main/java/org/openapitools/model/PetDto.java | 2 -- .../org/openapitools/model/TypeHolderDefaultDto.java | 6 ------ .../org/openapitools/model/TypeHolderExampleDto.java | 7 ------- .../model/AdditionalPropertiesClassDto.java | 1 + .../main/java/org/openapitools/model/AnimalDto.java | 1 - .../main/java/org/openapitools/model/CategoryDto.java | 1 - .../openapitools/model/ContainerDefaultValueDto.java | 4 ++-- .../main/java/org/openapitools/model/EnumTestDto.java | 1 - .../java/org/openapitools/model/FormatTestDto.java | 4 ---- .../src/main/java/org/openapitools/model/NameDto.java | 1 - .../org/openapitools/model/NullableMapPropertyDto.java | 2 ++ .../org/openapitools/model/ParentWithNullableDto.java | 1 + .../src/main/java/org/openapitools/model/PetDto.java | 2 -- .../org/openapitools/model/TypeHolderDefaultDto.java | 6 ------ .../org/openapitools/model/TypeHolderExampleDto.java | 7 ------- .../src/main/java/org/openapitools/model/PetDto.java | 2 -- .../openapitools/model/AdditionalPropertiesClass.java | 1 + .../src/main/java/org/openapitools/model/Animal.java | 1 - .../src/main/java/org/openapitools/model/Category.java | 1 - .../org/openapitools/model/ContainerDefaultValue.java | 4 ++-- .../src/main/java/org/openapitools/model/EnumTest.java | 1 - .../main/java/org/openapitools/model/FormatTest.java | 4 ---- .../src/main/java/org/openapitools/model/Name.java | 1 - .../org/openapitools/model/NullableMapProperty.java | 2 ++ .../org/openapitools/model/ParentWithNullable.java | 1 + .../src/main/java/org/openapitools/model/Pet.java | 2 -- .../java/org/openapitools/model/TypeHolderDefault.java | 6 ------ .../java/org/openapitools/model/TypeHolderExample.java | 7 ------- .../openapitools/model/AdditionalPropertiesClass.java | 1 + .../src/main/java/org/openapitools/model/Animal.java | 1 - .../src/main/java/org/openapitools/model/Category.java | 1 - .../org/openapitools/model/ContainerDefaultValue.java | 4 ++-- .../src/main/java/org/openapitools/model/EnumTest.java | 1 - .../main/java/org/openapitools/model/FormatTest.java | 4 ---- .../src/main/java/org/openapitools/model/Name.java | 1 - .../org/openapitools/model/NullableMapProperty.java | 2 ++ .../org/openapitools/model/ParentWithNullable.java | 1 + .../src/main/java/org/openapitools/model/Pet.java | 2 -- .../java/org/openapitools/model/TypeHolderDefault.java | 6 ------ .../java/org/openapitools/model/TypeHolderExample.java | 7 ------- .../openapitools/model/AdditionalPropertiesClass.java | 1 + .../src/main/java/org/openapitools/model/Animal.java | 1 - .../src/main/java/org/openapitools/model/Category.java | 1 - .../org/openapitools/model/ContainerDefaultValue.java | 4 ++-- .../src/main/java/org/openapitools/model/EnumTest.java | 1 - .../main/java/org/openapitools/model/FormatTest.java | 4 ---- .../src/main/java/org/openapitools/model/Name.java | 1 - .../org/openapitools/model/NullableMapProperty.java | 2 ++ .../org/openapitools/model/ParentWithNullable.java | 1 + .../src/main/java/org/openapitools/model/Pet.java | 2 -- .../java/org/openapitools/model/TypeHolderDefault.java | 6 ------ .../java/org/openapitools/model/TypeHolderExample.java | 7 ------- .../main/java/org/openapitools/model/AnimalDto.java | 1 - .../main/java/org/openapitools/model/CategoryDto.java | 1 - .../openapitools/model/ContainerDefaultValueDto.java | 3 --- .../main/java/org/openapitools/model/EnumTestDto.java | 1 - .../java/org/openapitools/model/FormatTestDto.java | 4 ---- .../src/main/java/org/openapitools/model/NameDto.java | 1 - .../src/main/java/org/openapitools/model/PetDto.java | 2 -- .../org/openapitools/model/TypeHolderDefaultDto.java | 6 ------ .../org/openapitools/model/TypeHolderExampleDto.java | 7 ------- .../openapitools/model/AdditionalPropertiesClass.java | 1 + .../src/main/java/org/openapitools/model/Animal.java | 1 - .../src/main/java/org/openapitools/model/Category.java | 1 - .../org/openapitools/model/ContainerDefaultValue.java | 4 ++-- .../src/main/java/org/openapitools/model/EnumTest.java | 1 - .../main/java/org/openapitools/model/FormatTest.java | 4 ---- .../src/main/java/org/openapitools/model/Name.java | 1 - .../org/openapitools/model/NullableMapProperty.java | 2 ++ .../org/openapitools/model/ParentWithNullable.java | 1 + .../src/main/java/org/openapitools/model/Pet.java | 2 -- .../java/org/openapitools/model/TypeHolderDefault.java | 6 ------ .../java/org/openapitools/model/TypeHolderExample.java | 7 ------- .../model/AdditionalPropertiesClassDto.java | 1 + .../main/java/org/openapitools/model/AnimalDto.java | 1 - .../main/java/org/openapitools/model/CategoryDto.java | 1 - .../openapitools/model/ContainerDefaultValueDto.java | 4 ++-- .../main/java/org/openapitools/model/EnumTestDto.java | 1 - .../java/org/openapitools/model/FormatTestDto.java | 4 ---- .../src/main/java/org/openapitools/model/NameDto.java | 1 - .../org/openapitools/model/NullableMapPropertyDto.java | 2 ++ .../org/openapitools/model/ParentWithNullableDto.java | 1 + .../src/main/java/org/openapitools/model/PetDto.java | 2 -- .../org/openapitools/model/TypeHolderDefaultDto.java | 6 ------ .../org/openapitools/model/TypeHolderExampleDto.java | 7 ------- .../src/main/java/org/openapitools/model/Pet.java | 2 -- .../src/main/java/org/openapitools/model/Pet.java | 2 -- .../src/main/java/org/openapitools/model/Pet.java | 2 -- .../src/main/java/org/openapitools/model/Pet.java | 2 -- .../src/main/java/org/openapitools/model/Pet.java | 1 - .../src/main/java/org/openapitools/model/Pet.java | 2 -- .../openapitools/model/AdditionalPropertiesClass.java | 1 + .../src/main/java/org/openapitools/model/Animal.java | 1 - .../src/main/java/org/openapitools/model/Category.java | 1 - .../org/openapitools/model/ContainerDefaultValue.java | 4 ++-- .../src/main/java/org/openapitools/model/EnumTest.java | 1 - .../main/java/org/openapitools/model/FormatTest.java | 4 ---- .../src/main/java/org/openapitools/model/Name.java | 1 - .../org/openapitools/model/NullableMapProperty.java | 2 ++ .../org/openapitools/model/ParentWithNullable.java | 1 + .../src/main/java/org/openapitools/model/Pet.java | 2 -- .../java/org/openapitools/model/TypeHolderDefault.java | 6 ------ .../java/org/openapitools/model/TypeHolderExample.java | 7 ------- .../src/main/java/org/openapitools/model/Pet.java | 2 -- .../src/main/java/org/openapitools/model/Pet.java | 2 -- .../src/main/java/org/openapitools/model/Pet.java | 2 -- .../src/main/java/org/openapitools/model/Pet.java | 2 -- .../src/main/java/org/openapitools/model/Apple.java | 3 --- .../src/main/java/org/openapitools/model/Banana.java | 3 --- .../src/main/java/org/openapitools/model/Bar.java | 1 - .../src/main/java/org/openapitools/model/Entity.java | 1 - .../main/java/org/openapitools/model/EntityRef.java | 1 - .../main/java/org/openapitools/model/Extensible.java | 1 - .../src/main/java/org/openapitools/model/Fruit.java | 1 - .../src/main/java/org/openapitools/model/Apple.java | 3 --- .../src/main/java/org/openapitools/model/Banana.java | 3 --- .../src/main/java/org/openapitools/model/Bar.java | 1 - .../src/main/java/org/openapitools/model/Entity.java | 1 - .../main/java/org/openapitools/model/EntityRef.java | 1 - .../main/java/org/openapitools/model/Extensible.java | 1 - .../src/main/java/org/openapitools/model/Fruit.java | 1 - .../src/main/java/org/openapitools/model/Apple.java | 3 --- .../src/main/java/org/openapitools/model/Banana.java | 3 --- .../src/main/java/org/openapitools/model/Bar.java | 1 - .../src/main/java/org/openapitools/model/Entity.java | 1 - .../main/java/org/openapitools/model/EntityRef.java | 1 - .../main/java/org/openapitools/model/Extensible.java | 1 - .../src/main/java/org/openapitools/model/Fruit.java | 1 - .../src/main/java/org/openapitools/model/Pet.java | 2 -- .../src/main/java/org/openapitools/model/Pet.java | 2 -- .../src/main/java/org/openapitools/model/Pet.java | 2 -- .../src/main/java/org/openapitools/model/Foo.java | 1 - .../src/main/java/org/openapitools/model/Pet.java | 2 -- .../openapitools/model/AdditionalPropertiesClass.java | 1 + .../src/main/java/org/openapitools/model/Animal.java | 1 - .../src/main/java/org/openapitools/model/Category.java | 1 - .../org/openapitools/model/ContainerDefaultValue.java | 4 ++-- .../src/main/java/org/openapitools/model/EnumTest.java | 1 - .../main/java/org/openapitools/model/FormatTest.java | 4 ---- .../src/main/java/org/openapitools/model/Name.java | 1 - .../org/openapitools/model/NullableMapProperty.java | 2 ++ .../org/openapitools/model/ParentWithNullable.java | 1 + .../src/main/java/org/openapitools/model/Pet.java | 2 -- .../java/org/openapitools/model/TypeHolderDefault.java | 6 ------ .../java/org/openapitools/model/TypeHolderExample.java | 7 ------- .../openapitools/model/AdditionalPropertiesClass.java | 1 + .../src/main/java/org/openapitools/model/Animal.java | 1 - .../src/main/java/org/openapitools/model/Category.java | 1 - .../org/openapitools/model/ContainerDefaultValue.java | 4 ++-- .../src/main/java/org/openapitools/model/EnumTest.java | 1 - .../main/java/org/openapitools/model/FormatTest.java | 4 ---- .../src/main/java/org/openapitools/model/Name.java | 1 - .../org/openapitools/model/NullableMapProperty.java | 2 ++ .../org/openapitools/model/ParentWithNullable.java | 1 + .../src/main/java/org/openapitools/model/Pet.java | 2 -- .../java/org/openapitools/model/TypeHolderDefault.java | 6 ------ .../java/org/openapitools/model/TypeHolderExample.java | 7 ------- .../src/main/java/org/openapitools/model/Pet.java | 2 -- .../src/main/java/org/openapitools/model/Pet.java | 2 -- .../src/main/kotlin/org/openapitools/model/Cat.kt | 2 -- .../src/main/kotlin/org/openapitools/model/Dog.kt | 3 --- .../src/main/kotlin/org/openapitools/model/Pet.kt | 1 - .../src/main/kotlin/org/openapitools/model/Bird.kt | 2 -- .../src/main/kotlin/org/openapitools/model/Robobird.kt | 2 -- .../src/main/kotlin/org/openapitools/model/Car.kt | 3 --- .../src/main/kotlin/org/openapitools/model/Truck.kt | 3 --- .../src/main/kotlin/org/openapitools/model/Vehicle.kt | 1 - .../src/main/kotlin/org/openapitools/model/Pet.kt | 2 -- .../src/main/kotlin/org/openapitools/model/Pet.kt | 2 -- .../src/main/kotlin/org/openapitools/model/Pet.kt | 2 -- .../src/main/kotlin/org/openapitools/model/Pet.kt | 2 -- .../src/main/kotlin/org/openapitools/model/Pet.kt | 2 -- .../src/main/kotlin/org/openapitools/model/Pet.kt | 2 -- .../kotlin/org/openapitools/model/AnyOfUserOrPet.kt | 3 --- .../openapitools/model/AnyOfUserOrPetOrArrayString.kt | 3 --- .../src/main/kotlin/org/openapitools/model/Pet.kt | 2 -- .../src/main/kotlin/org/openapitools/model/User.kt | 1 - .../src/main/kotlin/org/openapitools/model/Pet.kt | 2 -- .../src/main/kotlin/org/openapitools/model/Pet.kt | 2 -- .../src/main/kotlin/org/openapitools/model/Pet.kt | 2 -- .../src/main/kotlin/org/openapitools/model/Pet.kt | 2 -- .../src/main/kotlin/org/openapitools/model/Pet.kt | 2 -- .../src/main/kotlin/org/openapitools/model/Apa.kt | 2 -- .../src/main/kotlin/org/openapitools/model/Pet.kt | 2 -- .../src/main/kotlin/org/openapitools/model/Pet.kt | 2 -- .../src/main/kotlin/org/openapitools/model/Cat.kt | 3 --- .../src/main/kotlin/org/openapitools/model/Dog.kt | 6 ------ .../src/main/kotlin/org/openapitools/model/ApiError.kt | 1 - .../src/main/kotlin/org/openapitools/model/Pet.kt | 2 -- .../src/main/kotlin/org/openapitools/model/Pet.kt | 2 -- .../src/main/kotlin/org/openapitools/model/Pet.kt | 2 -- .../src/main/kotlin/org/openapitools/model/PageMeta.kt | 5 ----- .../src/main/kotlin/org/openapitools/model/Pet.kt | 1 - .../src/main/kotlin/org/openapitools/model/Pet.kt | 2 -- .../src/main/kotlin/org/openapitools/model/Pet.kt | 2 -- .../src/main/kotlin/org/openapitools/model/Cat.kt | 1 - .../src/main/kotlin/org/openapitools/model/Category.kt | 1 - .../src/main/kotlin/org/openapitools/model/Dog.kt | 1 - .../src/main/kotlin/org/openapitools/model/Pet.kt | 2 -- .../kotlin/org/openapitools/model/NullableModel.kt | 3 +-- .../src/main/kotlin/org/openapitools/model/Pet.kt | 1 - .../src/main/kotlin/org/openapitools/model/Pet.kt | 2 -- .../src/main/kotlin/org/openapitools/model/Pet.kt | 2 -- .../src/main/kotlin/org/openapitools/model/Cat.kt | 3 --- .../src/main/kotlin/org/openapitools/model/Dog.kt | 6 ------ .../src/main/kotlin/org/openapitools/model/Pet.kt | 2 -- .../openapitools/model/AdditionalPropertiesClass.java | 1 + .../src/main/java/org/openapitools/model/Animal.java | 1 - .../src/main/java/org/openapitools/model/Category.java | 1 - .../org/openapitools/model/ContainerDefaultValue.java | 4 ++-- .../src/main/java/org/openapitools/model/EnumTest.java | 1 - .../main/java/org/openapitools/model/FormatTest.java | 4 ---- .../src/main/java/org/openapitools/model/Name.java | 1 - .../org/openapitools/model/NullableMapProperty.java | 2 ++ .../org/openapitools/model/ParentWithNullable.java | 1 + .../src/main/java/org/openapitools/model/Pet.java | 2 -- .../java/org/openapitools/model/TypeHolderDefault.java | 6 ------ .../java/org/openapitools/model/TypeHolderExample.java | 7 ------- .../org/openapitools/model/ObjectWithUniqueItems.java | 2 ++ .../src/main/java/org/openapitools/model/Animal.java | 1 - .../src/main/java/org/openapitools/model/Category.java | 1 - .../org/openapitools/model/ContainerDefaultValue.java | 3 --- .../src/main/java/org/openapitools/model/EnumTest.java | 1 - .../main/java/org/openapitools/model/FormatTest.java | 4 ---- .../src/main/java/org/openapitools/model/Name.java | 1 - .../src/main/java/org/openapitools/model/Pet.java | 2 -- .../java/org/openapitools/model/TypeHolderDefault.java | 6 ------ .../java/org/openapitools/model/TypeHolderExample.java | 7 ------- .../openapitools/model/AdditionalPropertiesClass.java | 1 + .../src/main/java/org/openapitools/model/Animal.java | 1 - .../src/main/java/org/openapitools/model/Category.java | 1 - .../org/openapitools/model/ContainerDefaultValue.java | 4 ++-- .../src/main/java/org/openapitools/model/EnumTest.java | 1 - .../main/java/org/openapitools/model/FormatTest.java | 4 ---- .../src/main/java/org/openapitools/model/Name.java | 1 - .../org/openapitools/model/NullableMapProperty.java | 2 ++ .../org/openapitools/model/ParentWithNullable.java | 1 + .../src/main/java/org/openapitools/model/Pet.java | 2 -- .../java/org/openapitools/model/TypeHolderDefault.java | 6 ------ .../java/org/openapitools/model/TypeHolderExample.java | 7 ------- .../openapitools/model/AdditionalPropertiesClass.java | 1 + .../src/main/java/org/openapitools/model/Animal.java | 1 - .../src/main/java/org/openapitools/model/Category.java | 1 - .../org/openapitools/model/ContainerDefaultValue.java | 4 ++-- .../src/main/java/org/openapitools/model/EnumTest.java | 1 - .../main/java/org/openapitools/model/FormatTest.java | 4 ---- .../src/main/java/org/openapitools/model/Name.java | 1 - .../org/openapitools/model/NullableMapProperty.java | 2 ++ .../org/openapitools/model/ParentWithNullable.java | 1 + .../src/main/java/org/openapitools/model/Pet.java | 2 -- .../java/org/openapitools/model/TypeHolderDefault.java | 6 ------ .../java/org/openapitools/model/TypeHolderExample.java | 7 ------- .../openapitools/model/AdditionalPropertiesClass.java | 1 + .../src/main/java/org/openapitools/model/Animal.java | 1 - .../src/main/java/org/openapitools/model/Category.java | 1 - .../org/openapitools/model/ContainerDefaultValue.java | 4 ++-- .../src/main/java/org/openapitools/model/EnumTest.java | 1 - .../main/java/org/openapitools/model/FormatTest.java | 4 ---- .../src/main/java/org/openapitools/model/Name.java | 1 - .../org/openapitools/model/NullableMapProperty.java | 2 ++ .../org/openapitools/model/ParentWithNullable.java | 1 + .../src/main/java/org/openapitools/model/Pet.java | 2 -- .../java/org/openapitools/model/TypeHolderDefault.java | 6 ------ .../java/org/openapitools/model/TypeHolderExample.java | 7 ------- .../src/main/java/org/openapitools/model/Pet.java | 2 -- .../openapitools/model/AdditionalPropertiesClass.java | 1 + .../src/main/java/org/openapitools/model/Animal.java | 1 - .../src/main/java/org/openapitools/model/Category.java | 1 - .../org/openapitools/model/ContainerDefaultValue.java | 4 ++-- .../src/main/java/org/openapitools/model/EnumTest.java | 1 - .../main/java/org/openapitools/model/FormatTest.java | 4 ---- .../src/main/java/org/openapitools/model/Name.java | 1 - .../org/openapitools/model/NullableMapProperty.java | 2 ++ .../org/openapitools/model/ParentWithNullable.java | 1 + .../src/main/java/org/openapitools/model/Pet.java | 2 -- .../java/org/openapitools/model/TypeHolderDefault.java | 6 ------ .../java/org/openapitools/model/TypeHolderExample.java | 7 ------- .../src/main/java/org/openapitools/model/Pet.java | 2 -- .../openapitools/model/AdditionalPropertiesClass.java | 1 + .../src/main/java/org/openapitools/model/Animal.java | 1 - .../src/main/java/org/openapitools/model/Category.java | 1 - .../org/openapitools/model/ContainerDefaultValue.java | 4 ++-- .../src/main/java/org/openapitools/model/EnumTest.java | 1 - .../main/java/org/openapitools/model/FormatTest.java | 4 ---- .../src/main/java/org/openapitools/model/Name.java | 1 - .../org/openapitools/model/NullableMapProperty.java | 2 ++ .../org/openapitools/model/ParentWithNullable.java | 1 + .../src/main/java/org/openapitools/model/Pet.java | 2 -- .../java/org/openapitools/model/TypeHolderDefault.java | 6 ------ .../java/org/openapitools/model/TypeHolderExample.java | 7 ------- .../model/AdditionalPropertiesClassDto.java | 1 + .../main/java/org/openapitools/model/AnimalDto.java | 1 - .../main/java/org/openapitools/model/CategoryDto.java | 1 - .../openapitools/model/ContainerDefaultValueDto.java | 4 ++-- .../main/java/org/openapitools/model/EnumTestDto.java | 1 - .../java/org/openapitools/model/FormatTestDto.java | 4 ---- .../src/main/java/org/openapitools/model/NameDto.java | 1 - .../org/openapitools/model/NullableMapPropertyDto.java | 2 ++ .../org/openapitools/model/ParentWithNullableDto.java | 1 + .../src/main/java/org/openapitools/model/PetDto.java | 2 -- .../org/openapitools/model/TypeHolderDefaultDto.java | 6 ------ .../org/openapitools/model/TypeHolderExampleDto.java | 7 ------- .../src/main/java/org/openapitools/model/Pet.java | 2 -- .../src/main/java/org/openapitools/model/Pet.java | 2 -- .../src/main/java/org/openapitools/model/PageMeta.java | 5 ----- .../src/main/java/org/openapitools/model/Pet.java | 1 - .../src/main/java/org/openapitools/model/Pet.java | 2 -- .../openapitools/model/AdditionalPropertiesClass.java | 1 + .../src/main/java/org/openapitools/model/Animal.java | 1 - .../src/main/java/org/openapitools/model/Category.java | 1 - .../org/openapitools/model/ContainerDefaultValue.java | 4 ++-- .../src/main/java/org/openapitools/model/EnumTest.java | 1 - .../main/java/org/openapitools/model/FormatTest.java | 4 ---- .../src/main/java/org/openapitools/model/Name.java | 1 - .../org/openapitools/model/NullableMapProperty.java | 2 ++ .../org/openapitools/model/ParentWithNullable.java | 1 + .../src/main/java/org/openapitools/model/Pet.java | 2 -- .../java/org/openapitools/model/TypeHolderDefault.java | 6 ------ .../java/org/openapitools/model/TypeHolderExample.java | 7 ------- .../openapitools/model/AdditionalPropertiesClass.java | 1 + .../src/main/java/org/openapitools/model/Animal.java | 1 - .../src/main/java/org/openapitools/model/Category.java | 1 - .../org/openapitools/model/ContainerDefaultValue.java | 4 ++-- .../src/main/java/org/openapitools/model/EnumTest.java | 1 - .../main/java/org/openapitools/model/FormatTest.java | 4 ---- .../src/main/java/org/openapitools/model/Name.java | 1 - .../org/openapitools/model/NullableMapProperty.java | 2 ++ .../org/openapitools/model/ParentWithNullable.java | 1 + .../src/main/java/org/openapitools/model/Pet.java | 2 -- .../java/org/openapitools/model/TypeHolderDefault.java | 6 ------ .../java/org/openapitools/model/TypeHolderExample.java | 7 ------- .../java/org/openapitools/model/NullableModel.java | 3 +-- .../src/main/java/org/openapitools/model/Pet.java | 1 - .../src/main/java/org/openapitools/model/Animal.java | 1 - .../src/main/java/org/openapitools/model/Category.java | 1 - .../src/main/java/org/openapitools/model/EnumTest.java | 1 - .../main/java/org/openapitools/model/FormatTest.java | 4 ---- .../src/main/java/org/openapitools/model/Name.java | 1 - .../src/main/java/org/openapitools/model/Pet.java | 2 -- .../java/org/openapitools/model/TypeHolderDefault.java | 6 ------ .../java/org/openapitools/model/TypeHolderExample.java | 7 ------- .../src/main/java/org/openapitools/model/Animal.java | 1 - .../src/main/java/org/openapitools/model/Category.java | 1 - .../src/main/java/org/openapitools/model/EnumTest.java | 1 - .../main/java/org/openapitools/model/FormatTest.java | 4 ---- .../src/main/java/org/openapitools/model/Name.java | 1 - .../src/main/java/org/openapitools/model/Pet.java | 2 -- .../java/org/openapitools/model/TypeHolderDefault.java | 6 ------ .../java/org/openapitools/model/TypeHolderExample.java | 7 ------- .../src/main/java/org/openapitools/model/Animal.java | 1 - .../src/main/java/org/openapitools/model/Category.java | 1 - .../src/main/java/org/openapitools/model/EnumTest.java | 1 - .../main/java/org/openapitools/model/FormatTest.java | 4 ---- .../src/main/java/org/openapitools/model/Name.java | 1 - .../src/main/java/org/openapitools/model/Pet.java | 2 -- .../java/org/openapitools/model/TypeHolderDefault.java | 6 ------ .../java/org/openapitools/model/TypeHolderExample.java | 7 ------- .../src/main/java/org/openapitools/model/Animal.java | 1 - .../src/main/java/org/openapitools/model/Category.java | 1 - .../src/main/java/org/openapitools/model/EnumTest.java | 1 - .../main/java/org/openapitools/model/FormatTest.java | 4 ---- .../src/main/java/org/openapitools/model/Name.java | 1 - .../src/main/java/org/openapitools/model/Pet.java | 2 -- .../java/org/openapitools/model/TypeHolderDefault.java | 6 ------ .../java/org/openapitools/model/TypeHolderExample.java | 7 ------- .../src/main/java/org/openapitools/model/Pet.java | 2 -- .../openapitools/model/AdditionalPropertiesClass.java | 1 + .../src/main/java/org/openapitools/model/Animal.java | 1 - .../src/main/java/org/openapitools/model/Category.java | 1 - .../org/openapitools/model/ContainerDefaultValue.java | 4 ++-- .../src/main/java/org/openapitools/model/EnumTest.java | 1 - .../main/java/org/openapitools/model/FormatTest.java | 4 ---- .../src/main/java/org/openapitools/model/Name.java | 1 - .../org/openapitools/model/NullableMapProperty.java | 2 ++ .../org/openapitools/model/ParentWithNullable.java | 1 + .../src/main/java/org/openapitools/model/Pet.java | 2 -- .../java/org/openapitools/model/TypeHolderDefault.java | 6 ------ .../java/org/openapitools/model/TypeHolderExample.java | 7 ------- .../virtualan/model/AdditionalPropertiesClass.java | 1 + .../java/org/openapitools/virtualan/model/Animal.java | 1 - .../org/openapitools/virtualan/model/Category.java | 1 - .../virtualan/model/ContainerDefaultValue.java | 4 ++-- .../org/openapitools/virtualan/model/EnumTest.java | 1 - .../org/openapitools/virtualan/model/FormatTest.java | 4 ---- .../java/org/openapitools/virtualan/model/Name.java | 1 - .../virtualan/model/NullableMapProperty.java | 2 ++ .../virtualan/model/ParentWithNullable.java | 1 + .../java/org/openapitools/virtualan/model/Pet.java | 2 -- .../virtualan/model/TypeHolderDefault.java | 6 ------ .../virtualan/model/TypeHolderExample.java | 7 ------- .../main/java/org/openapitools/model/AnimalDto.java | 1 - .../main/java/org/openapitools/model/CategoryDto.java | 1 - .../main/java/org/openapitools/model/EnumTestDto.java | 2 +- .../java/org/openapitools/model/FormatTestDto.java | 4 ---- .../org/openapitools/model/HealthCheckResultDto.java | 2 ++ .../src/main/java/org/openapitools/model/NameDto.java | 1 - .../java/org/openapitools/model/NullableClassDto.java | 10 ++++++++++ .../model/OuterObjectWithEnumPropertyDto.java | 2 -- .../org/openapitools/model/ParentWithNullableDto.java | 1 + .../src/main/java/org/openapitools/model/PetDto.java | 2 -- .../model/AdditionalPropertiesClassDto.java | 1 + .../main/java/org/openapitools/model/AnimalDto.java | 1 - .../main/java/org/openapitools/model/CategoryDto.java | 1 - .../openapitools/model/ContainerDefaultValueDto.java | 4 ++-- .../main/java/org/openapitools/model/EnumTestDto.java | 1 - .../java/org/openapitools/model/FormatTestDto.java | 4 ---- .../src/main/java/org/openapitools/model/NameDto.java | 1 - .../org/openapitools/model/NullableMapPropertyDto.java | 2 ++ .../org/openapitools/model/ParentWithNullableDto.java | 1 + .../src/main/java/org/openapitools/model/PetDto.java | 2 -- .../org/openapitools/model/TypeHolderDefaultDto.java | 6 ------ .../org/openapitools/model/TypeHolderExampleDto.java | 7 ------- 426 files changed, 150 insertions(+), 906 deletions(-) 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 83c89d9c9800..4aa4e0f36117 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,7 +29,6 @@ @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 53b64044c6e3..0d9d99f20e09 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,10 +36,8 @@ 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 c16ac8affc4e..37d29c32b8da 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,10 +36,8 @@ 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 141ad532407c..f655d26b20a7 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,10 +36,8 @@ 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 c16ac8affc4e..37d29c32b8da 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,10 +36,8 @@ 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 fb95071ae45f..46a16d7fe21d 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,6 +58,7 @@ 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 ccfe65d189e1..c724049e493b 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,7 +37,6 @@ @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 44a1a1ea0b01..20129cb89013 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,7 +27,6 @@ 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 d88271c2bf46..ccb8f5a5647f 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 250a8a7fa9fb..9c39a7569a81 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,7 +103,6 @@ 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 0db61103ab8a..ac2ef6be7859 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,7 +39,6 @@ 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,13 +50,11 @@ 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; @@ -68,7 +65,6 @@ 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 9dcea8d6c27b..e11dd113cbc2 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,7 +24,6 @@ @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 f84d9d21f9cf..350b970a945d 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,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,6 +29,7 @@ @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 cb3f764522a6..1d18853e2e2e 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,6 +75,7 @@ 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 b4eda9e7f9c4..2052979417f7 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,10 +39,8 @@ 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 a1c213eb40de..99d18a336d78 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,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,19 +27,14 @@ @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 b0f401268821..b0faf5aaa9ae 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,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,22 +27,16 @@ @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 613b36dd183c..b893bb4ec7c6 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,6 +57,7 @@ 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 67474f01ec05..e301cd61dba3 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,7 +36,6 @@ @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 ca80887aed58..5c51fa54cc0a 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,7 +26,6 @@ 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 fe0be24e229d..af2b07f95d73 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 5069a1a9acbb..5263a4e2bc96 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,7 +102,6 @@ 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 c68a2728bcb1..18101da678fa 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,7 +38,6 @@ 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,13 +49,11 @@ 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; @@ -67,7 +64,6 @@ 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 b6b48d488ede..0d4be7ac8140 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,7 +23,6 @@ @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 d9edf72050f1..f93832a65c98 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,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,6 +28,7 @@ @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 af08c71fb48f..2300afd143a4 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,6 +74,7 @@ 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 791eea25f843..0ce2b93a2b0f 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,10 +38,8 @@ 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 8ca218f8c704..987983e43451 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,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; @@ -27,19 +26,14 @@ @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 eea548352cc7..4db40f3db382 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,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; @@ -27,22 +26,16 @@ @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/PetDto.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/PetDto.java index 72a715bd0e20..2bec6c231fc2 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 @@ -36,10 +36,8 @@ 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 List photoUrls = new ArrayList<>(); @JsonInclude(JsonInclude.Include.NON_NULL) 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 d143dbf68f9c..0cd4c4edbd58 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,6 +56,7 @@ 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 fe52d0aa116a..282ca2ce689b 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,7 +36,6 @@ @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 a606369f1c61..6778a62dfd5e 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,7 +25,6 @@ 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 ca932fee5f0f..16f74d8223aa 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 58945182bd97..54c2c98f7fe4 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,7 +103,6 @@ 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 fe3df02f9da4..c2dc9d17f0b8 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,7 +39,6 @@ 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,13 +50,11 @@ 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; @@ -68,7 +65,6 @@ 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 1edf0813d0b5..07be2f99663a 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,7 +22,6 @@ @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 dff5aa4523f8..3abb813498f2 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,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.Arrays; @@ -26,6 +27,7 @@ @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 9b895427687b..79e274840817 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,6 +74,7 @@ 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 2e84df56c536..be762175a56b 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,10 +37,8 @@ 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 7aedd82ea28e..1f8e4dc3d890 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,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.math.BigDecimal; @@ -26,19 +25,14 @@ @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 f1609752ba2f..d37cdc713ec3 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,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.math.BigDecimal; @@ -26,22 +25,16 @@ @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 b266f37f4576..120027d72686 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,6 +55,7 @@ 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 29ecd6ae4724..f5d220bc1b43 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,7 +35,6 @@ @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 dd15acc4171f..bcd733ba06d7 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,7 +24,6 @@ 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 31a8133cb94f..a348b064c179 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 07926663552d..c62cf18d0eee 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,7 +102,6 @@ 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 f4aea008dfa3..c0831401197a 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,7 +38,6 @@ 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,13 +49,11 @@ 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; @@ -67,7 +64,6 @@ 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 5be398a7e1c9..f237f6637dd5 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,7 +21,6 @@ @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 5e0395f3fd34..d5fda5613396 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,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.Arrays; @@ -25,6 +26,7 @@ @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 a2e4fd94701a..40350659ae78 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,6 +73,7 @@ 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 906fa96ae1ee..89685de90050 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,10 +36,8 @@ 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 e8978ec83178..4bf6cba777df 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,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.math.BigDecimal; @@ -25,19 +24,14 @@ @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 4caccae69640..5e77ca347711 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,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.math.BigDecimal; @@ -25,22 +24,16 @@ @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 b266f37f4576..120027d72686 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,6 +55,7 @@ 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 29ecd6ae4724..f5d220bc1b43 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,7 +35,6 @@ @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 dd15acc4171f..bcd733ba06d7 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,7 +24,6 @@ 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 31a8133cb94f..a348b064c179 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 07926663552d..c62cf18d0eee 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,7 +102,6 @@ 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 f4aea008dfa3..c0831401197a 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,7 +38,6 @@ 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,13 +49,11 @@ 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; @@ -67,7 +64,6 @@ 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 5be398a7e1c9..f237f6637dd5 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,7 +21,6 @@ @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 5e0395f3fd34..d5fda5613396 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,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.Arrays; @@ -25,6 +26,7 @@ @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 a2e4fd94701a..40350659ae78 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,6 +73,7 @@ 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 906fa96ae1ee..89685de90050 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,10 +36,8 @@ 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 e8978ec83178..4bf6cba777df 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,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.math.BigDecimal; @@ -25,19 +24,14 @@ @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 4caccae69640..5e77ca347711 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,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.math.BigDecimal; @@ -25,22 +24,16 @@ @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/AnimalDto.java b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/AnimalDto.java index 3e9eafcccd85..79eb758c01f0 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,7 +39,6 @@ @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-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 13fb12b7ecd2..a7974b8569f2 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 @@ -29,7 +29,6 @@ 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-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 b5627e929b6b..b28ffec6be94 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,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,10 +28,8 @@ 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/EnumTestDto.java b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/EnumTestDto.java index cf17977dfcac..f94de0c9c545 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 @@ -105,7 +105,6 @@ public static EnumStringRequiredEnum fromValue(String value) { } } - @JsonInclude(JsonInclude.Include.NON_NULL) private EnumStringRequiredEnum enumStringRequired; /** 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 9b9fcb4d1bf8..e6c0613fa656 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 @@ -41,7 +41,6 @@ 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) @@ -53,13 +52,11 @@ 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; @@ -70,7 +67,6 @@ 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-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 bc3e2c3c5da0..809f87f431c2 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,7 +26,6 @@ @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-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 8e339b8f2701..30524a3fe8d0 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 @@ -41,10 +41,8 @@ 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-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 c0325225555f..e92f8c79ef5f 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,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,19 +27,14 @@ @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 522e6a5f3520..0400294f91bc 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,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,22 +27,16 @@ @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-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 a3e051349288..5daca86cbb74 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,6 +57,7 @@ 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 e4e0790b3e92..2e8e804a79d3 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,7 +37,6 @@ @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 3455dcf8b80b..08c3a1d9091a 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,7 +26,6 @@ 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 219aeb0cd0ed..09216052292e 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 671101c3ca77..bab57721b404 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,7 +104,6 @@ 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 17566a89eeda..6c85cd100777 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,7 +40,6 @@ 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) @@ -52,13 +51,11 @@ 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; @@ -69,7 +66,6 @@ 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 aa4b273b332e..9b15554afbc6 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,7 +23,6 @@ @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 c25a2eaa55bf..d606c62a8fcf 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,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.Arrays; @@ -27,6 +28,7 @@ @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 fde0586fa40c..d6a067cca4e5 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,6 +75,7 @@ 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 a879f5ebd770..f4272d0f6c80 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,10 +38,8 @@ 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 ac5a2fd1272b..a3fc75dcc4f8 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,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.math.BigDecimal; @@ -27,19 +26,14 @@ @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 faf1e1ff30ef..4171f01f6aed 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,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.math.BigDecimal; @@ -27,22 +26,16 @@ @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 613b36dd183c..b893bb4ec7c6 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,6 +57,7 @@ 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 67474f01ec05..e301cd61dba3 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,7 +36,6 @@ @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 ca80887aed58..5c51fa54cc0a 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,7 +26,6 @@ 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 fe0be24e229d..af2b07f95d73 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 5069a1a9acbb..5263a4e2bc96 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,7 +102,6 @@ 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 c68a2728bcb1..18101da678fa 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,7 +38,6 @@ 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,13 +49,11 @@ 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; @@ -67,7 +64,6 @@ 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 b6b48d488ede..0d4be7ac8140 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,7 +23,6 @@ @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 d9edf72050f1..f93832a65c98 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,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,6 +28,7 @@ @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 af08c71fb48f..2300afd143a4 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,6 +74,7 @@ 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 791eea25f843..0ce2b93a2b0f 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,10 +38,8 @@ 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 8ca218f8c704..987983e43451 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,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; @@ -27,19 +26,14 @@ @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 eea548352cc7..4db40f3db382 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,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; @@ -27,22 +26,16 @@ @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 590fef4efc14..819444909ebb 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,10 +34,8 @@ 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 c16ac8affc4e..37d29c32b8da 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,10 +36,8 @@ 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/Pet.java b/samples/openapi3/client/petstore/spring-cloud-4-with-optional/src/main/java/org/openapitools/model/Pet.java index 9308a4a8eed9..e7ed1e26b8fa 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 @@ -35,10 +35,8 @@ public class Pet { @JsonInclude(JsonInclude.Include.NON_NULL) 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) 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 c16ac8affc4e..37d29c32b8da 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,10 +36,8 @@ 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 83c89d9c9800..4aa4e0f36117 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,7 +29,6 @@ @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 c16ac8affc4e..37d29c32b8da 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,10 +36,8 @@ 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 fc4f770ac1d9..4798bc0c028d 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,6 +57,7 @@ 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 56776316e18b..d5f2df7bca2b 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,7 +37,6 @@ @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 cf8d702378be..212def45ba53 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,7 +26,6 @@ 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 5e934e643224..9fcdefe1da2e 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 65e0ceefa324..aeb76fdcd3b2 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,7 +104,6 @@ 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 3f9be180fd12..526aa66a1882 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,7 +40,6 @@ 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) @@ -52,13 +51,11 @@ 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; @@ -69,7 +66,6 @@ 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 ad228020783e..87c1af437ed4 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,7 +24,6 @@ @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 31127013b739..7330185d2021 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,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.Arrays; @@ -27,6 +28,7 @@ @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 d394b3e38431..d095e6659db9 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,6 +75,7 @@ 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 2905cdf83cf0..ab6a00effad0 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,10 +38,8 @@ 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 8eb2ebe70171..56da244f404e 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,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.math.BigDecimal; @@ -27,19 +26,14 @@ @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 7547cfb95047..2796a8f8c4ec 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,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.math.BigDecimal; @@ -27,22 +26,16 @@ @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 141ad532407c..f655d26b20a7 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,10 +36,8 @@ 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 c16ac8affc4e..37d29c32b8da 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,10 +36,8 @@ 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 c16ac8affc4e..37d29c32b8da 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,10 +36,8 @@ 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 c16ac8affc4e..37d29c32b8da 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,10 +36,8 @@ 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 0f2566549e46..3ea2af2720cd 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,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; @@ -27,10 +26,8 @@ @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 d6f893866d1e..8b42e4bccec3 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,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; @@ -27,10 +26,8 @@ @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 183cf2f6e604..93a0bdb89f2a 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,7 +29,6 @@ @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 d3b3476145d6..c6bff315d94c 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,7 +52,6 @@ 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 fb39bfa8fd71..c3e7425d99a4 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,7 +48,6 @@ 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 5426785a0d55..6b1a418efa4e 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,7 +29,6 @@ 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 2233230221a9..3d77543df254 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,7 +3,6 @@ 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 3cb15460b8cf..f98df374ed7a 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,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; @@ -27,10 +26,8 @@ @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 1796fc81d4be..b168fc3d764e 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,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; @@ -27,10 +26,8 @@ @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 0a385721560a..c27bcfa659c7 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,7 +29,6 @@ @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 10167c1164ee..4a0620729d17 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,7 +52,6 @@ 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 6d9b7196a1ee..33e1b724576b 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,7 +48,6 @@ 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 bf5afd3ab33b..b9e911f48fa7 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,7 +29,6 @@ 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 a9901953bd7e..45b655f0ce22 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,7 +3,6 @@ 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 cd02d6d6bdab..0be64c62685f 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,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; @@ -27,10 +26,8 @@ @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 cd3bb74e50bd..cb801806025f 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,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; @@ -27,10 +26,8 @@ @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 9854268cedbe..acaa8e50aa91 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,7 +29,6 @@ @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 0068e39ff4cc..3614b2ed6844 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,7 +52,6 @@ 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 782967688b0e..28083ecc80a2 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,7 +48,6 @@ 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 ee4781a36c64..1ea149bee2a5 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,7 +29,6 @@ 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 2233230221a9..3d77543df254 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,7 +3,6 @@ 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 c16ac8affc4e..37d29c32b8da 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,10 +36,8 @@ 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 0ff80dbce269..34fefa217937 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,10 +44,8 @@ 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 8b46bc621498..76e94c5b80a7 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,10 +43,8 @@ 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 127fd2f64399..38e257be4546 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 @@ -50,7 +50,6 @@ public class Foo { @JsonInclude(JsonInclude.Include.NON_NULL) private List listMinIntems = new ArrayList<>(); - @JsonInclude(JsonInclude.Include.NON_NULL) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime requiredDt; 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 93a856e10555..ce7523e6fee7 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 @@ -45,10 +45,8 @@ 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-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 fc4f770ac1d9..4798bc0c028d 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,6 +57,7 @@ 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 7812e1c12382..2f923496661e 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,7 +37,6 @@ @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 03999441f921..f6a38799c911 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,7 +26,6 @@ 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 a51bd99c90fc..4a0936f8a784 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 5bd8c11d9722..cef26523d335 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,7 +104,6 @@ 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 0cb8e0d45c2d..b4d90992ea4c 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,7 +40,6 @@ 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) @@ -52,13 +51,11 @@ 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; @@ -69,7 +66,6 @@ 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 4b44b936d3e2..2fc98b6fb666 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,7 +24,6 @@ @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 31127013b739..7330185d2021 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,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.Arrays; @@ -27,6 +28,7 @@ @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 d394b3e38431..d095e6659db9 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,6 +75,7 @@ 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 728f7cad250d..673bb2e90254 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,10 +38,8 @@ 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 79d663d04658..81f9284d385e 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,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.math.BigDecimal; @@ -27,19 +26,14 @@ @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 31461adcaef0..8b1470e92bf0 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,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.math.BigDecimal; @@ -27,22 +26,16 @@ @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 fc4f770ac1d9..4798bc0c028d 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,6 +57,7 @@ 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 7812e1c12382..2f923496661e 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,7 +37,6 @@ @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 03999441f921..f6a38799c911 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,7 +26,6 @@ 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 a51bd99c90fc..4a0936f8a784 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 5bd8c11d9722..cef26523d335 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,7 +104,6 @@ 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 0cb8e0d45c2d..b4d90992ea4c 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,7 +40,6 @@ 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) @@ -52,13 +51,11 @@ 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; @@ -69,7 +66,6 @@ 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 4b44b936d3e2..2fc98b6fb666 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,7 +24,6 @@ @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 31127013b739..7330185d2021 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,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.Arrays; @@ -27,6 +28,7 @@ @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 d394b3e38431..d095e6659db9 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,6 +75,7 @@ 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 728f7cad250d..673bb2e90254 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,10 +38,8 @@ 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 79d663d04658..81f9284d385e 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,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.math.BigDecimal; @@ -27,19 +26,14 @@ @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 31461adcaef0..8b1470e92bf0 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,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.math.BigDecimal; @@ -27,22 +26,16 @@ @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 47e43e89eb8a..aa7e8049ad41 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,10 +34,8 @@ 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/Pet.java b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/Pet.java index c16ac8affc4e..37d29c32b8da 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 @@ -36,10 +36,8 @@ 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/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 4887b45e853b..d5af2e05d658 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,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.JsonValue import com.fasterxml.jackson.annotation.JsonIgnoreProperties @@ -25,7 +24,6 @@ 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 599607754f1d..de31e3c6a74b 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,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.JsonCreator import com.fasterxml.jackson.annotation.JsonIgnoreProperties @@ -26,12 +25,10 @@ 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 373c49ea1ab7..40869b85e6bb 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,7 +3,6 @@ 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 cf8ed4566029..c5611ef934c7 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,11 +27,9 @@ 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 374a42c3886d..e11c5a0a1af1 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,11 +27,9 @@ 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 831595203de0..f4e25930868d 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,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.JsonValue import org.openapitools.model.VehicleType @@ -27,11 +26,9 @@ 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 723e2f2376e8..61b3bda8c499 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,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.JsonValue import org.openapitools.model.VehicleType @@ -27,11 +26,9 @@ 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 afd7fad1a33d..637caa41c0e0 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,7 +3,6 @@ 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/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 d37fcde397d1..978290446045 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,11 +30,9 @@ 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 818ca34ee824..ebd784c67532 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,12 +32,10 @@ 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 818ca34ee824..ebd784c67532 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,12 +32,10 @@ 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 818ca34ee824..ebd784c67532 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,12 +32,10 @@ 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 818ca34ee824..ebd784c67532 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,12 +32,10 @@ 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 818ca34ee824..ebd784c67532 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,12 +32,10 @@ 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 28f9f7e2cf42..b0c7a8a472e2 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,17 +41,14 @@ 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 7e5d66de499d..245556f67207 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,17 +41,14 @@ 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 ab6822d9644c..edcf36d7df67 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,12 +32,10 @@ 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 e16108c6b858..67857d6d788d 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,7 +32,6 @@ 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 4734ca04df3e..0de23f8edb3c 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,11 +33,9 @@ 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 7cf3de7d9c48..56c523367969 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,11 +30,9 @@ 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/Pet.kt b/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/model/Pet.kt index 7cf3de7d9c48..56c523367969 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,11 +30,9 @@ 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-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 7cf3de7d9c48..56c523367969 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,11 +30,9 @@ 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 f6f096f6eed4..c076750eb99a 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,11 +30,9 @@ 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 9ec6249ca10e..70d1f73e208f 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,12 +28,10 @@ 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 7cd760e87cc8..0aa99a764a76 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,12 +32,10 @@ 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 0a072512fd08..45c87638f15f 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,12 +32,10 @@ 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 0869716cacdd..4db812f3390c 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,17 +37,14 @@ 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 9cd0d8edc3f8..301b4c80b12f 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,32 +38,26 @@ 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 eb40a7638b18..c7effc69943c 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,7 +26,6 @@ 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/Pet.kt b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Pet.kt index 5be374053e68..3f3a4d005b5b 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,12 +32,10 @@ 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, 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 572741c45089..d5959182a70f 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,11 +30,9 @@ 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 572741c45089..d5959182a70f 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,11 +30,9 @@ 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 a40d0746abed..d2938312720f 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,7 +1,6 @@ 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 @@ -22,19 +21,15 @@ 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 1fef46231b24..983d1f583f52 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,7 +23,6 @@ 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 0a072512fd08..45c87638f15f 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,12 +32,10 @@ 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 0a072512fd08..45c87638f15f 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,12 +32,10 @@ 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 3ded71b1e461..148d5e215f21 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,7 +26,6 @@ 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 48a8f76d11bf..0349895b01be 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,7 +24,6 @@ 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 f6565a59f920..856de1f1a7b0 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,7 +26,6 @@ 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 664fcc2f0214..3933754b80f8 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,12 +32,10 @@ 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 808f5695c0c8..9ed84667a2bd 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,11 +25,9 @@ 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?, @@ -38,6 +36,7 @@ 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 3adf7cb3f88b..11b4702d5b38 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,7 +23,6 @@ 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 121502d59510..3de771e29973 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,12 +32,10 @@ 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 298428490fdf..2f4708fe0104 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,12 +32,10 @@ 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 0869716cacdd..4db812f3390c 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,17 +37,14 @@ 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 911756347da6..2202f4aae40b 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,32 +38,26 @@ 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/Pet.kt b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Pet.kt index c98aeda868da..a94d6438c2b5 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,11 +31,9 @@ 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/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 fc4f770ac1d9..4798bc0c028d 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,6 +57,7 @@ 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 7812e1c12382..2f923496661e 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,7 +37,6 @@ @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 03999441f921..f6a38799c911 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,7 +26,6 @@ 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 a51bd99c90fc..4a0936f8a784 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 5bd8c11d9722..cef26523d335 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,7 +104,6 @@ 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 0cb8e0d45c2d..b4d90992ea4c 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,7 +40,6 @@ 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) @@ -52,13 +51,11 @@ 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; @@ -69,7 +66,6 @@ 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 4b44b936d3e2..2fc98b6fb666 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,7 +24,6 @@ @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 31127013b739..7330185d2021 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,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.Arrays; @@ -27,6 +28,7 @@ @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 d394b3e38431..d095e6659db9 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,6 +75,7 @@ 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 728f7cad250d..673bb2e90254 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,10 +38,8 @@ 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 79d663d04658..81f9284d385e 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,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.math.BigDecimal; @@ -27,19 +26,14 @@ @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 31461adcaef0..8b1470e92bf0 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,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.math.BigDecimal; @@ -27,22 +26,16 @@ @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 430f680158d4..30bc93ff4da5 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,11 +33,13 @@ @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/Animal.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Animal.java index d5fdd45f18f4..0364cbeb451f 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,7 +38,6 @@ @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-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 cca98c14da84..0920e9972f19 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 @@ -27,7 +27,6 @@ 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-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 6674c88a2e4f..518f33493840 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,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.ArrayList; @@ -27,10 +26,8 @@ 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/EnumTest.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumTest.java index 171acfa4ae03..c5b52e5f1168 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 @@ -105,7 +105,6 @@ public static EnumStringRequiredEnum fromValue(String value) { } } - @JsonInclude(JsonInclude.Include.NON_NULL) private EnumStringRequiredEnum enumStringRequired; /** 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 e48c14544a78..12be011e4b50 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 @@ -41,7 +41,6 @@ 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) @@ -53,13 +52,11 @@ 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; @@ -70,7 +67,6 @@ 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-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 78dc53df6d91..e9a7f9cc9d8a 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,7 +25,6 @@ @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-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 26e826f8fbc9..6a20ec90e83f 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 @@ -39,10 +39,8 @@ 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-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 df8b8fbcdb51..e1ddc677876c 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,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.math.BigDecimal; @@ -26,19 +25,14 @@ @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 3b3204e03b16..088b142a7513 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,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.math.BigDecimal; @@ -26,22 +25,16 @@ @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/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index fc4f770ac1d9..4798bc0c028d 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,6 +57,7 @@ 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 7812e1c12382..2f923496661e 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,7 +37,6 @@ @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 03999441f921..f6a38799c911 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,7 +26,6 @@ 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 a51bd99c90fc..4a0936f8a784 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 5bd8c11d9722..cef26523d335 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,7 +104,6 @@ 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 0cb8e0d45c2d..b4d90992ea4c 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,7 +40,6 @@ 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) @@ -52,13 +51,11 @@ 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; @@ -69,7 +66,6 @@ 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 4b44b936d3e2..2fc98b6fb666 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,7 +24,6 @@ @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 31127013b739..7330185d2021 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,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.Arrays; @@ -27,6 +28,7 @@ @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 d394b3e38431..d095e6659db9 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,6 +75,7 @@ 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 728f7cad250d..673bb2e90254 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,10 +38,8 @@ 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 79d663d04658..81f9284d385e 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,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.math.BigDecimal; @@ -27,19 +26,14 @@ @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 31461adcaef0..8b1470e92bf0 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,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.math.BigDecimal; @@ -27,22 +26,16 @@ @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 fc4f770ac1d9..4798bc0c028d 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,6 +57,7 @@ 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 7812e1c12382..2f923496661e 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,7 +37,6 @@ @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 03999441f921..f6a38799c911 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,7 +26,6 @@ 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 a51bd99c90fc..4a0936f8a784 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 5bd8c11d9722..cef26523d335 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,7 +104,6 @@ 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 0cb8e0d45c2d..b4d90992ea4c 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,7 +40,6 @@ 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) @@ -52,13 +51,11 @@ 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; @@ -69,7 +66,6 @@ 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 4b44b936d3e2..2fc98b6fb666 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,7 +24,6 @@ @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 31127013b739..7330185d2021 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,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.Arrays; @@ -27,6 +28,7 @@ @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 d394b3e38431..d095e6659db9 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,6 +75,7 @@ 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 728f7cad250d..673bb2e90254 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,10 +38,8 @@ 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 79d663d04658..81f9284d385e 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,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.math.BigDecimal; @@ -27,19 +26,14 @@ @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 31461adcaef0..8b1470e92bf0 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,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.math.BigDecimal; @@ -27,22 +26,16 @@ @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 fc4f770ac1d9..4798bc0c028d 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,6 +57,7 @@ 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 7812e1c12382..2f923496661e 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,7 +37,6 @@ @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 03999441f921..f6a38799c911 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,7 +26,6 @@ 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 a51bd99c90fc..4a0936f8a784 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 5bd8c11d9722..cef26523d335 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,7 +104,6 @@ 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 0cb8e0d45c2d..b4d90992ea4c 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,7 +40,6 @@ 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) @@ -52,13 +51,11 @@ 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; @@ -69,7 +66,6 @@ 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 4b44b936d3e2..2fc98b6fb666 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,7 +24,6 @@ @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 31127013b739..7330185d2021 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,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.Arrays; @@ -27,6 +28,7 @@ @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 d394b3e38431..d095e6659db9 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,6 +75,7 @@ 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 728f7cad250d..673bb2e90254 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,10 +38,8 @@ 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 79d663d04658..81f9284d385e 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,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.math.BigDecimal; @@ -27,19 +26,14 @@ @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 31461adcaef0..8b1470e92bf0 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,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.math.BigDecimal; @@ -27,22 +26,16 @@ @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 c16ac8affc4e..37d29c32b8da 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,10 +36,8 @@ 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 32023ee3da1e..86be6e693c91 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,6 +57,7 @@ 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 6ce4f7f8914c..f5dda830a79d 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,7 +37,6 @@ @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 11e1022ae3d3..48bdaa9344f8 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,7 +26,6 @@ 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 b6557ceff4e9..30539406b232 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 8d3ed031d65d..ef143d4788e3 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,7 +104,6 @@ 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 150781082c6d..c81f93c993ea 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,7 +40,6 @@ 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) @@ -52,13 +51,11 @@ 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; @@ -69,7 +66,6 @@ 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 76e74fd67579..bd408cc22a7c 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,7 +24,6 @@ @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 e2ceeea637fe..897b2fe03dd2 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,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.Arrays; @@ -27,6 +28,7 @@ @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 50c34a0c9121..6f7cb3fcb82c 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,6 +75,7 @@ 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 ea586df2067a..4a92bd5c7782 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,10 +38,8 @@ 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 d3800560158c..157504edc6d6 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,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.math.BigDecimal; @@ -27,19 +26,14 @@ @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 03b53c193ee8..405f1100a495 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,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.math.BigDecimal; @@ -27,22 +26,16 @@ @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 bdce7e27156f..c4d654ac44a6 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,10 +34,8 @@ 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 3f6cf5af234f..3a1809dfa191 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,6 +57,7 @@ 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 dac8f14035fc..99e7a4cdca08 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,7 +37,6 @@ @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 d15dbbf7d60c..75246c9ff8ce 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,7 +26,6 @@ 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 1e996c854efe..0e937a87f12b 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 795d53cd01a6..c8c06116f9a1 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,7 +104,6 @@ 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 79dc8a7432ae..e99a9a785740 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,7 +40,6 @@ 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) @@ -52,13 +51,11 @@ 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; @@ -69,7 +66,6 @@ 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 4fd62bd3f389..3a21421bf13c 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,7 +24,6 @@ @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 56d45c3ad292..14cce68e1223 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,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.Arrays; @@ -27,6 +28,7 @@ @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 af16949486cc..2b706856fd92 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,6 +75,7 @@ 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 1b1399efc065..cf4719096fb0 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,10 +38,8 @@ 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 57fabf941047..7cc05e11b994 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,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.math.BigDecimal; @@ -27,19 +26,14 @@ @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 ab33d9a13ef8..a2f08996fefa 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,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.math.BigDecimal; @@ -27,22 +26,16 @@ @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 9ea7f74985a9..37d3f00f767f 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,6 +59,7 @@ 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 fe05be4b1c68..234aef7fb345 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,7 +38,6 @@ @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 e62f4eb17757..b54dbbd66b7f 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,7 +28,6 @@ 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 2bc02f7a7cc3..fe421ec5cd1d 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 4d3330046620..7bd7ee977200 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,7 +104,6 @@ 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 e4f7ebda46b3..5894378400d2 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,7 +40,6 @@ 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) @@ -52,13 +51,11 @@ 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,7 +66,6 @@ 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 6055fd7ceb2d..6561257a70c2 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,7 +26,6 @@ @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 98ba228cdc9b..e82c4b3a1679 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,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; @@ -29,6 +30,7 @@ @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 982f8d038258..b4a5e5095239 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,6 +76,7 @@ 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 84bb38e9fc00..a760602c8d73 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,10 +40,8 @@ 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 4fba162597a9..f59eb21da480 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,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,19 +28,14 @@ @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 fb1d40011dac..4b7506f903ec 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,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,22 +28,16 @@ @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/Pet.java b/samples/server/petstore/springboot-lombok-data/src/main/java/org/openapitools/model/Pet.java index d4c997738f18..abb9aa57acef 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 @@ -52,7 +52,6 @@ public class Pet { @Schema(name = "name", example = "doggie", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("name") - @JsonInclude(JsonInclude.Include.NON_NULL) private String name; @@ -60,7 +59,6 @@ public class Pet { @JsonProperty("photoUrls") @lombok.Builder.Default - @JsonInclude(JsonInclude.Include.NON_NULL) private List photoUrls = new ArrayList<>(); 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 1a5e177b89a4..3819f2efd3fb 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,10 +41,8 @@ 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 a1a34c2041d5..6c356b8a5b13 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,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; @@ -25,16 +24,12 @@ 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 5bbe5fb75ae0..477568049136 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,7 +28,6 @@ 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 c16ac8affc4e..37d29c32b8da 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,10 +36,8 @@ 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 fc4f770ac1d9..4798bc0c028d 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,6 +57,7 @@ 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 7812e1c12382..2f923496661e 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,7 +37,6 @@ @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 03999441f921..f6a38799c911 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,7 +26,6 @@ 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 a51bd99c90fc..4a0936f8a784 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 5bd8c11d9722..cef26523d335 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,7 +104,6 @@ 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 0cb8e0d45c2d..b4d90992ea4c 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,7 +40,6 @@ 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) @@ -52,13 +51,11 @@ 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; @@ -69,7 +66,6 @@ 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 4b44b936d3e2..2fc98b6fb666 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,7 +24,6 @@ @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 31127013b739..7330185d2021 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,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.Arrays; @@ -27,6 +28,7 @@ @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 d394b3e38431..d095e6659db9 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,6 +75,7 @@ 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 728f7cad250d..673bb2e90254 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,10 +38,8 @@ 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 79d663d04658..81f9284d385e 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,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.math.BigDecimal; @@ -27,19 +26,14 @@ @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 31461adcaef0..8b1470e92bf0 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,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.math.BigDecimal; @@ -27,22 +26,16 @@ @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 fc4f770ac1d9..4798bc0c028d 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,6 +57,7 @@ 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 7812e1c12382..2f923496661e 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,7 +37,6 @@ @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 03999441f921..f6a38799c911 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,7 +26,6 @@ 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 a51bd99c90fc..4a0936f8a784 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 5bd8c11d9722..cef26523d335 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,7 +104,6 @@ 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 0cb8e0d45c2d..b4d90992ea4c 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,7 +40,6 @@ 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) @@ -52,13 +51,11 @@ 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; @@ -69,7 +66,6 @@ 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 4b44b936d3e2..2fc98b6fb666 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,7 +24,6 @@ @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 31127013b739..7330185d2021 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,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.Arrays; @@ -27,6 +28,7 @@ @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 d394b3e38431..d095e6659db9 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,6 +75,7 @@ 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 728f7cad250d..673bb2e90254 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,10 +38,8 @@ 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 79d663d04658..81f9284d385e 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,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.math.BigDecimal; @@ -27,19 +26,14 @@ @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 31461adcaef0..8b1470e92bf0 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,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.math.BigDecimal; @@ -27,22 +26,16 @@ @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 e6fa1ccea8b4..cad9a99b10f5 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,15 +28,14 @@ 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 5ec773c75180..81f0dd9c6551 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,7 +28,6 @@ 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 bceaaab0ee8e..4e0c294dd76c 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,7 +36,6 @@ @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 03999441f921..f6a38799c911 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,7 +26,6 @@ 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 5bd8c11d9722..cef26523d335 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,7 +104,6 @@ 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 e24c2373ad81..cb174a615f9b 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,7 +40,6 @@ 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) @@ -52,13 +51,11 @@ 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; @@ -69,7 +66,6 @@ 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 4b44b936d3e2..2fc98b6fb666 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,7 +24,6 @@ @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 63a0767c6aba..e58434a4f202 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,10 +35,8 @@ 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 94004510586d..e3ff9a400f74 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,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.math.BigDecimal; @@ -27,19 +26,14 @@ @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 31461adcaef0..8b1470e92bf0 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,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.math.BigDecimal; @@ -27,22 +26,16 @@ @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 bceaaab0ee8e..4e0c294dd76c 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,7 +36,6 @@ @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 03999441f921..f6a38799c911 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,7 +26,6 @@ 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 5bd8c11d9722..cef26523d335 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,7 +104,6 @@ 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 e24c2373ad81..cb174a615f9b 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,7 +40,6 @@ 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) @@ -52,13 +51,11 @@ 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; @@ -69,7 +66,6 @@ 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 4b44b936d3e2..2fc98b6fb666 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,7 +24,6 @@ @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 63a0767c6aba..e58434a4f202 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,10 +35,8 @@ 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 94004510586d..e3ff9a400f74 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,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.math.BigDecimal; @@ -27,19 +26,14 @@ @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 31461adcaef0..8b1470e92bf0 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,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.math.BigDecimal; @@ -27,22 +26,16 @@ @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 bceaaab0ee8e..4e0c294dd76c 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,7 +36,6 @@ @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 03999441f921..f6a38799c911 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,7 +26,6 @@ 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 5bd8c11d9722..cef26523d335 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,7 +104,6 @@ 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 e24c2373ad81..cb174a615f9b 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,7 +40,6 @@ 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) @@ -52,13 +51,11 @@ 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; @@ -69,7 +66,6 @@ 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 4b44b936d3e2..2fc98b6fb666 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,7 +24,6 @@ @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 63a0767c6aba..e58434a4f202 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,10 +35,8 @@ 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 94004510586d..e3ff9a400f74 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,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.math.BigDecimal; @@ -27,19 +26,14 @@ @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 31461adcaef0..8b1470e92bf0 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,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.math.BigDecimal; @@ -27,22 +26,16 @@ @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 bceaaab0ee8e..4e0c294dd76c 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,7 +36,6 @@ @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 03999441f921..f6a38799c911 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,7 +26,6 @@ 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 5bd8c11d9722..cef26523d335 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,7 +104,6 @@ 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 e24c2373ad81..cb174a615f9b 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,7 +40,6 @@ 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) @@ -52,13 +51,11 @@ 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; @@ -69,7 +66,6 @@ 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 4b44b936d3e2..2fc98b6fb666 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,7 +24,6 @@ @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 63a0767c6aba..e58434a4f202 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,10 +35,8 @@ 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 94004510586d..e3ff9a400f74 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,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.math.BigDecimal; @@ -27,19 +26,14 @@ @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 31461adcaef0..8b1470e92bf0 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,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.math.BigDecimal; @@ -27,22 +26,16 @@ @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 63a0767c6aba..e58434a4f202 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,10 +35,8 @@ 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/AdditionalPropertiesClass.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index 00053ec24f51..1b93d77f015d 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 @@ -57,6 +57,7 @@ public class AdditionalPropertiesClass { @JsonInclude(JsonInclude.Include.NON_NULL) private Optional anytype1 = Optional.empty(); + @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable anytype2 = JsonNullable.undefined(); @JsonInclude(JsonInclude.Include.NON_NULL) 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 b4710c3479a4..1f7e2da6b646 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,7 +37,6 @@ @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-useoptional/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Category.java index 7b32f50b3b7b..76970a34483f 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 @@ -26,7 +26,6 @@ public class Category { @JsonInclude(JsonInclude.Include.NON_NULL) 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/ContainerDefaultValue.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ContainerDefaultValue.java index 08ffd48ec9d6..ac5c31975e54 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/EnumTest.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/EnumTest.java index 161dc129156c..4d882356686c 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 @@ -104,7 +104,6 @@ public static EnumStringRequiredEnum fromValue(String value) { } } - @JsonInclude(JsonInclude.Include.NON_NULL) private EnumStringRequiredEnum enumStringRequired; /** 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 83c03f906fc6..0584bf0b3730 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 @@ -40,7 +40,6 @@ public class FormatTest { @JsonInclude(JsonInclude.Include.NON_NULL) private Optional int64 = Optional.empty(); - @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal number; @JsonInclude(JsonInclude.Include.NON_NULL) @@ -52,13 +51,11 @@ public class FormatTest { @JsonInclude(JsonInclude.Include.NON_NULL) private Optional<@Pattern(regexp = "[a-zA-Z]") String> string = Optional.empty(); - @JsonInclude(JsonInclude.Include.NON_NULL) private byte[] _byte; @JsonInclude(JsonInclude.Include.NON_NULL) private Optional binary = Optional.empty(); - @JsonInclude(JsonInclude.Include.NON_NULL) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) private LocalDate date; @@ -69,7 +66,6 @@ public class FormatTest { @JsonInclude(JsonInclude.Include.NON_NULL) private Optional uuid = Optional.empty(); - @JsonInclude(JsonInclude.Include.NON_NULL) private String password; @JsonInclude(JsonInclude.Include.NON_NULL) 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 773544c5edf4..390ab0989b32 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,7 +24,6 @@ @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-useoptional/src/main/java/org/openapitools/model/NullableMapProperty.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/NullableMapProperty.java index ab4c11a99f4f..9856b0d77cd6 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,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.Arrays; @@ -27,6 +28,7 @@ @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/ParentWithNullable.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ParentWithNullable.java index e5e63411d868..22db1d786cd5 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 @@ -75,6 +75,7 @@ public static TypeEnum fromValue(String value) { @JsonInclude(JsonInclude.Include.NON_NULL) 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 ceab4bd69ef0..8d3f1d0cf422 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 @@ -38,10 +38,8 @@ 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 Set photoUrls = new LinkedHashSet<>(); @JsonInclude(JsonInclude.Include.NON_NULL) 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 2bab3abf7d07..2a1d1c058908 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,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.math.BigDecimal; @@ -27,19 +26,14 @@ @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 65193abb520e..315db140f253 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,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.math.BigDecimal; @@ -27,22 +26,16 @@ @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-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 51f8239e6287..a38602c22da4 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,6 +57,7 @@ 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 9f6a83b4973f..b200b3f62188 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,7 +37,6 @@ @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 e4a77578766d..1114456a68a1 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,7 +26,6 @@ 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 2bd4f51c4140..e969b98a302b 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 65374acc591d..7b02c6226925 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,7 +104,6 @@ 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 92a22136e7a7..d1274d6cf08f 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,7 +40,6 @@ 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) @@ -52,13 +51,11 @@ 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; @@ -69,7 +66,6 @@ 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 736006c8b6f5..5e8a32edb738 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,7 +24,6 @@ @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 fc013fe70f4c..7db52928c1c6 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,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.Arrays; @@ -27,6 +28,7 @@ @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 bb28729decdd..d092b2fc47d5 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,6 +75,7 @@ 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 6c54f41ddd69..68c3ebd77107 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,10 +38,8 @@ 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 b6e5a480c71e..b4242f545bc2 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,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.math.BigDecimal; @@ -27,19 +26,14 @@ @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 cba300e3a67e..c6167ecb0cd8 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,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.math.BigDecimal; @@ -27,22 +26,16 @@ @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 db9084f361ed..eacc2158fcdd 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,7 +37,6 @@ @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 e62f4eb17757..b54dbbd66b7f 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,7 +28,6 @@ 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 1576c5046e33..e64c0995389d 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,7 +110,6 @@ public static EnumStringRequiredEnum fromValue(String value) { } } - @JsonInclude(JsonInclude.Include.NON_NULL) private EnumStringRequiredEnum enumStringRequired; /** @@ -189,6 +188,7 @@ 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 b2bcf9fec2d6..9baeea9cc239 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,7 +40,6 @@ 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) @@ -55,13 +54,11 @@ 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; @@ -72,7 +69,6 @@ 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 ac09a0a9834b..2b3de797a45a 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,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,6 +29,7 @@ @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 6055fd7ceb2d..6561257a70c2 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,7 +26,6 @@ @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 55fe5702be7f..99e4c9ecbf90 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,29 +40,39 @@ @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 ab45923a4570..2bc2073abb6a 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,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; @@ -27,7 +26,6 @@ @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 982f8d038258..b4a5e5095239 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,6 +76,7 @@ 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 5cbf751e6bd4..77a5d6571d54 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,10 +40,8 @@ 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 3115be7ad0b3..d04080bd138a 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,6 +59,7 @@ 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 0ea4d126864a..9954743744b8 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,7 +38,6 @@ @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 34487fc4bbc4..e9a8e17231e4 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,7 +28,6 @@ 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 39f4e40b9ba0..935dbf3e6f4d 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 bf188bb1b01d..5ab270f93a2e 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,7 +105,6 @@ 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 4f54909c543d..13b1eb4fcd2e 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,7 +40,6 @@ 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) @@ -52,13 +51,11 @@ 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,7 +66,6 @@ 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 a4fdb5f297fd..585d573dfecf 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,7 +26,6 @@ @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 50958c247610..e712397bff32 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,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; @@ -29,6 +30,7 @@ @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 af2b3803d750..2162ebf85db4 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,6 +77,7 @@ 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 bbeb1cf7c867..3953250b4693 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,10 +41,8 @@ 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 0ef0624afb20..d9d8b4f78585 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,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,19 +28,14 @@ @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 fbf86a0db3f3..aa7879602dc5 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,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,22 +28,16 @@ @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() { From 061f3179b15d4cacefe2413a0601b4f480f48962 Mon Sep 17 00:00:00 2001 From: Jachym Metlicka Date: Fri, 24 Jul 2026 15:59:50 +0200 Subject: [PATCH 08/12] feat(json-include): enhance manual per-property JSON include policy handling --- .../languages/KotlinSpringServerCodegen.java | 36 ++++++++++++++++++- .../codegen/languages/SpringCodegen.java | 36 ++++++++++++++++++- .../java/spring/SpringCodegenTest.java | 33 +++++++++++++++++ .../spring/KotlinSpringServerCodegenTest.java | 35 ++++++++++++++++++ .../issue_24401_json_include_per_schema.yaml | 9 +++++ 5 files changed, 147 insertions(+), 2 deletions(-) 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 27f7d287ade5..cae4507cb91b 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 @@ -1409,8 +1409,13 @@ public void postProcessModelProperty(CodegenModel model, CodegenProperty propert */ private void resolveJsonIncludePolicy(CodegenModel model, CodegenProperty property) { if (property.vendorExtensions.containsKey(JSON_INCLUDE_POLICY_EXTENSION)) { - if (isJsonIncludePolicyEmitted(property.vendorExtensions.get(JSON_INCLUDE_POLICY_EXTENSION))) { + String manualPolicy = resolveManualJsonIncludePolicy(property.vendorExtensions.get(JSON_INCLUDE_POLICY_EXTENSION)); + if (manualPolicy != null) { + property.vendorExtensions.put(JSON_INCLUDE_POLICY_EXTENSION, manualPolicy); model.imports.add("JsonInclude"); + } else { + // NONE / empty means "emit nothing"; drop the extension so the template renders no annotation. + property.vendorExtensions.remove(JSON_INCLUDE_POLICY_EXTENSION); } return; } @@ -1433,6 +1438,35 @@ private static boolean isJsonIncludePolicyEmitted(Object policy) { return policy != null && !policy.toString().isEmpty() && !"NONE".equalsIgnoreCase(policy.toString()); } + /** + * Valid {@code com.fasterxml.jackson.annotation.JsonInclude.Include} constant names accepted for a + * manual per-property {@code x-jackson-json-include-policy} override. {@code NONE} is a sentinel + * meaning "emit no annotation" and is handled separately (the extension is dropped). + */ + private static final Set VALID_JSON_INCLUDE_CONSTANTS = new HashSet<>(Arrays.asList( + "ALWAYS", "NON_NULL", "NON_ABSENT", "NON_EMPTY", "NON_DEFAULT", "USE_DEFAULTS", "CUSTOM")); + + /** + * Validate and normalize a manual per-property {@code x-jackson-json-include-policy} override. + * + * @return the normalized (upper-case) policy to emit, or {@code null} when the override means + * "emit no annotation" ({@code NONE}/empty), in which case the caller must drop the extension. + * @throws IllegalArgumentException when the override is not a valid {@code JsonInclude.Include} value. + */ + private static String resolveManualJsonIncludePolicy(Object rawPolicy) { + if (!isJsonIncludePolicyEmitted(rawPolicy)) { + return null; + } + String normalized = rawPolicy.toString().trim().toUpperCase(Locale.ROOT); + if (!VALID_JSON_INCLUDE_CONSTANTS.contains(normalized)) { + throw new IllegalArgumentException(JSON_INCLUDE_POLICY_EXTENSION + + " 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); + } + return normalized; + } + private static String normalizeJsonIncludePolicy(String policy) { if (policy == null) { return "NON_NULL"; 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 0e766dbeb71d..651206c3413e 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 @@ -1295,8 +1295,13 @@ public void postProcessModelProperty(CodegenModel model, CodegenProperty propert // optional & non-nullable -> optionalNonNullPropertyJsonInclude (default NON_NULL, NONE = omit) // optional & nullable -> none (JsonNullable module already governs inclusion) if (property.vendorExtensions.containsKey(JSON_INCLUDE_POLICY_EXTENSION)) { - if (isJsonIncludePolicyEmitted(property.vendorExtensions.get(JSON_INCLUDE_POLICY_EXTENSION))) { + String manualPolicy = resolveManualJsonIncludePolicy(property.vendorExtensions.get(JSON_INCLUDE_POLICY_EXTENSION)); + if (manualPolicy != null) { + property.vendorExtensions.put(JSON_INCLUDE_POLICY_EXTENSION, manualPolicy); model.imports.add("JsonInclude"); + } else { + // NONE / empty means "emit nothing"; drop the extension so the template renders no annotation. + property.vendorExtensions.remove(JSON_INCLUDE_POLICY_EXTENSION); } } else if (Boolean.TRUE.equals(generateJsonIncludeAnnotations)) { String policy = null; @@ -1316,6 +1321,35 @@ private static boolean isJsonIncludePolicyEmitted(Object policy) { return policy != null && !policy.toString().isEmpty() && !"NONE".equalsIgnoreCase(policy.toString()); } + /** + * Valid {@code com.fasterxml.jackson.annotation.JsonInclude.Include} constant names accepted for a + * manual per-property {@code x-jackson-json-include-policy} override. {@code NONE} is a sentinel + * meaning "emit no annotation" and is handled separately (the extension is dropped). + */ + private static final Set VALID_JSON_INCLUDE_CONSTANTS = new HashSet<>(Arrays.asList( + "ALWAYS", "NON_NULL", "NON_ABSENT", "NON_EMPTY", "NON_DEFAULT", "USE_DEFAULTS", "CUSTOM")); + + /** + * Validate and normalize a manual per-property {@code x-jackson-json-include-policy} override. + * + * @return the normalized (upper-case) policy to emit, or {@code null} when the override means + * "emit no annotation" ({@code NONE}/empty), in which case the caller must drop the extension. + * @throws IllegalArgumentException when the override is not a valid {@code JsonInclude.Include} value. + */ + private static String resolveManualJsonIncludePolicy(Object rawPolicy) { + if (!isJsonIncludePolicyEmitted(rawPolicy)) { + return null; + } + String normalized = rawPolicy.toString().trim().toUpperCase(Locale.ROOT); + if (!VALID_JSON_INCLUDE_CONSTANTS.contains(normalized)) { + throw new IllegalArgumentException(JSON_INCLUDE_POLICY_EXTENSION + + " 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); + } + return normalized; + } + private static String normalizeJsonIncludePolicy(String policy) { if (policy == null) { return "NON_NULL"; 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 7b1e63c40247..7996c876d2b1 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 @@ -8547,6 +8547,39 @@ void jsonInclude_forcedOverride_onJsonNullable_emitsAnnotationAndImport() throws .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(SpringCodegen.GENERATE_JSON_INCLUDE_ANNOTATIONS, "true")); + + JavaFileAssert.assertThat(files.get("ManualNone.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(SpringCodegen.GENERATE_JSON_INCLUDE_ANNOTATIONS, "true"))) + .hasStackTraceContaining("x-jackson-json-include-policy") + .hasStackTraceContaining("NOT_A_REAL_POLICY"); + } + @Test void testStringQuotesInTags_Issue22629() throws IOException { File output = java.nio.file.Files.createTempDirectory("test").toFile().getCanonicalFile(); 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 e05593f4cfc6..d2064c192bca 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 @@ -6882,6 +6882,41 @@ public void jsonInclude_forcedOverride_onJsonNullable_emitsAnnotationAndImport() "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(KotlinSpringServerCodegen.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: 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(KotlinSpringServerCodegen.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); + } + /** * Without openApiNullable the optional+nullable field is a plain {@code Type?} — no * {@code @field:JsonInclude(NON_ABSENT)} should be emitted because {@code JsonNullable} is 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 index c09979cb96c6..1799586edce7 100644 --- 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 @@ -79,3 +79,12 @@ components: 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 From f7ca22c1e323239756d9d38e7c7871f475ea5070 Mon Sep 17 00:00:00 2001 From: Jachym Metlicka Date: Fri, 24 Jul 2026 16:38:56 +0200 Subject: [PATCH 09/12] feat(json-include): refactor JSON include policy handling with utility class --- .../languages/KotlinSpringServerCodegen.java | 59 +--------- .../codegen/languages/SpringCodegen.java | 58 +--------- .../codegen/utils/JsonIncludePolicyUtils.java | 106 ++++++++++++++++++ .../java/spring/SpringCodegenTest.java | 20 ++++ .../spring/KotlinSpringServerCodegenTest.java | 19 ++++ ...e_24401_json_include_invalid_override.yaml | 28 +++++ .../issue_24401_json_include_per_schema.yaml | 9 ++ 7 files changed, 194 insertions(+), 105 deletions(-) create mode 100644 modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/JsonIncludePolicyUtils.java create mode 100644 modules/openapi-generator/src/test/resources/3_0/spring/issue_24401_json_include_invalid_override.yaml 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 cae4507cb91b..38b37de1befc 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,6 +34,7 @@ import org.openapitools.codegen.model.OperationMap; import org.openapitools.codegen.model.OperationsMap; import org.openapitools.codegen.templating.mustache.SpringHttpStatusLambda; +import org.openapitools.codegen.utils.JsonIncludePolicyUtils; import org.openapitools.codegen.utils.ModelUtils; import org.openapitools.codegen.utils.URLPathUtils; import org.slf4j.Logger; @@ -782,7 +783,8 @@ public void processOpts() { if (additionalProperties.containsKey(OPTIONAL_NON_NULL_PROPERTY_JSON_INCLUDE)) { this.setOptionalNonNullPropertyJsonInclude(additionalProperties.get(OPTIONAL_NON_NULL_PROPERTY_JSON_INCLUDE).toString()); } - this.optionalNonNullPropertyJsonInclude = normalizeJsonIncludePolicy(this.optionalNonNullPropertyJsonInclude); + this.optionalNonNullPropertyJsonInclude = JsonIncludePolicyUtils.normalizeJsonIncludePolicy( + this.optionalNonNullPropertyJsonInclude, OPTIONAL_NON_NULL_PROPERTY_JSON_INCLUDE); writePropertyBack(OPTIONAL_NON_NULL_PROPERTY_JSON_INCLUDE, optionalNonNullPropertyJsonInclude); if (generateJsonIncludeAnnotations == null) { LOGGER.warn("'{}' is not set. Defaulting to false: no @JsonInclude annotations are generated and property " @@ -1409,7 +1411,8 @@ public void postProcessModelProperty(CodegenModel model, CodegenProperty propert */ private void resolveJsonIncludePolicy(CodegenModel model, CodegenProperty property) { if (property.vendorExtensions.containsKey(JSON_INCLUDE_POLICY_EXTENSION)) { - String manualPolicy = resolveManualJsonIncludePolicy(property.vendorExtensions.get(JSON_INCLUDE_POLICY_EXTENSION)); + String manualPolicy = JsonIncludePolicyUtils.resolveManualJsonIncludePolicy( + property.vendorExtensions.get(JSON_INCLUDE_POLICY_EXTENSION), JSON_INCLUDE_POLICY_EXTENSION); if (manualPolicy != null) { property.vendorExtensions.put(JSON_INCLUDE_POLICY_EXTENSION, manualPolicy); model.imports.add("JsonInclude"); @@ -1428,62 +1431,12 @@ private void resolveJsonIncludePolicy(CodegenModel model, CodegenProperty proper } else if (!property.isNullable) { policy = optionalNonNullPropertyJsonInclude; } - if (isJsonIncludePolicyEmitted(policy)) { + if (JsonIncludePolicyUtils.isJsonIncludePolicyEmitted(policy)) { property.vendorExtensions.put(JSON_INCLUDE_POLICY_EXTENSION, policy); model.imports.add("JsonInclude"); } } - private static boolean isJsonIncludePolicyEmitted(Object policy) { - return policy != null && !policy.toString().isEmpty() && !"NONE".equalsIgnoreCase(policy.toString()); - } - - /** - * Valid {@code com.fasterxml.jackson.annotation.JsonInclude.Include} constant names accepted for a - * manual per-property {@code x-jackson-json-include-policy} override. {@code NONE} is a sentinel - * meaning "emit no annotation" and is handled separately (the extension is dropped). - */ - private static final Set VALID_JSON_INCLUDE_CONSTANTS = new HashSet<>(Arrays.asList( - "ALWAYS", "NON_NULL", "NON_ABSENT", "NON_EMPTY", "NON_DEFAULT", "USE_DEFAULTS", "CUSTOM")); - - /** - * Validate and normalize a manual per-property {@code x-jackson-json-include-policy} override. - * - * @return the normalized (upper-case) policy to emit, or {@code null} when the override means - * "emit no annotation" ({@code NONE}/empty), in which case the caller must drop the extension. - * @throws IllegalArgumentException when the override is not a valid {@code JsonInclude.Include} value. - */ - private static String resolveManualJsonIncludePolicy(Object rawPolicy) { - if (!isJsonIncludePolicyEmitted(rawPolicy)) { - return null; - } - String normalized = rawPolicy.toString().trim().toUpperCase(Locale.ROOT); - if (!VALID_JSON_INCLUDE_CONSTANTS.contains(normalized)) { - throw new IllegalArgumentException(JSON_INCLUDE_POLICY_EXTENSION - + " 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); - } - return normalized; - } - - private static String normalizeJsonIncludePolicy(String policy) { - if (policy == null) { - return "NON_NULL"; - } - String normalized = policy.trim().toUpperCase(Locale.ROOT); - switch (normalized) { - case "NON_NULL": - case "NON_EMPTY": - case "NON_DEFAULT": - case "NONE": - return normalized; - default: - throw new IllegalArgumentException(OPTIONAL_NON_NULL_PROPERTY_JSON_INCLUDE - + " must be one of NON_NULL, NON_EMPTY, NON_DEFAULT, NONE but was: " + policy); - } - } - @Override public void addImportsToOneOfInterface(List> imports) { if (additionalProperties.containsKey("jackson")) { 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 651206c3413e..b48d0d43c5d5 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,6 +40,7 @@ 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.JsonIncludePolicyUtils; import org.openapitools.codegen.utils.ModelUtils; import org.openapitools.codegen.utils.ProcessUtils; import org.openapitools.codegen.utils.URLPathUtils; @@ -601,7 +602,8 @@ public void processOpts() { if (additionalProperties.containsKey(OPTIONAL_NON_NULL_PROPERTY_JSON_INCLUDE)) { this.setOptionalNonNullPropertyJsonInclude(additionalProperties.get(OPTIONAL_NON_NULL_PROPERTY_JSON_INCLUDE).toString()); } - this.optionalNonNullPropertyJsonInclude = normalizeJsonIncludePolicy(this.optionalNonNullPropertyJsonInclude); + this.optionalNonNullPropertyJsonInclude = JsonIncludePolicyUtils.normalizeJsonIncludePolicy( + this.optionalNonNullPropertyJsonInclude, OPTIONAL_NON_NULL_PROPERTY_JSON_INCLUDE); additionalProperties.put(OPTIONAL_NON_NULL_PROPERTY_JSON_INCLUDE, optionalNonNullPropertyJsonInclude); if (jackson) { if (generateJsonIncludeAnnotations == null) { @@ -1295,7 +1297,8 @@ public void postProcessModelProperty(CodegenModel model, CodegenProperty propert // optional & non-nullable -> optionalNonNullPropertyJsonInclude (default NON_NULL, NONE = omit) // optional & nullable -> none (JsonNullable module already governs inclusion) if (property.vendorExtensions.containsKey(JSON_INCLUDE_POLICY_EXTENSION)) { - String manualPolicy = resolveManualJsonIncludePolicy(property.vendorExtensions.get(JSON_INCLUDE_POLICY_EXTENSION)); + String manualPolicy = JsonIncludePolicyUtils.resolveManualJsonIncludePolicy( + property.vendorExtensions.get(JSON_INCLUDE_POLICY_EXTENSION), JSON_INCLUDE_POLICY_EXTENSION); if (manualPolicy != null) { property.vendorExtensions.put(JSON_INCLUDE_POLICY_EXTENSION, manualPolicy); model.imports.add("JsonInclude"); @@ -1310,62 +1313,13 @@ public void postProcessModelProperty(CodegenModel model, CodegenProperty propert } else if (!property.isNullable) { policy = optionalNonNullPropertyJsonInclude; } - if (isJsonIncludePolicyEmitted(policy)) { + if (JsonIncludePolicyUtils.isJsonIncludePolicyEmitted(policy)) { property.vendorExtensions.put(JSON_INCLUDE_POLICY_EXTENSION, policy); model.imports.add("JsonInclude"); } } } - private static boolean isJsonIncludePolicyEmitted(Object policy) { - return policy != null && !policy.toString().isEmpty() && !"NONE".equalsIgnoreCase(policy.toString()); - } - - /** - * Valid {@code com.fasterxml.jackson.annotation.JsonInclude.Include} constant names accepted for a - * manual per-property {@code x-jackson-json-include-policy} override. {@code NONE} is a sentinel - * meaning "emit no annotation" and is handled separately (the extension is dropped). - */ - private static final Set VALID_JSON_INCLUDE_CONSTANTS = new HashSet<>(Arrays.asList( - "ALWAYS", "NON_NULL", "NON_ABSENT", "NON_EMPTY", "NON_DEFAULT", "USE_DEFAULTS", "CUSTOM")); - - /** - * Validate and normalize a manual per-property {@code x-jackson-json-include-policy} override. - * - * @return the normalized (upper-case) policy to emit, or {@code null} when the override means - * "emit no annotation" ({@code NONE}/empty), in which case the caller must drop the extension. - * @throws IllegalArgumentException when the override is not a valid {@code JsonInclude.Include} value. - */ - private static String resolveManualJsonIncludePolicy(Object rawPolicy) { - if (!isJsonIncludePolicyEmitted(rawPolicy)) { - return null; - } - String normalized = rawPolicy.toString().trim().toUpperCase(Locale.ROOT); - if (!VALID_JSON_INCLUDE_CONSTANTS.contains(normalized)) { - throw new IllegalArgumentException(JSON_INCLUDE_POLICY_EXTENSION - + " 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); - } - return normalized; - } - - private static String normalizeJsonIncludePolicy(String policy) { - if (policy == null) { - return "NON_NULL"; - } - String normalized = policy.trim().toUpperCase(Locale.ROOT); - switch (normalized) { - case "NON_NULL": - case "NON_EMPTY": - case "NON_DEFAULT": - case "NONE": - return normalized; - default: - throw new IllegalArgumentException(OPTIONAL_NON_NULL_PROPERTY_JSON_INCLUDE - + " must be one of NON_NULL, NON_EMPTY, NON_DEFAULT, NONE but was: " + policy); - } - } @Override public CodegenModel fromModel(String name, Schema model) { diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/JsonIncludePolicyUtils.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/JsonIncludePolicyUtils.java new file mode 100644 index 000000000000..e0f0d0b75f85 --- /dev/null +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/JsonIncludePolicyUtils.java @@ -0,0 +1,106 @@ +/* + * 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 java.util.Arrays; +import java.util.HashSet; +import java.util.Locale; +import java.util.Set; + +/** + * Shared resolution/validation logic for the {@code x-jackson-json-include-policy} vendor extension and the + * {@code optionalNonNullPropertyJsonInclude} config option, used by both the {@code spring} and + * {@code kotlin-spring} generators (issue #24401). + */ +public final class JsonIncludePolicyUtils { + + /** Sentinel value meaning "emit no {@code @JsonInclude} annotation". */ + public static final String NONE = "NONE"; + + /** + * Valid {@code com.fasterxml.jackson.annotation.JsonInclude.Include} constant names accepted for a + * manual per-property {@code x-jackson-json-include-policy} override. {@code NONE} is a sentinel + * meaning "emit no annotation" and is handled separately (the extension is dropped). + */ + private static final Set VALID_JSON_INCLUDE_CONSTANTS = new HashSet<>(Arrays.asList( + "ALWAYS", "NON_NULL", "NON_ABSENT", "NON_EMPTY", "NON_DEFAULT", "USE_DEFAULTS", "CUSTOM")); + + /** Valid values for the {@code optionalNonNullPropertyJsonInclude} config option. */ + private static final Set VALID_OPTIONAL_NON_NULL_POLICIES = new HashSet<>(Arrays.asList( + "NON_NULL", "NON_EMPTY", "NON_DEFAULT", "NONE")); + + private JsonIncludePolicyUtils() { + } + + /** + * Whether the given policy value (a manual override, or an already-resolved automatic policy) should + * result in an emitted {@code @JsonInclude} annotation. {@code null}, blank/whitespace-only, and the + * {@code NONE} sentinel (after trimming, case-insensitive) all mean "emit nothing". + */ + public static boolean isJsonIncludePolicyEmitted(Object policy) { + if (policy == null) { + return false; + } + String trimmed = policy.toString().trim(); + return !trimmed.isEmpty() && !NONE.equalsIgnoreCase(trimmed); + } + + /** + * 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 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) { + if (!isJsonIncludePolicyEmitted(rawPolicy)) { + return null; + } + String normalized = rawPolicy.toString().trim().toUpperCase(Locale.ROOT); + if (!VALID_JSON_INCLUDE_CONSTANTS.contains(normalized)) { + 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); + } + return normalized; + } + + /** + * 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: 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 "NON_NULL"; + } + String normalized = policy.trim().toUpperCase(Locale.ROOT); + if (!VALID_OPTIONAL_NON_NULL_POLICIES.contains(normalized)) { + throw new IllegalArgumentException(optionName + + " must be one of NON_NULL, NON_EMPTY, NON_DEFAULT, NONE but was: " + policy); + } + return normalized; + } +} 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 7996c876d2b1..aad6f17f5418 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 @@ -8566,6 +8566,26 @@ void jsonInclude_manualOverride_none_emitsNoAnnotationOrImport() throws IOExcept .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(SpringCodegen.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. 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 d2064c192bca..e869c1c41a90 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 @@ -6900,6 +6900,25 @@ public void jsonInclude_manualOverride_none_emitsNoAnnotationOrImport() throws I "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(KotlinSpringServerCodegen.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. 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_per_schema.yaml b/modules/openapi-generator/src/test/resources/3_0/spring/issue_24401_json_include_per_schema.yaml index 1799586edce7..5e10c8cf438e 100644 --- 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 @@ -88,3 +88,12 @@ components: 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 " From 1bc5c1d82fe26f3d6b69c28930927ed7a553c901 Mon Sep 17 00:00:00 2001 From: Jachym Metlicka Date: Fri, 24 Jul 2026 16:51:53 +0200 Subject: [PATCH 10/12] feat(json-include): update JSON include policy constants to use VendorExtension and CodegenConstants --- .../java/org/openapitools/codegen/CodegenConstants.java | 9 +++++++++ .../java/org/openapitools/codegen/VendorExtension.java | 3 ++- .../codegen/languages/KotlinSpringServerCodegen.java | 9 +++++---- .../openapitools/codegen/languages/SpringCodegen.java | 9 +++++---- 4 files changed, 21 insertions(+), 9 deletions(-) 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..de86737a238b 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,15 @@ 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 OPTIONAL_NON_NULL_PROPERTY_JSON_INCLUDE_DESC = "The Jackson @JsonInclude policy to apply to optional, non-nullable properties (ignored unless generateJsonIncludeAnnotations is true)."; + + public static final String GENERATE_JSON_INCLUDE_ANNOTATIONS = "generateJsonIncludeAnnotations"; + public static final String GENERATE_JSON_INCLUDE_ANNOTATIONS_DESC = "Generate field-level @JsonInclude annotations controlling Jackson serialization inclusion. When unset or false, no @JsonInclude annotations are generated and the project-wide ObjectMapper policy applies."; + + public static final String GENERATE_JSON_SETTER_NULLS_ANNOTATIONS = "generateJsonSetterNullsAnnotations"; + public static final String GENERATE_JSON_SETTER_NULLS_ANNOTATIONS_DESC = "Generate field-level @JsonSetter(nulls = ...) annotations controlling Jackson deserialization null-handling for optional, non-nullable properties. When unset or false, no @JsonSetter annotations are generated and the project-wide ObjectMapper policy applies."; + 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 38b37de1befc..1345b3c6e952 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 @@ -112,15 +112,15 @@ public class KotlinSpringServerCodegen extends AbstractKotlinCodegen public static final String USE_SEALED_RESPONSE_INTERFACES = "useSealedResponseInterfaces"; public static final String COMPANION_OBJECT = "companionObject"; public static final String SUSPEND_FUNCTIONS = "suspendFunctions"; - 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 OPTIONAL_NON_NULL_PROPERTY_JSON_INCLUDE = CodegenConstants.OPTIONAL_NON_NULL_PROPERTY_JSON_INCLUDE; + public static final String GENERATE_JSON_INCLUDE_ANNOTATIONS = CodegenConstants.GENERATE_JSON_INCLUDE_ANNOTATIONS; + public static final String GENERATE_JSON_SETTER_NULLS_ANNOTATIONS = CodegenConstants.GENERATE_JSON_SETTER_NULLS_ANNOTATIONS; /** * Universal per-property vendor extension holding the resolved Jackson {@code @JsonInclude} policy * (e.g. {@code NON_NULL}, {@code ALWAYS}). When absent, no {@code @JsonInclude} annotation is emitted. * A value set directly in the spec is treated as a manual override and always wins. */ - public static final String JSON_INCLUDE_POLICY_EXTENSION = "x-jackson-json-include-policy"; + public static final String JSON_INCLUDE_POLICY_EXTENSION = VendorExtension.X_JACKSON_JSON_INCLUDE_POLICY.getName(); @Getter public enum DeclarativeInterfaceReactiveMode { @@ -1901,6 +1901,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 b48d0d43c5d5..40dc160c3f6d 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 @@ -124,15 +124,15 @@ public class SpringCodegen extends AbstractJavaCodegen public static final String GENERATE_PAGEABLE_CONSTRAINT_VALIDATION = "generatePageableConstraintValidation"; public static final String SUBSTITUTE_GENERIC_PAGED_MODEL = "substituteGenericPagedModel"; public static final String CLIENT_REGISTRATION_ID = "clientRegistrationId"; - 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 OPTIONAL_NON_NULL_PROPERTY_JSON_INCLUDE = CodegenConstants.OPTIONAL_NON_NULL_PROPERTY_JSON_INCLUDE; + public static final String GENERATE_JSON_INCLUDE_ANNOTATIONS = CodegenConstants.GENERATE_JSON_INCLUDE_ANNOTATIONS; + public static final String GENERATE_JSON_SETTER_NULLS_ANNOTATIONS = CodegenConstants.GENERATE_JSON_SETTER_NULLS_ANNOTATIONS; /** * Universal per-property vendor extension holding the resolved Jackson {@code @JsonInclude} policy * (e.g. {@code NON_NULL}, {@code ALWAYS}). When absent, no {@code @JsonInclude} annotation is emitted. * A value set directly in the spec is treated as a manual override and always wins. */ - public static final String JSON_INCLUDE_POLICY_EXTENSION = "x-jackson-json-include-policy"; + public static final String JSON_INCLUDE_POLICY_EXTENSION = VendorExtension.X_JACKSON_JSON_INCLUDE_POLICY.getName(); @Getter public enum RequestMappingMode { @@ -1655,6 +1655,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; } From 41a29cd1232aa469e282cb3aa69448423bfc72f7 Mon Sep 17 00:00:00 2001 From: Jachym Metlicka Date: Fri, 24 Jul 2026 17:12:53 +0200 Subject: [PATCH 11/12] refactor(json-include): replace constants with CodegenConstants in JSON include policy handling --- .../languages/KotlinSpringServerCodegen.java | 57 ++++++++----------- .../codegen/languages/SpringCodegen.java | 49 +++++++--------- .../java/spring/SpringCodegenTest.java | 30 +++++----- .../spring/KotlinSpringServerCodegenTest.java | 38 ++++++------- 4 files changed, 78 insertions(+), 96 deletions(-) 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 1345b3c6e952..a895b420cf04 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 @@ -112,15 +112,6 @@ public class KotlinSpringServerCodegen extends AbstractKotlinCodegen public static final String USE_SEALED_RESPONSE_INTERFACES = "useSealedResponseInterfaces"; public static final String COMPANION_OBJECT = "companionObject"; public static final String SUSPEND_FUNCTIONS = "suspendFunctions"; - public static final String OPTIONAL_NON_NULL_PROPERTY_JSON_INCLUDE = CodegenConstants.OPTIONAL_NON_NULL_PROPERTY_JSON_INCLUDE; - public static final String GENERATE_JSON_INCLUDE_ANNOTATIONS = CodegenConstants.GENERATE_JSON_INCLUDE_ANNOTATIONS; - public static final String GENERATE_JSON_SETTER_NULLS_ANNOTATIONS = CodegenConstants.GENERATE_JSON_SETTER_NULLS_ANNOTATIONS; - /** - * Universal per-property vendor extension holding the resolved Jackson {@code @JsonInclude} policy - * (e.g. {@code NON_NULL}, {@code ALWAYS}). When absent, no {@code @JsonInclude} annotation is emitted. - * A value set directly in the spec is treated as a manual override and always wins. - */ - public static final String JSON_INCLUDE_POLICY_EXTENSION = VendorExtension.X_JACKSON_JSON_INCLUDE_POLICY.getName(); @Getter public enum DeclarativeInterfaceReactiveMode { @@ -329,9 +320,9 @@ public KotlinSpringServerCodegen() { 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(OPTIONAL_NON_NULL_PROPERTY_JSON_INCLUDE, + CliOption optionalNonNullPropertyJsonIncludeOpt = CliOption.newString(CodegenConstants.OPTIONAL_NON_NULL_PROPERTY_JSON_INCLUDE, "The Jackson @JsonInclude policy emitted for optional, non-nullable model properties when " - + GENERATE_JSON_INCLUDE_ANNOTATIONS + " is true. " + + CodegenConstants.GENERATE_JSON_INCLUDE_ANNOTATIONS + " is true. " + "NONE emits no annotation, deferring fully to the global ObjectMapper inclusion policy."); optionalNonNullPropertyJsonIncludeOpt.addEnum("NON_NULL", "Omit the property when its value is null (default, spec-safe for non-nullable fields)."); optionalNonNullPropertyJsonIncludeOpt.addEnum("NON_EMPTY", "Omit the property when its value is null or considered empty."); @@ -340,14 +331,14 @@ public KotlinSpringServerCodegen() { optionalNonNullPropertyJsonIncludeOpt.setDefault(optionalNonNullPropertyJsonInclude); cliOptions.add(optionalNonNullPropertyJsonIncludeOpt); - addSwitch(GENERATE_JSON_INCLUDE_ANNOTATIONS, + addSwitch(CodegenConstants.GENERATE_JSON_INCLUDE_ANNOTATIONS, "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 " - + OPTIONAL_NON_NULL_PROPERTY_JSON_INCLUDE + "). When false, none are generated and the global " + + 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.", false); - addSwitch(GENERATE_JSON_SETTER_NULLS_ANNOTATIONS, + 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 " @@ -772,36 +763,36 @@ public void processOpts() { } writePropertyBack(SUSPEND_FUNCTIONS, suspendFunctions); - if (additionalProperties.containsKey(GENERATE_JSON_INCLUDE_ANNOTATIONS)) { - this.setGenerateJsonIncludeAnnotations(convertPropertyToBoolean(GENERATE_JSON_INCLUDE_ANNOTATIONS)); + if (additionalProperties.containsKey(CodegenConstants.GENERATE_JSON_INCLUDE_ANNOTATIONS)) { + this.setGenerateJsonIncludeAnnotations(convertPropertyToBoolean(CodegenConstants.GENERATE_JSON_INCLUDE_ANNOTATIONS)); } - writePropertyBack(GENERATE_JSON_INCLUDE_ANNOTATIONS, Boolean.TRUE.equals(generateJsonIncludeAnnotations)); - if (additionalProperties.containsKey(GENERATE_JSON_SETTER_NULLS_ANNOTATIONS)) { - this.setGenerateJsonSetterNullsAnnotations(convertPropertyToBoolean(GENERATE_JSON_SETTER_NULLS_ANNOTATIONS)); + writePropertyBack(CodegenConstants.GENERATE_JSON_INCLUDE_ANNOTATIONS, Boolean.TRUE.equals(generateJsonIncludeAnnotations)); + if (additionalProperties.containsKey(CodegenConstants.GENERATE_JSON_SETTER_NULLS_ANNOTATIONS)) { + this.setGenerateJsonSetterNullsAnnotations(convertPropertyToBoolean(CodegenConstants.GENERATE_JSON_SETTER_NULLS_ANNOTATIONS)); } - writePropertyBack(GENERATE_JSON_SETTER_NULLS_ANNOTATIONS, Boolean.TRUE.equals(generateJsonSetterNullsAnnotations)); - if (additionalProperties.containsKey(OPTIONAL_NON_NULL_PROPERTY_JSON_INCLUDE)) { - this.setOptionalNonNullPropertyJsonInclude(additionalProperties.get(OPTIONAL_NON_NULL_PROPERTY_JSON_INCLUDE).toString()); + writePropertyBack(CodegenConstants.GENERATE_JSON_SETTER_NULLS_ANNOTATIONS, Boolean.TRUE.equals(generateJsonSetterNullsAnnotations)); + if (additionalProperties.containsKey(CodegenConstants.OPTIONAL_NON_NULL_PROPERTY_JSON_INCLUDE)) { + this.setOptionalNonNullPropertyJsonInclude(additionalProperties.get(CodegenConstants.OPTIONAL_NON_NULL_PROPERTY_JSON_INCLUDE).toString()); } this.optionalNonNullPropertyJsonInclude = JsonIncludePolicyUtils.normalizeJsonIncludePolicy( - this.optionalNonNullPropertyJsonInclude, OPTIONAL_NON_NULL_PROPERTY_JSON_INCLUDE); - writePropertyBack(OPTIONAL_NON_NULL_PROPERTY_JSON_INCLUDE, optionalNonNullPropertyJsonInclude); + this.optionalNonNullPropertyJsonInclude, CodegenConstants.OPTIONAL_NON_NULL_PROPERTY_JSON_INCLUDE); + writePropertyBack(CodegenConstants.OPTIONAL_NON_NULL_PROPERTY_JSON_INCLUDE, optionalNonNullPropertyJsonInclude); if (generateJsonIncludeAnnotations == null) { 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.", - GENERATE_JSON_INCLUDE_ANNOTATIONS, GENERATE_JSON_INCLUDE_ANNOTATIONS, - GENERATE_JSON_INCLUDE_ANNOTATIONS, OPTIONAL_NON_NULL_PROPERTY_JSON_INCLUDE); + CodegenConstants.GENERATE_JSON_INCLUDE_ANNOTATIONS, CodegenConstants.GENERATE_JSON_INCLUDE_ANNOTATIONS, + CodegenConstants.GENERATE_JSON_INCLUDE_ANNOTATIONS, CodegenConstants.OPTIONAL_NON_NULL_PROPERTY_JSON_INCLUDE); } if (generateJsonSetterNullsAnnotations == null) { 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.", - GENERATE_JSON_SETTER_NULLS_ANNOTATIONS, GENERATE_JSON_SETTER_NULLS_ANNOTATIONS, - GENERATE_JSON_SETTER_NULLS_ANNOTATIONS); + CodegenConstants.GENERATE_JSON_SETTER_NULLS_ANNOTATIONS, CodegenConstants.GENERATE_JSON_SETTER_NULLS_ANNOTATIONS, + CodegenConstants.GENERATE_JSON_SETTER_NULLS_ANNOTATIONS); } if (additionalProperties.containsKey(BEAN_QUALIFIERS) && library.equals(SPRING_BOOT)) { @@ -1410,15 +1401,15 @@ public void postProcessModelProperty(CodegenModel model, CodegenProperty propert * */ private void resolveJsonIncludePolicy(CodegenModel model, CodegenProperty property) { - if (property.vendorExtensions.containsKey(JSON_INCLUDE_POLICY_EXTENSION)) { + if (property.vendorExtensions.containsKey(VendorExtension.X_JACKSON_JSON_INCLUDE_POLICY.getName())) { String manualPolicy = JsonIncludePolicyUtils.resolveManualJsonIncludePolicy( - property.vendorExtensions.get(JSON_INCLUDE_POLICY_EXTENSION), JSON_INCLUDE_POLICY_EXTENSION); + property.vendorExtensions.get(VendorExtension.X_JACKSON_JSON_INCLUDE_POLICY.getName()), VendorExtension.X_JACKSON_JSON_INCLUDE_POLICY.getName()); if (manualPolicy != null) { - property.vendorExtensions.put(JSON_INCLUDE_POLICY_EXTENSION, manualPolicy); + 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(JSON_INCLUDE_POLICY_EXTENSION); + property.vendorExtensions.remove(VendorExtension.X_JACKSON_JSON_INCLUDE_POLICY.getName()); } return; } @@ -1432,7 +1423,7 @@ private void resolveJsonIncludePolicy(CodegenModel model, CodegenProperty proper policy = optionalNonNullPropertyJsonInclude; } if (JsonIncludePolicyUtils.isJsonIncludePolicyEmitted(policy)) { - property.vendorExtensions.put(JSON_INCLUDE_POLICY_EXTENSION, policy); + property.vendorExtensions.put(VendorExtension.X_JACKSON_JSON_INCLUDE_POLICY.getName(), policy); model.imports.add("JsonInclude"); } } 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 40dc160c3f6d..9ed49f55c9f9 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 @@ -124,15 +124,6 @@ public class SpringCodegen extends AbstractJavaCodegen public static final String GENERATE_PAGEABLE_CONSTRAINT_VALIDATION = "generatePageableConstraintValidation"; public static final String SUBSTITUTE_GENERIC_PAGED_MODEL = "substituteGenericPagedModel"; public static final String CLIENT_REGISTRATION_ID = "clientRegistrationId"; - public static final String OPTIONAL_NON_NULL_PROPERTY_JSON_INCLUDE = CodegenConstants.OPTIONAL_NON_NULL_PROPERTY_JSON_INCLUDE; - public static final String GENERATE_JSON_INCLUDE_ANNOTATIONS = CodegenConstants.GENERATE_JSON_INCLUDE_ANNOTATIONS; - public static final String GENERATE_JSON_SETTER_NULLS_ANNOTATIONS = CodegenConstants.GENERATE_JSON_SETTER_NULLS_ANNOTATIONS; - /** - * Universal per-property vendor extension holding the resolved Jackson {@code @JsonInclude} policy - * (e.g. {@code NON_NULL}, {@code ALWAYS}). When absent, no {@code @JsonInclude} annotation is emitted. - * A value set directly in the spec is treated as a manual override and always wins. - */ - public static final String JSON_INCLUDE_POLICY_EXTENSION = VendorExtension.X_JACKSON_JSON_INCLUDE_POLICY.getName(); @Getter public enum RequestMappingMode { @@ -299,9 +290,9 @@ public SpringCodegen() { cliOptions.add(CliOption.newBoolean(USE_SEALED, "Whether to generate sealed model interfaces and classes")); - CliOption optionalNonNullPropertyJsonIncludeOpt = CliOption.newString(OPTIONAL_NON_NULL_PROPERTY_JSON_INCLUDE, + CliOption optionalNonNullPropertyJsonIncludeOpt = CliOption.newString(CodegenConstants.OPTIONAL_NON_NULL_PROPERTY_JSON_INCLUDE, "The Jackson @JsonInclude policy emitted for optional, non-nullable model properties when " - + GENERATE_JSON_INCLUDE_ANNOTATIONS + " is true. " + + CodegenConstants.GENERATE_JSON_INCLUDE_ANNOTATIONS + " is true. " + "NONE emits no annotation, deferring fully to the global ObjectMapper inclusion policy."); optionalNonNullPropertyJsonIncludeOpt.addEnum("NON_NULL", "Omit the property when its value is null (default, spec-safe for non-nullable fields)."); optionalNonNullPropertyJsonIncludeOpt.addEnum("NON_EMPTY", "Omit the property when its value is null or considered empty."); @@ -310,14 +301,14 @@ public SpringCodegen() { optionalNonNullPropertyJsonIncludeOpt.setDefault(optionalNonNullPropertyJsonInclude); cliOptions.add(optionalNonNullPropertyJsonIncludeOpt); - cliOptions.add(CliOption.newBoolean(GENERATE_JSON_INCLUDE_ANNOTATIONS, + cliOptions.add(CliOption.newBoolean(CodegenConstants.GENERATE_JSON_INCLUDE_ANNOTATIONS, "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 " - + OPTIONAL_NON_NULL_PROPERTY_JSON_INCLUDE + "). When false, none are generated and the global " + + 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.", false)); - cliOptions.add(CliOption.newBoolean(GENERATE_JSON_SETTER_NULLS_ANNOTATIONS, + 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. " @@ -597,14 +588,14 @@ public void processOpts() { convertPropertyToBooleanAndWriteBack(RETURN_SUCCESS_CODE, this::setReturnSuccessCode); convertPropertyToBooleanAndWriteBack(USE_SWAGGER_UI, this::setUseSwaggerUI); convertPropertyToBooleanAndWriteBack(USE_SEALED, this::setUseSealed); - convertPropertyToBooleanAndWriteBack(GENERATE_JSON_INCLUDE_ANNOTATIONS, this::setGenerateJsonIncludeAnnotations); - convertPropertyToBooleanAndWriteBack(GENERATE_JSON_SETTER_NULLS_ANNOTATIONS, this::setGenerateJsonSetterNullsAnnotations); - if (additionalProperties.containsKey(OPTIONAL_NON_NULL_PROPERTY_JSON_INCLUDE)) { - this.setOptionalNonNullPropertyJsonInclude(additionalProperties.get(OPTIONAL_NON_NULL_PROPERTY_JSON_INCLUDE).toString()); + convertPropertyToBooleanAndWriteBack(CodegenConstants.GENERATE_JSON_INCLUDE_ANNOTATIONS, this::setGenerateJsonIncludeAnnotations); + convertPropertyToBooleanAndWriteBack(CodegenConstants.GENERATE_JSON_SETTER_NULLS_ANNOTATIONS, this::setGenerateJsonSetterNullsAnnotations); + if (additionalProperties.containsKey(CodegenConstants.OPTIONAL_NON_NULL_PROPERTY_JSON_INCLUDE)) { + this.setOptionalNonNullPropertyJsonInclude(additionalProperties.get(CodegenConstants.OPTIONAL_NON_NULL_PROPERTY_JSON_INCLUDE).toString()); } this.optionalNonNullPropertyJsonInclude = JsonIncludePolicyUtils.normalizeJsonIncludePolicy( - this.optionalNonNullPropertyJsonInclude, OPTIONAL_NON_NULL_PROPERTY_JSON_INCLUDE); - additionalProperties.put(OPTIONAL_NON_NULL_PROPERTY_JSON_INCLUDE, optionalNonNullPropertyJsonInclude); + this.optionalNonNullPropertyJsonInclude, CodegenConstants.OPTIONAL_NON_NULL_PROPERTY_JSON_INCLUDE); + additionalProperties.put(CodegenConstants.OPTIONAL_NON_NULL_PROPERTY_JSON_INCLUDE, optionalNonNullPropertyJsonInclude); if (jackson) { if (generateJsonIncludeAnnotations == null) { LOGGER.warn("'{}' is not set. Defaulting to false: no @JsonInclude annotations are generated and property " @@ -612,16 +603,16 @@ public void processOpts() { + "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.", - GENERATE_JSON_INCLUDE_ANNOTATIONS, GENERATE_JSON_INCLUDE_ANNOTATIONS, - GENERATE_JSON_INCLUDE_ANNOTATIONS, OPTIONAL_NON_NULL_PROPERTY_JSON_INCLUDE); + CodegenConstants.GENERATE_JSON_INCLUDE_ANNOTATIONS, CodegenConstants.GENERATE_JSON_INCLUDE_ANNOTATIONS, + CodegenConstants.GENERATE_JSON_INCLUDE_ANNOTATIONS, CodegenConstants.OPTIONAL_NON_NULL_PROPERTY_JSON_INCLUDE); } if (generateJsonSetterNullsAnnotations == null) { 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.", - GENERATE_JSON_SETTER_NULLS_ANNOTATIONS, GENERATE_JSON_SETTER_NULLS_ANNOTATIONS, - GENERATE_JSON_SETTER_NULLS_ANNOTATIONS); + CodegenConstants.GENERATE_JSON_SETTER_NULLS_ANNOTATIONS, CodegenConstants.GENERATE_JSON_SETTER_NULLS_ANNOTATIONS, + CodegenConstants.GENERATE_JSON_SETTER_NULLS_ANNOTATIONS); } } if (DocumentationProvider.NONE.equals(getDocumentationProvider())) { @@ -1296,15 +1287,15 @@ public void postProcessModelProperty(CodegenModel model, CodegenProperty propert // required & nullable -> ALWAYS (explicit null is valid and must be serialized) // optional & non-nullable -> optionalNonNullPropertyJsonInclude (default NON_NULL, NONE = omit) // optional & nullable -> none (JsonNullable module already governs inclusion) - if (property.vendorExtensions.containsKey(JSON_INCLUDE_POLICY_EXTENSION)) { + if (property.vendorExtensions.containsKey(VendorExtension.X_JACKSON_JSON_INCLUDE_POLICY.getName())) { String manualPolicy = JsonIncludePolicyUtils.resolveManualJsonIncludePolicy( - property.vendorExtensions.get(JSON_INCLUDE_POLICY_EXTENSION), JSON_INCLUDE_POLICY_EXTENSION); + property.vendorExtensions.get(VendorExtension.X_JACKSON_JSON_INCLUDE_POLICY.getName()), VendorExtension.X_JACKSON_JSON_INCLUDE_POLICY.getName()); if (manualPolicy != null) { - property.vendorExtensions.put(JSON_INCLUDE_POLICY_EXTENSION, manualPolicy); + 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(JSON_INCLUDE_POLICY_EXTENSION); + property.vendorExtensions.remove(VendorExtension.X_JACKSON_JSON_INCLUDE_POLICY.getName()); } } else if (Boolean.TRUE.equals(generateJsonIncludeAnnotations)) { String policy = null; @@ -1314,7 +1305,7 @@ public void postProcessModelProperty(CodegenModel model, CodegenProperty propert policy = optionalNonNullPropertyJsonInclude; } if (JsonIncludePolicyUtils.isJsonIncludePolicyEmitted(policy)) { - property.vendorExtensions.put(JSON_INCLUDE_POLICY_EXTENSION, policy); + property.vendorExtensions.put(VendorExtension.X_JACKSON_JSON_INCLUDE_POLICY.getName(), policy); model.imports.add("JsonInclude"); } } 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 aad6f17f5418..1e314a89f7a4 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 @@ -8339,7 +8339,7 @@ void jsonInclude_defaultMatrix() throws IOException { "src/test/resources/3_0/kotlin/required-nullable-4-states.yaml", SPRING_BOOT, Map.of(CodegenConstants.OPENAPI_NULLABLE, "true", - SpringCodegen.GENERATE_JSON_INCLUDE_ANNOTATIONS, "true")); + CodegenConstants.GENERATE_JSON_INCLUDE_ANNOTATIONS, "true")); JavaFileAssert.assertThat(files.get("TestModel.java")) .assertProperty("requiredNonNullable").assertPropertyAnnotations() @@ -8363,7 +8363,7 @@ void jsonSetterNulls_generateFlag_controlsEmission() throws IOException { "src/test/resources/3_0/spring/issue_24401_json_include_per_schema.yaml", SPRING_BOOT, Map.of(CodegenConstants.OPENAPI_NULLABLE, "false", - SpringCodegen.GENERATE_JSON_SETTER_NULLS_ANNOTATIONS, "true")); + CodegenConstants.GENERATE_JSON_SETTER_NULLS_ANNOTATIONS, "true")); assertFileContains(withFlag.get("OptionalNonNullable.java").toPath(), "@JsonSetter(nulls = Nulls.SKIP)"); Map unset = generateFromContract( @@ -8383,8 +8383,8 @@ void jsonInclude_optionalNonNullPolicy_nonEmpty() throws IOException { "src/test/resources/3_0/kotlin/required-nullable-4-states.yaml", SPRING_BOOT, Map.of(CodegenConstants.OPENAPI_NULLABLE, "true", - SpringCodegen.GENERATE_JSON_INCLUDE_ANNOTATIONS, "true", - SpringCodegen.OPTIONAL_NON_NULL_PROPERTY_JSON_INCLUDE, "NON_EMPTY")); + CodegenConstants.GENERATE_JSON_INCLUDE_ANNOTATIONS, "true", + CodegenConstants.OPTIONAL_NON_NULL_PROPERTY_JSON_INCLUDE, "NON_EMPTY")); JavaFileAssert.assertThat(files.get("TestModel.java")) .assertProperty("optionalNonNullable").assertPropertyAnnotations() @@ -8404,8 +8404,8 @@ void jsonInclude_optionalNonNullPolicy_none() throws IOException { "src/test/resources/3_0/kotlin/required-nullable-4-states.yaml", SPRING_BOOT, Map.of(CodegenConstants.OPENAPI_NULLABLE, "true", - SpringCodegen.GENERATE_JSON_INCLUDE_ANNOTATIONS, "true", - SpringCodegen.OPTIONAL_NON_NULL_PROPERTY_JSON_INCLUDE, "NONE")); + CodegenConstants.GENERATE_JSON_INCLUDE_ANNOTATIONS, "true", + CodegenConstants.OPTIONAL_NON_NULL_PROPERTY_JSON_INCLUDE, "NONE")); JavaFileAssert.assertThat(files.get("TestModel.java")) .assertProperty("optionalNonNullable").assertPropertyAnnotations() @@ -8424,7 +8424,7 @@ void jsonInclude_generateJsonIncludeAnnotations_false() throws IOException { "src/test/resources/3_0/kotlin/required-nullable-4-states.yaml", SPRING_BOOT, Map.of(CodegenConstants.OPENAPI_NULLABLE, "true", - SpringCodegen.GENERATE_JSON_INCLUDE_ANNOTATIONS, "false")); + CodegenConstants.GENERATE_JSON_INCLUDE_ANNOTATIONS, "false")); Path modelFile = files.get("TestModel.java").toPath(); assertFileNotContains(modelFile, "@JsonInclude("); @@ -8439,7 +8439,7 @@ 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(SpringCodegen.GENERATE_JSON_INCLUDE_ANNOTATIONS, "false")); + Map.of(CodegenConstants.GENERATE_JSON_INCLUDE_ANNOTATIONS, "false")); JavaFileAssert.assertThat(files.get("TestModel.java")) .assertProperty("overridden").assertPropertyAnnotations() @@ -8464,7 +8464,7 @@ void jsonInclude_perSchemaImports() throws IOException { "src/test/resources/3_0/spring/issue_24401_json_include_per_schema.yaml", SPRING_BOOT, Map.of(CodegenConstants.OPENAPI_NULLABLE, "true", - SpringCodegen.GENERATE_JSON_INCLUDE_ANNOTATIONS, "true")); + CodegenConstants.GENERATE_JSON_INCLUDE_ANNOTATIONS, "true")); // required non-nullable -> @JsonInclude(NON_NULL); no setter machinery JavaFileAssert.assertThat(files.get("RequiredNonNullable.java")) @@ -8495,8 +8495,8 @@ void jsonInclude_perSchemaImports_withoutOpenApiNullable() throws IOException { "src/test/resources/3_0/spring/issue_24401_json_include_per_schema.yaml", SPRING_BOOT, Map.of(CodegenConstants.OPENAPI_NULLABLE, "false", - SpringCodegen.GENERATE_JSON_INCLUDE_ANNOTATIONS, "true", - SpringCodegen.GENERATE_JSON_SETTER_NULLS_ANNOTATIONS, "true")); + 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")) @@ -8517,7 +8517,7 @@ void jsonInclude_manualOverride_emitsImport_whenAnnotationsDisabled() throws IOE Map files = generateFromContract( "src/test/resources/3_0/spring/issue_24401_json_include_per_schema.yaml", SPRING_BOOT, - Map.of(SpringCodegen.GENERATE_JSON_INCLUDE_ANNOTATIONS, "false")); + Map.of(CodegenConstants.GENERATE_JSON_INCLUDE_ANNOTATIONS, "false")); JavaFileAssert.assertThat(files.get("ManualOverride.java")) .hasImports(jsonInclude) @@ -8558,7 +8558,7 @@ void jsonInclude_manualOverride_none_emitsNoAnnotationOrImport() throws IOExcept Map files = generateFromContract( "src/test/resources/3_0/spring/issue_24401_json_include_per_schema.yaml", SPRING_BOOT, - Map.of(SpringCodegen.GENERATE_JSON_INCLUDE_ANNOTATIONS, "true")); + Map.of(CodegenConstants.GENERATE_JSON_INCLUDE_ANNOTATIONS, "true")); JavaFileAssert.assertThat(files.get("ManualNone.java")) .hasNoImports(jsonInclude) @@ -8578,7 +8578,7 @@ void jsonInclude_manualOverride_paddedNone_emitsNoAnnotationOrImport() throws IO Map files = generateFromContract( "src/test/resources/3_0/spring/issue_24401_json_include_per_schema.yaml", SPRING_BOOT, - Map.of(SpringCodegen.GENERATE_JSON_INCLUDE_ANNOTATIONS, "true")); + Map.of(CodegenConstants.GENERATE_JSON_INCLUDE_ANNOTATIONS, "true")); JavaFileAssert.assertThat(files.get("ManualNonePadded.java")) .hasNoImports(jsonInclude) @@ -8595,7 +8595,7 @@ 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(SpringCodegen.GENERATE_JSON_INCLUDE_ANNOTATIONS, "true"))) + Map.of(CodegenConstants.GENERATE_JSON_INCLUDE_ANNOTATIONS, "true"))) .hasStackTraceContaining("x-jackson-json-include-policy") .hasStackTraceContaining("NOT_A_REAL_POLICY"); } 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 e869c1c41a90..e96f9a00f8d3 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 @@ -6540,8 +6540,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", - Map.of(KotlinSpringServerCodegen.GENERATE_JSON_INCLUDE_ANNOTATIONS, "true", - KotlinSpringServerCodegen.GENERATE_JSON_SETTER_NULLS_ANNOTATIONS, "true")); + 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); @@ -6572,8 +6572,8 @@ public void requiredNullable_scenario3_optionalNonNullable_withOpenApiNullable() Map files = generateFromContract( "src/test/resources/3_0/kotlin/required-nullable-4-states.yaml", Map.of(CodegenConstants.OPENAPI_NULLABLE, "true", - KotlinSpringServerCodegen.GENERATE_JSON_INCLUDE_ANNOTATIONS, "true", - KotlinSpringServerCodegen.GENERATE_JSON_SETTER_NULLS_ANNOTATIONS, "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); @@ -6601,8 +6601,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", - Map.of(KotlinSpringServerCodegen.GENERATE_JSON_INCLUDE_ANNOTATIONS, "true", - KotlinSpringServerCodegen.GENERATE_JSON_SETTER_NULLS_ANNOTATIONS, "true")); + 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); @@ -6678,7 +6678,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(KotlinSpringServerCodegen.GENERATE_JSON_SETTER_NULLS_ANNOTATIONS, "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); @@ -6734,7 +6734,7 @@ public void jsonInclude_unset_emitsNoPolicyAnnotations() throws IOException { public void jsonInclude_kotlinMatrix_default() throws IOException { Map files = generateFromContract( "src/test/resources/3_0/kotlin/required-nullable-4-states.yaml", - Map.of(KotlinSpringServerCodegen.GENERATE_JSON_INCLUDE_ANNOTATIONS, "true")); + 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)"), @@ -6755,8 +6755,8 @@ public void jsonInclude_kotlinMatrix_default() throws IOException { public void jsonInclude_optionalNonNullPolicy_none() throws IOException { Map files = generateFromContract( "src/test/resources/3_0/kotlin/required-nullable-4-states.yaml", - Map.of(KotlinSpringServerCodegen.GENERATE_JSON_INCLUDE_ANNOTATIONS, "true", - KotlinSpringServerCodegen.OPTIONAL_NON_NULL_PROPERTY_JSON_INCLUDE, "NONE")); + 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"), @@ -6773,7 +6773,7 @@ public void jsonInclude_optionalNonNullPolicy_none() throws IOException { public void jsonInclude_generateJsonIncludeAnnotations_false() throws IOException { Map files = generateFromContract( "src/test/resources/3_0/kotlin/required-nullable-4-states.yaml", - Map.of(KotlinSpringServerCodegen.GENERATE_JSON_INCLUDE_ANNOTATIONS, "false")); + Map.of(CodegenConstants.GENERATE_JSON_INCLUDE_ANNOTATIONS, "false")); assertFileNotContains(files.get("TestModel.kt").toPath(), "@field:JsonInclude("); } @@ -6786,7 +6786,7 @@ public void jsonInclude_generateJsonIncludeAnnotations_false() throws IOExceptio public void jsonInclude_manualOverride_winsOverGenerateFlag() throws IOException { Map files = generateFromContract( "src/test/resources/3_0/spring/issue_24401_json_include_override.yaml", - Map.of(KotlinSpringServerCodegen.GENERATE_JSON_INCLUDE_ANNOTATIONS, "false")); + 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)"), @@ -6820,8 +6820,8 @@ public void jsonInclude_perSchemaImports() throws IOException { Map files = generateFromContract( "src/test/resources/3_0/spring/issue_24401_json_include_per_schema.yaml", Map.of(CodegenConstants.OPENAPI_NULLABLE, "true", - KotlinSpringServerCodegen.GENERATE_JSON_INCLUDE_ANNOTATIONS, "true", - KotlinSpringServerCodegen.GENERATE_JSON_SETTER_NULLS_ANNOTATIONS, "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(); @@ -6851,7 +6851,7 @@ public void jsonInclude_manualOverride_emitsImport_whenAnnotationsDisabled() thr Map files = generateFromContract( "src/test/resources/3_0/spring/issue_24401_json_include_per_schema.yaml", - Map.of(KotlinSpringServerCodegen.GENERATE_JSON_INCLUDE_ANNOTATIONS, "false")); + Map.of(CodegenConstants.GENERATE_JSON_INCLUDE_ANNOTATIONS, "false")); Path manualOverride = files.get("ManualOverride.kt").toPath(); assertFileContains(manualOverride, jsonInclude); @@ -6892,7 +6892,7 @@ public void jsonInclude_manualOverride_none_emitsNoAnnotationOrImport() throws I Map files = generateFromContract( "src/test/resources/3_0/spring/issue_24401_json_include_per_schema.yaml", - Map.of(KotlinSpringServerCodegen.GENERATE_JSON_INCLUDE_ANNOTATIONS, "true")); + Map.of(CodegenConstants.GENERATE_JSON_INCLUDE_ANNOTATIONS, "true")); Path manualNone = files.get("ManualNone.kt").toPath(); assertFileNotContains(manualNone, jsonInclude); @@ -6911,7 +6911,7 @@ public void jsonInclude_manualOverride_paddedNone_emitsNoAnnotationOrImport() th Map files = generateFromContract( "src/test/resources/3_0/spring/issue_24401_json_include_per_schema.yaml", - Map.of(KotlinSpringServerCodegen.GENERATE_JSON_INCLUDE_ANNOTATIONS, "true")); + Map.of(CodegenConstants.GENERATE_JSON_INCLUDE_ANNOTATIONS, "true")); Path manualNonePadded = files.get("ManualNonePadded.kt").toPath(); assertFileNotContains(manualNonePadded, jsonInclude); @@ -6927,7 +6927,7 @@ public void jsonInclude_manualOverride_paddedNone_emitsNoAnnotationOrImport() th 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(KotlinSpringServerCodegen.GENERATE_JSON_INCLUDE_ANNOTATIONS, "true"))); + Map.of(CodegenConstants.GENERATE_JSON_INCLUDE_ANNOTATIONS, "true"))); java.io.StringWriter sw = new java.io.StringWriter(); thrown.printStackTrace(new java.io.PrintWriter(sw)); @@ -7220,7 +7220,7 @@ public void testIssue24139NullableRefNoJsonSetterNullsFail() throws IOException Map additionalProperties = new HashMap<>(); additionalProperties.put("useBeanValidation", true); additionalProperties.put("openApiNullable", "true"); - additionalProperties.put(KotlinSpringServerCodegen.GENERATE_JSON_SETTER_NULLS_ANNOTATIONS, "true"); + additionalProperties.put(CodegenConstants.GENERATE_JSON_SETTER_NULLS_ANNOTATIONS, "true"); Map files = generateFromContract( "src/test/resources/3_1/issue_24139.yaml", From 3dbcd998eca705941903ce01ff4df6dba95765a1 Mon Sep 17 00:00:00 2001 From: Jachym Metlicka Date: Fri, 24 Jul 2026 17:43:18 +0200 Subject: [PATCH 12/12] feat(json-include): add @JsonSetter(nulls = Nulls.SKIP) for fields with Lombok setters --- .../main/resources/JavaSpring/pojo.mustache | 8 +++---- .../java/spring/SpringCodegenTest.java | 23 +++++++++++++++++++ 2 files changed, 26 insertions(+), 5 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/pojo.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/pojo.mustache index bfd4acbfc98b..b7f28efc82e9 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/pojo.mustache @@ -65,6 +65,9 @@ public {{>sealed}}class {{classname}}{{#parent}} extends {{{parent}}}{{/parent}} {{#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 @@ -247,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/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java index 1e314a89f7a4..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 @@ -8373,6 +8373,29 @@ void jsonSetterNulls_generateFlag_controlsEmission() throws IOException { 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}).