[retrofit2] JacksonConverterFactory ignore unknown properties

Logan. K.
Logan. K.
Aug 24, 2017 · 1 min read

Retrofit의 jacksonConverterFactory는 default로 unknown properties를 ignore하지 않는다고 하네요.

com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field “room” 

필요한 것만 가져오고 정의하고 싶은 경우 ObjectMapper를 이용해야 할 것 같습니다.

ObjectMapper의 DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES를 이용해서 해결했습니다.

)
Logan. K.

Written by

일찍 일어나라 그리고 열심히 일해라. 성공을 위한 법칙은 이것 뿐이다. B형. 얼리버드. 개발자. DevOoops.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade