-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Closed
Milestone
Description
Hey,
I was hoping to make use of @JsonProperty(access = Access.READ_ONLY), but failed.
Assume this class:
public class TestPojo
{
private String firstName;
private String lastName;
@JsonProperty(access = Access.READ_ONLY)
public String getFullName()
{
return firstName + " " + lastName;
}
public String getFirstName()
{
return firstName;
}
public void setFirstName(String firstName)
{
this.firstName = firstName;
}
public String getLastName()
{
return lastName;
}
public void setLastName(String lastName)
{
this.lastName = lastName;
}
}
I couldn't find a way to stop the deserializer from attempting to deserialize the field "fullName".
The only thing that helps is to create a setter and annotate it with @JsonIgnore
. However, that setter does not make sense and I don't want to have it. Is this a bug in behaviour or am I missing something? Thanks
heruan, myjpa, YashAryaWisc and FibreFoX
Metadata
Metadata
Assignees
Labels
No labels