[Spring] Resolve default value issue with Lombok Builder (#19855)

* merge PR 18690

* update samples
This commit is contained in:
martin-mfg 2025-01-09 08:40:50 +01:00 committed by GitHub
parent 9fcbdb95d9
commit d30220b8df
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 8 additions and 0 deletions

View File

@ -66,6 +66,11 @@ public class {{classname}}{{#parent}} extends {{{parent}}}{{/parent}}{{^parent}}
{{#vendorExtensions.x-field-extra-annotation}}
{{{vendorExtensions.x-field-extra-annotation}}}
{{/vendorExtensions.x-field-extra-annotation}}
{{#lombok.Builder}}
{{#defaultValue}}
@lombok.Builder.Default
{{/defaultValue}}
{{/lombok.Builder}}
{{#deprecated}}
@Deprecated
{{/deprecated}}

View File

@ -78,6 +78,7 @@ public class Order {
private @Nullable StatusEnum status;
@lombok.Builder.Default
private Boolean complete = false;
}

View File

@ -39,9 +39,11 @@ public class Pet {
private String name;
@lombok.Builder.Default
@Valid
private List<String> photoUrls = new ArrayList<>();
@lombok.Builder.Default
@Valid
private List<@Valid Tag> tags = new ArrayList<>();