Jersey/Jackson @JsonIgnore on setter

后端 未结 5 1112
暗喜
暗喜 2021-02-13 18:28

i have an class with the following annotations:

class A {
public Map> references;

@JsonProperty
public Map

        
5条回答
  •  天涯浪人
    2021-02-13 19:13

    I used @JsonIgnore on my getter and it didn't work and I couldn't configure the mapper (I was using Jackson Jaxrs providers). This worked for me:

    @JsonIgnoreProperties(ignoreUnknown = true, value = { "actorsAsString",
        "writersAsString", "directorsAsString", "genresAsString" }) 
    

提交回复
热议问题