로딩
티스토리 데이터 처리 중입니다.

[자바, 스프링부트] Unrecognized field ,not marked as ignorable

 [자바, 스프링부트] Unrecognized field ,not marked as ignorable

Json 을 Dto(객체)로 매핑할 때 Dto에 명시되지 않은 변수(속성)이 전달받은 Json 데이터에 들어있으면 발생 방법은 여러가지가 있으나 대표적 3가지가 있습니다. 1. ObjectMapper 를 설정하여 사용.

Bean으로 등록하여 사용할 수도 있습니다. @Configuration public class ObjectMapperConfig { @Bean public ObjectMapper objectMapper(){ ObjectMapper mapper = new ObjectMapper(); mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES,false); return mapper; } } 2.

@JsonIgnorePropertie.....