Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Spring] Resolve default value issue with Lombok Builder #18690

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -81,6 +81,7 @@ public static StatusEnum fromValue(String value) {

private StatusEnum status;

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

public Order id(Long id) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,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
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ public static StatusEnum fromValue(String value) {

private StatusEnum status;

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

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,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