-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Firestore: Support Custom Marsheling and Unmarsheling #1416
Comments
Could you provide a small code snippet how you're passing google/uuid to firestore? |
I added a field named type State struct {
ID uuid.UUID `firestore:"id"`
Capital string `firestore:"capital"`
Population float64 `firestore:"pop"` // in millions
} |
Hi @jadekler , Do you have any comment? |
Looks like the issue is that we don't handle arrays properly (uuid.UUID is a byte array). I've submitted a CL to fix this: https://code-review.googlesource.com/c/gocloud/+/40996 |
Right, that's because uuid.UUID is an array of bytes. :) If you're looking for a string representation, you will have to change the type and do the string conversion yourself. |
@jadekler : If firestore support |
Hi @jadekler , I created a PR to support encoding/text https://github.com/googleapis/google-cloud-go/pull/1425/files |
@giautm @jadekler I stumbled upon this for a similar (but not exact) reason: it would be really helpful if the client also supported custom JSON Marshaler/Unmarshaler interfaces Do you mind re-opening this issue or maybe I can create a new/separate issue for it? Thanks |
@marwan-at-work Yes, please file a new issue. |
@jadekler done (#1475) |
I wish firestore support custom data type as (google/uuid) via custom marshal/unmarshal.
Currently:
firestore: cannot convert type uuid.UUID to value
The text was updated successfully, but these errors were encountered: