Hi! I am trying to figure out a good way to handle Tumblr adding new fields to their responses, in my Spring Social Tumblr code. (https://github.com/sdouglass/spring-social-tumblr) I don't think just putting @JsonIgnoreProperties(ignoreUknown=true) on my classes is the best solution, as the new fields then are ignored and inaccessible. I'd like to try to use @JsonAnySetter to store the unknown values in a Map so that deserialization won't break if there are new fields and so people can still access them if necessary. So far I've used Jackson Mixins but now I'm thinking I'm going to wind up needing to modify all my data classes and all my mixins and making mixins for data classes where I didn't have them before, to add this new functionality. That seems like a lot of work, vs. if I were just directly annotating my data classes I could just create a new base class for them that has a Map<String, Object> and a @JsonAnySetter annotated method they could all inherit.
Anyway, mixins seem cool in that they keep my data classes free of Jackson annotations but now they're feeling like a roadblock to what I want to do. So my question is, is it OK to skip mixins for a Spring Social library and just directly annotate classes with Jackson annotations? Most of the examples I worked from used mixins, so I'm wondering if that's a best practice I should stick to even if it becomes time consuming and unwieldy.
Anyway, mixins seem cool in that they keep my data classes free of Jackson annotations but now they're feeling like a roadblock to what I want to do. So my question is, is it OK to skip mixins for a Spring Social library and just directly annotate classes with Jackson annotations? Most of the examples I worked from used mixins, so I'm wondering if that's a best practice I should stick to even if it becomes time consuming and unwieldy.