java - UnrecognizedPropertyException after changing structure of Firebase data -


there little problem firebase , firebase snapshot.getvalue(mmodelclass)

i have android app wich contains user list(model class - user.java) , interacts firebase, structure:

-user --$user_id ---name ---surname 

i've published app, , want update app, add new field user structure in firebase:

-user --$user_id ... --status 

if it, published app crash because old model - user.java doesn't has status field , can't edit pubslished version

crash text:

caused by: com.fasterxml.jackson.databind.exc.unrecognizedpropertyexception: unrecognized field "status" (class package.user), not marked ignorable (2 known properties: , "name", "surname"]) 

finally found answer:

import org.codehaus.jackson.annotate.jsonignoreproperties;  @jsonignoreproperties(ignoreunknown = true)    public class foo {      ... } 

https://stackoverflow.com/a/5455563/2897046


Comments

Popular posts from this blog

javascript - How to get current YouTube IDs via iMacros? -

c# - Maintaining a program folder in program files out of date? -

emulation - Android map show my location didn't work -