sasha-tkachev/fastapi-cloudevents

`type` is not present in real eventarc bodies

br-follow opened this issue · 3 comments

Describe the bug
When using this package's CloudEvent type as a request object, event requests fail due to 422 errors:

[ErrorWrapper(exc=ValidationError(model='CloudEvent', errors=[{'loc': ('type',), 'msg': 'field required', 'type': 'value_error.missing'}]), loc=('body',))]

The type field is not in the request body, but rather, it is present in the Ce-Type header.

To Reproduce
Run this against real events from eventarc

System Details (please complete the following information):

  • Python Version: 3.10.0
  • FastAPI Version: 0.88

Thank you for the bug report! We will look into it soon

Sorry but I'm not familiar with eventarc.
Can you provide here please a sample HTTP or JSON event so I can debug it?

@br-follow, re-open if it is still relevant