You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
It currently seems impossible to use a Groovy class as the object to save to Firestore due to the object mapping attempting to map some of the "hidden" fields that Groovy automatically adds to every class. I don't think there is any available configuration which allows for excluding these fields.
Sample
Data.groovy
@Document
class Data {
@DocumentId
String id
}
Attempting to save this document will generate this error:
reactor.core.Exceptions$ErrorCallbackNotImplemented: java.lang.IllegalArgumentException: Could not serialize object. Serializing Arrays is not supported, please use Lists instead (found in field 'metaClass.additionalMetaMethods')
Caused by: java.lang.IllegalArgumentException: Could not serialize object. Serializing Arrays is not supported, please use Lists instead (found in field 'metaClass.additionalMetaMethods')
I think there would be two relatively simple solutions that I would like to use. One would be to configure the mapper to always ignore certain classes MetaClass in this case, or allow the Exclude annotation to be applied to the class level and provide string properties to exclude. This would allow me to exclude the metaClass since I am unable to annotate it.
The text was updated successfully, but these errors were encountered:
Spring Data already has handling for excluding such autogenerated fields, so this is likely a matter of finding where the Firestore implementation missed plugging into the property exclusion process.
We've looked into this some more, and the object-to-document functionality lives entirely in the client library. I will close this issue; please watch googleapis/java-firestore#996 for updates.
Describe the bug
It currently seems impossible to use a Groovy class as the object to save to Firestore due to the object mapping attempting to map some of the "hidden" fields that Groovy automatically adds to every class. I don't think there is any available configuration which allows for excluding these fields.
Sample
Data.groovy
Attempting to save this document will generate this error:
I think there would be two relatively simple solutions that I would like to use. One would be to configure the mapper to always ignore certain classes
MetaClass
in this case, or allow theExclude
annotation to be applied to the class level and provide string properties to exclude. This would allow me to exclude themetaClass
since I am unable to annotate it.The text was updated successfully, but these errors were encountered: