java - How to ignore new fields for an object model with Firebase 1.0.2 -
i'm using last version at moment of firebase dependency, 1.0.2 , i'm having problems getting pojos parsed correctly.
the thing is, @ time schema can changed don't want app crash this:
d/androidruntime(14097): shutting down vm w/dalvikvm(14097): threadid=1: thread exiting uncaught exception (group=0x40a451f8) e/androidruntime(14097): fatal exception: main e/androidruntime(14097): com.firebase.client.firebaseexception: failed bounce type e/androidruntime(14097): @ com.firebase.client.datasnapshot.getvalue(datasnapshot.java:213)
looking dependency tree firebase using jackson mapper 1.9.7, annotation @jsonignoreproperties(ignoreunknown = true") not option. moreover, object mapper wrapped firebase object can't configure deserializationfeature.fail_on_unknown_properties property (deserializationconfig.feature.fail_on_unknown_properties jackson 1.9 , before).
is there way set property, either class-level annotation or configuring mapper or other mechanism whatsoever?
the best solution firebase 1.0.3 started using jackson 2.0, don't know if care right now.
note: i've thought excluding transitive jackson 1.9.7 dependency , adding jackson 2.0 can access ignoreunknown feature, don't think viable choice since changing mayor version.
for have moved on google's official version of firebase (as of may 29, 2016), can use @exclude instead of @jsonignore or @jsonproperty. here link document.
example:
public class datapacket{ public string data; ... @exclude public string getdata(){return data;} }
Comments
Post a Comment