amazon-ion / ion-go

A Go implementation of Amazon Ion.
https://amazon-ion.github.io/ion-docs/
Apache License 2.0
174 stars 31 forks source link

Unmarshaler interface #184

Closed lindlof closed 2 years ago

lindlof commented 3 years ago

The Marshaler interface is provided for marshaling custom types to ion. However, no interface is provided for unmarshaling from ion. Is there some technical reason to not provide this?

It would be immensely helpful for building types which are interoperable with both ion and json. Specifically, we're looking to have decimal and timestamp types which are interoperable with both ion and json.

fernomac commented 3 years ago

As far as I remember (it's been a while), no I just never got around to it. 😅 Taking a quick look, I think it should just be a matter of defining the interface and dropping something like this in here?

errorhandler commented 2 years ago

Just jumping into 👍🏻 the need for this, I've thrown together a quick branch here that I'm happy to contribute back!

desaikd commented 2 years ago

Thanks for putting together a quick branch @errorhandler! Can you please create a pull request for this? It would be easier for us to review it over there.

popematt commented 2 years ago

I'm going to close this now that #185 has been merged. Thanks to @errorhandler for implementing this!