JsonIgnoreProperties not working

后端 未结 4 1761
故里飘歌
故里飘歌 2021-01-07 17:54

I have the following simple class:

import org.codehaus.jackson.annotate.JsonIgnoreProperties;
@JsonIgnoreProperties({ \"thirdField\" })
public class Message          


        
4条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-07 18:22

    You've mixed different versions of Jackson. Notice that you import JsonIgnoreProperties from org.codehaus.jackson.annotate (version 1.x) while you're using ObjectMapper from com.fasterxml.jackson.databind (version 2.x).

提交回复
热议问题