Skip to content

Implement to_json and from_json #67

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

Closed
cumason123 opened this issue Jul 20, 2020 · 3 comments
Closed

Implement to_json and from_json #67

cumason123 opened this issue Jul 20, 2020 · 3 comments

Comments

@cumason123
Copy link
Contributor

to_json and from_json in cloudevents.sdk.http.event.py raises notimplemented error

@cumason123
Copy link
Contributor Author

cumason123 commented Jul 22, 2020

@evankanderson you had mentioned the creation of to_json and from_json methods previously. I would like clarification on what you thought the json should consist of. I'm unsure if to_json should return a json object which looks like this:

{"attributes": ..., "data": ...}

The above would allow users to directly read the data and pass it into the CloudEvent constructor. Another option could be more HTTP oriented such as:

{"headers": ..., "body": ...}

Let me know what you had in mind!

@evankanderson
Copy link
Contributor

I was thinking of the json data exchange format defined here:

https://github.com/cloudevents/spec/blob/v1.0/json-format.md

@evankanderson
Copy link
Contributor

Note that the payload may be encoded as either data or data_base64, depending on its contents.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants