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
Would it make sense to update this SDK so that users can easily transform json strings into objects whose types match those defined in the CDEvent spec?
We currently have some code that looks like this
some_json_str = '...' # this could be consumed from kafka or some http service
typed_msg = CDEventMsgFactory.from_json(some_json_str)
if isinstance(typed_msg, Taskrunstarted):
# do something...
elif isinstance(typed_msg, Taskrunfinished):
# do something...
etc...
Along with verifying that the json is valid, we can also do some additional checks, like checking enum values, as specified in the schema.
We can then also go back to json with something like
Expected Behavior
Users often interact with objects in json format.
Would it make sense to update this SDK so that users can easily transform json strings into objects whose types match those defined in the CDEvent spec?
We currently have some code that looks like this
Along with verifying that the json is valid, we can also do some additional checks, like checking enum values, as specified in the schema.
We can then also go back to json with something like
Actual Behavior
We wrote our own internal libraries, but we think it would be good to share this code, for others to re-use.
Steps to Reproduce the Problem
n/a
Specifications
The text was updated successfully, but these errors were encountered: