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

Load Balancing in Bluemix using custom domain and DNS SRV records -

oracle - pls-00402 alias required in select list of cursor to avoid duplicate column names -

python - Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>] error -