I am using the latest version of the Firebase dependency, which is 1.0.2, and I am having problems getting my pojos to figure it out correctly.
The fact is that at any moment the scheme can change, but I do not want my application to crash with this:
D / AndroidRuntime (14097): shutdown VM W / dalvikvm (14097): threadid = 1: thread output with an uncaught exception (group = 0x40a451f8) E / AndroidRuntime (14097): FATAL EXCEPTION: main E / AndroidRuntime (14097): com. firebase.client.FirebaseException: crash for type selection E / AndroidRuntime (14097): when com.firebase.client.DataSnapshot.getValue (DataSnapshot.java:213)
Looking into the dependency tree, I realized that Firebase uses Jackson mapper 1.9.7, so the @JsonIgnoreProperties(ignoreUnknown = true") annotation is not an option. Moreover, the mapper object is wrapped into this Firebase object, so I cannot configure the DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES property DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES ( DeserializationConfig.Feature.FAIL_ON_UNKNOWN_PROPERTIES for Jackson 1.9 and earlier).
Is there a way to set this property both as an annotation at the class level, and when setting up a display device or any other mechanism?
The best solution would be for Firebase 1.0.3 to start using Jackson 2.0, but I don't know if this is really what they care about right now.
Note. I already thought about eliminating the transitive dependency of Jackson 1.9.7 and adding Jackson 2.0 so that I can access this ignoreUnknown function, but I don't think this is a viable choice, since I would change the mayor.
source share