spring boot Jackson忽略字段不序列化字段

使用JsonIgnoreProperties注解忽略多个字段

@JsonIgnoreProperties({ "summary", "author" })
public class ArticleIgnoreProperties {
 
	private String title;
	private String summary;
	private String content;
	private String author;
 
	// 省略getter、setter方法
 
	@Override
	public String toString() {
		return "ArticleIgnoreProperties [title=" + title + ", summary=" + summary + ", content=" + content + ", author="
		        + author + "]";
	}
 
}
posted @ 2021-01-29 15:35  明月,  阅读(2339)  评论(0编辑  收藏  举报