Skip to content

Commit

Permalink
[Spring] Resolve default value issue with Lombok Builder (#19855)
Browse files Browse the repository at this point in the history
* merge PR 18690

* update samples
  • Loading branch information
martin-mfg authored Jan 9, 2025
1 parent 9fcbdb9 commit d30220b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ public static StatusEnum fromValue(String value) {

private @Nullable StatusEnum status;

@lombok.Builder.Default
private Boolean complete = false;

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<>();

Expand Down

0 comments on commit d30220b

Please sign in to comment.