Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new official supported types #191

Closed
fgruchala opened this issue Apr 21, 2020 · 2 comments · Fixed by #196
Closed

Add new official supported types #191

fgruchala opened this issue Apr 21, 2020 · 2 comments · Fixed by #196
Assignees
Labels
api: firestore Issues related to the googleapis/java-firestore API. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@fgruchala
Copy link

Thanks for stopping by to let us know something could be better!

Is your feature request related to a problem? Please describe.
Yes, we want to map BigDecimal or LocalDateTime object in our Firestore database.
For now, we have these problems :

java.lang.IllegalArgumentException: Could not serialize object. Numbers of type BigDecimal are not supported, please use an int, long, float or double (found in field 'insurances.liability.amount.value')
	at com.google.cloud.firestore.CustomClassMapper.serializeError(CustomClassMapper.java:555) ~[google-cloud-firestore-1.32.4.jar:1.32.4]

Describe the solution you'd like
I would like official mappers for conventionnal Java types.

Describe alternatives you've considered
Create our custom (De)Serializer but I think that it can be a good thing for the lib.

Additional context

@suraj-qlogic suraj-qlogic transferred this issue from googleapis/google-cloud-java Apr 21, 2020
@product-auto-label product-auto-label bot added the api: firestore Issues related to the googleapis/java-firestore API. label Apr 21, 2020
@BenWhitehead BenWhitehead added the type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. label Apr 21, 2020
@athakor athakor self-assigned this Apr 24, 2020
@BenWhitehead
Copy link
Collaborator

Hi @fgruchala I think one of the potential concerns here is the BigDecimal can not necessarily fit into a double so there is potential for this to fail at serialization time. How are you handling that case now with your existing code?

@fgruchala
Copy link
Author

Hi @BenWhitehead

Simply as a string.

Thanks for your work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: firestore Issues related to the googleapis/java-firestore API. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants