I have this pojo class, which is used as apart of REST request
@Data
@Builder
public class ListRequest {
@ApiModelProperty(
value = "Language, default=en",
allowableValues = "fr, de, sv, en",
example = "en"
)
private Language language=Language.en;
@Transient
@ApiModelProperty(hidden = true)
private String apiVersion = "v4";
}
I expect that the value of language
will be Language.en
if it is missing from the service request
However it is always null
.
It is Java 101 to initialize the variable that way, so I guess it is Lombok which made this issue.
Any idea what is the issue here?
EDIT: I use neither the constructor nor the builder in my code, its the spring boot who instantiate the objects.