-
Notifications
You must be signed in to change notification settings - Fork 159
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
ZonedDateTime field limits interoperability #29
Comments
The CloudEvent spec defines the |
I'm using the SDK on both sides, but the JSON serialization happens at another level, based on |
Hi, just returning from the holiday break. It seems to be a limitation on GSON itself: Looks like a custom |
I think it's more a limitation of JSON itself. Any Java deserializer will need custom configuration if, e.g., a type does not have a default constructor. Jackson requires |
I think we could try that - it's IMO a PITA that we face this limitation
:-(
…On Mon, Jan 7, 2019 at 2:38 PM David Turanski ***@***.***> wrote:
I think it's more a limitation of JSON itself. Any Java deserializer will
need custom configuration if, e.g., a type does not have a default
constructor. Jackson requires ZonedDateTimeDeserializer and GSON requires
the corresponding thing. This makes DefaultCloudEventImp less usable.
Would it be possible to represent time as a more JSON friendly value object
that validates RFC 3339?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#29 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAJnzuWS2F7EJJONGjoKmljaoXD_xO7Yks5vA0xQgaJpZM4ZoTgX>
.
--
Matthias Wessendorf
github: https://github.com/matzew
twitter: http://twitter.com/mwessendorf
|
@dturanski Any insights on that? |
I would go with a String representation of the ISO-8601 standard. |
@dturanski Could you create a PR with this solution? |
@fabiojose - I'll see what I can do |
The PR addresses the date issue but more is needed for GSON compatibility in general. There are numerous Jackson annotations now which make |
Any updates on this? |
@fabiojose - Any thoughts on merging the PR? @AceHack - Is there a specific issue you are dealing with? |
Hi @dturanski, I think i'm going to mark this issue as invalid since in sdk v2 we don't use anymore jackson annotations and the implementation of json ser/de is hugely simplified thanks to the |
Currently the
time
field is aZonedDateTime
. This requires a custom deserializerZonedDateTimeDeserializer
implemented with jackson. Sending a CloudEvent via http then causes problems on the receiving end. IMHO It would be better to represent time with a more portable type, e.g., long.The text was updated successfully, but these errors were encountered: