-
Notifications
You must be signed in to change notification settings - Fork 461
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
Support bidirectional marshalling/unmarshalling #1198
Comments
Hey @nghtstr, we don't currently guarantee that the data structures in stripe-go marshal and unmarshal bidirectionally like you might expect. Most of them do, but there's a few places where structures need some pretty edgy custom Lines 333 to 353 in 6bbf083
If you want to store Stripe data somewhere, we'd recommend mapping the stripe-go structures to your own internal variant of such — that way you have full control over how marshaling and unmarshaling works, and won't be broken by any future changes that we might make. |
Per some internal discussion, bidirectional marshalling/unmarshalling would be a nice-to-have, so I'm rebranding this as a feature request. |
When I get a
customer
, and expand thesources
; if the source is of typeSource
, it does not json.Marshal correctly. Here is some basic code demonstrating that the code should work as expected:The array of
customer.Sources.Data
does give the appropriateSourceObject
but it does notjson.Marshal
correctly.The text was updated successfully, but these errors were encountered: