简体   繁体   中英

Android RestTemplate json deserialization

I need to write a Json client in Android for Zenfolio API. I decided to use Spring ResTemplate with MappingHttpJacksonConverter. When i do POST with "exchange" method i recieve json response with one element named "@type" that causes deserializatoon exception. Is there an annotation that tells deserializer to omit that tag? How to turn on annotation for json deserializer?

Try @JsonIgnoreProperties(ignoreUnknown=true) on your mapping classes if you want to ignore all elements that you are not interested in.

Try using @JsonIgnore ("@type") , Jackson annotations are enabled by default.

See http://wiki.fasterxml.com/JacksonAnnotations for more info.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM