본문 바로가기
Spring/Spring boot

deserialize와 serialize시에 사용할 VO의 필드를 각각 다르게 정해서 사용하기위한 애너테이션

by fabxoe 2020. 2. 4.

@JsonIgnoreProperties(value={ "module_name" }, allowSetters= true)

해당 에너테이션의 value에 적는 필드는 기본적으로 deserialize, seriallize 둘다에서 제외된다.

이렇게 제외할 것을 기반으로

그 다음에야 허용할 것을 선택하기 위해서 옵션으로 allowSetter나 allowGetter를 작성한다.

https://www.concretepage.com/jackson-api/jackson-jsonignore-jsonignoreproperties-and-jsonignoretype#allowGetters

 

Jackson @JsonIgnore, @JsonIgnoreProperties and @JsonIgnoreType

This page will walk through Jackson @JsonIgnore, @JsonIgnoreProperties and @JsonIgnoreType annotations example. These annotations are used to ignore logical properties in JSON serialization and deserialization.

www.concretepage.com

 

댓글