In our Firebase database json tree, we have a property name "creation-date". We are now upgrading to Firebase 9 and have a problem, since this name contains a hyphen and therefore is not a valid java identifier.
In prior versions of Firebase, we could use the Jackson annotation:
@JsonGetter("creation-date") // This does not exist in Firebase9
public long getCreationDate() {
return creationDate;
}
public void setCreationDate(long creationDate) {
this.creationDate = creationDate;
}
However, this does not work in Firebase 9 since it no longer uses Jackson and instead uses it's own custom serializer. I did find replacements for other annotations, (i.e., @JsonIgnore
-> @Exclude
) however I don't see any annotation equivalent of @JsonGetter
.
How can I control the serialized name of a property in Firebase 9?