0

Firebase Java SDK underlying use gson to serialize / deserialize pojo. In my class I set the annotation @SerializedName for the serialized json field name. However, after the data was saved to firebase database, the field name is not the value in my SerializedName annotation.

How can I set a customized serializer for forebase java sdk?

KENdi
  • 7,576
  • 2
  • 16
  • 31
Nathan
  • 128
  • 3
  • 12

1 Answers1

3

You need to use the @PropertyName("") annotation

Boris
  • 412
  • 1
  • 5
  • 14
  • Check this thread for better usage https://stackoverflow.com/questions/45306168/firebase-serialization-names – Nathan Dec 16 '17 at 21:40