-
Notifications
You must be signed in to change notification settings - Fork 31
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
ion.Timestamp marshal/unmarshal issue - v 1.0.1 #170
Comments
This Ion library provides its own Marshal/Unmarshal (as Ion can be richer than JSON). |
Hey, possible, the Issue on our site occurred when we added a cache solution. |
Hey, type example struct {
Metadata struct {
Id string `ion:"id"`
Version int `ion:"version"`
TxTime ion.Timestamp `ion:"txTime"`
} `ion:"metadata"`
} The field TxTime is ignored. |
Hi @joao-reis, based on what I understood form your description, I wrote the following test and it seems to be working fine:
Can you please clarify how your code is different from this, which results in the mentioned unexpected behaviour? |
Hey @Armanbqt , So the test works perfectly 👍 The problem here is to show the MetadataStruct in a browser after the unmarshal for example, in this case the field TxTime appear as |
Glad to hear you found a workaround. However, if you provide some code snippet, I might be able to help further. |
@R-maan, @therapon, @tgregg we are also facing the same issue because ion.Timestamp does not implement MarshalJSON /UnmarshaJSON. what we are trying to do is this -
any thoughts ? can we expect implementation of json Marshaller/unmarshaller, |
Hey guys,
I noticed that after marshal/unmarshal Timestamp type we are getting invalid results - a test was done on current version v1.0.1
test case - one fom your interanl test
tmp := ion.NewTimestamp(time.Date(2010, 1, 1, 0, 0, 0, 0, time.UTC), ion.TimestampPrecisionSecond, ion.TimezoneUTC)
=> tmp 2010-01-01T00:00:00Z - OK
var jsonData []byte
jsonData, _ = json.Marshal(tmp)
var out = new(helpers.IonTimestamp)
_ = json.Unmarshal(jsonData, &out)
fmt.Println("out", out.String())
==>>
out 0001-01-01T00:00:00Z
The text was updated successfully, but these errors were encountered: