Write-only properties with Jackson

前端 未结 2 2079
再見小時候
再見小時候 2021-01-12 02:28

In my entity class, I\'m trying to make a write-only field (gets ignored during serialization, but gets de-serialized normally).

@JsonProperty
@JsonSerialize         


        
2条回答
  •  北恋
    北恋 (楼主)
    2021-01-12 02:55

    You can set access value:

    @JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
    private String password;
    

提交回复
热议问题