-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Open
Labels
builder-relatedIssue related to handling of Builder-style deserializationIssue related to handling of Builder-style deserialization
Description
When using @JsonProperty(required = true)
with creator/factory (@JsonCreator
annotation), an exception is raised if a required field is missing (as expected).
It is possible to have the same feature when using a builder to deserialize?
Sorry if this request is duplicate or already present, but I couldn't find it at issues list, forum, neither as configuration on the ObjectMapper documentation.
Tested with Jackson version 2.10.2, using the following code:
@JsonDeserialize(builder = Person.Builder.class)
public class Person {
@JsonProperty(required = true)
private final String name;
...
public static class Builder {
public Builder withName(String value) {...}
public Person build() {...}
}
}
remal and garfieldnate
Metadata
Metadata
Assignees
Labels
builder-relatedIssue related to handling of Builder-style deserializationIssue related to handling of Builder-style deserialization