sdouglass / spring-social-tumblr

Spring Social client implementation for Tumblr
Apache License 2.0
17 stars 12 forks source link

Update BlogInfoMixin.java #10

Closed ghost closed 11 years ago

ghost commented 11 years ago

Add @JsonIgnoreProperties(ignoreUnknown=true)

sdouglass commented 11 years ago

Hi! Thanks for your pull request and issue. I was thinking of taking a slightly different approach for handling the case of Tumblr adding new data to their API responses. I was thinking of adding a Map field to each class, then creating a method annotated with @JsonAnySetter, and in that method putting the arguments into the Map. That would accomplish two things: 1) no more errors on new fields, 2) new fields would be stored somewhere and could be accessed (albeit in a way that's a bit inconvenient) instead of them just being ignored and inaccessible. What do you think? I was hoping to get this change in sometime in the next 24 hours. Here's a URL with a description of our @JsonAnySetter works: http://wiki.fasterxml.com/JacksonHowToIgnoreUnknown

sdouglass commented 11 years ago

I pushed some changes which should address Tumblr adding new data to their responses going forward. Unrecognized fields will be in a Map<String, Object> in every response object called "properties" accessible via a "getProperties()" method. I've tested locally and I don't get this exception anymore. If you have a chance to get the latest code or the new 1.0a1 version (see the updated README) let me know if it works for you.

sdouglass commented 11 years ago

I'm going to close this issue, as the changes I pushed should handle this and other similar new fields Tumblr adds to their APIs. If you have problems please open a new issue. Thanks!