Skip to content

v1 converter doesn't check the required attributes #33

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
Feng-Yin opened this issue Apr 27, 2020 · 1 comment
Closed

v1 converter doesn't check the required attributes #33

Feng-Yin opened this issue Apr 27, 2020 · 1 comment
Assignees

Comments

@Feng-Yin
Copy link

A json CE without required attributes can still pass the FromRequest, e.g. without id

data = { "specversion": "string", "datacontenttype": "string", "data": "Unknown Type: object,string", "data_base64": "string", "time": "2020-04-24T10:58:14.315Z", "dataschema": "string", "subject": "string", "type": "string", "source": "string" } marshaller.FromRequest( v1.Event(), dict(request.headers), io.StringIO(json.dumps(data)), lambda x: x )
meanwhile,
the v1.Event() doens't enforce the value of specversion in structured mode.
the data_base64 is put into extensions instead of treating as an optional attribute.

@cumason123
Copy link
Contributor

required attributes are now validated in http_events.CloudEvent class. Will work on the data_base64 at a later date

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