Does Firestore support writing to document from Groovy objects? #996
Labels
api: firestore
Issues related to the googleapis/java-firestore API.
type: question
Request for information or clarification. Not an issue.
Question:
Does the Firestore client library currently (or have plans to) support writing data to document from Groovy objects?
Context:
Spring Cloud GCP currently calls the client library to serialize objects and convert them into documents for Firestore, but have received an issue (GoogleCloudPlatform/spring-cloud-gcp#939) regarding Groovy objects which have additional hidden fields. In particular, the hidden field
metaClass.additionalMetaMethods
is of type array and cannot be serialized byCustomClassMapper
.Looking at the existing logic in
CustomClassMapper
to filter out transient fields, it seems like traversing the class hierarchy would reach the Superclassgroovy.lang.MetaClassImpl
beforejava.lang.Object
. Unlike theUser
subclass’smetaClass
field, these Superclass fields are not marked as transient and therefore getting serialized.cc: @elefeint
Snippets to reproduce issue in Java:
User.groovy
Application.java
Error stack trace:
The text was updated successfully, but these errors were encountered: