You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was wondering how to write a polymorphic parser for JSON CloudEvents, where the payload can be one of many types.
Normally, with plain Jackson one can do something like this, using @JsonTypeInfo and a type field somewhere in the JSON to determine the specific class for deserialization.
In this simple example in the CloudEvent SDK docs we knew the type in advance:
I was wondering how to write a polymorphic parser for JSON CloudEvents, where the payload can be one of many types.
Normally, with plain Jackson one can do something like this, using
@JsonTypeInfo
and atype
field somewhere in the JSON to determine the specific class for deserialization.In this simple example in the CloudEvent SDK docs we knew the type in advance:
But in my case, I would like to achieve something like the following:
Running this code, it results in an error (as expected):
Because the type field is part of the CloudEvent header and/or envelope that Jackson does not know about at this point.
What's your take on this?
The text was updated successfully, but these errors were encountered: