Open olitomlinson opened 1 year ago
source
, type
, specversion
, and time
(other fields may receive the default null value). No other fields are modified. This should not be interpreted as an attempt to create a complete cloud event.
- Dapr does not provide cloud event validation. This is the obligation of the sender.
So I think you are agreeing that the doc should change to :
"If the CloudEvent that was authored by the app does not contain the minimum required fields in the CloudEvent specification, these will be added automatically by Dapr."
- Dapr does not attempt to complete a cloud event missing required information. This is the obligation of the sender.
Hmmm....as per my examples above, given that dapr is adding source
, specversion
& type
due to them being missing, I'd say dapr is going to lengths to try and create a minimum valid payload. However it falls short, because it doesn't provide a CloudEvent Id
@olitomlinson - It feel like CloudEvent id
should be mandatory from dapr. This seems like a bug
@msfussell can you transfer to the correct repo, if it's a bug?
@olitomlinson - Do you agree this is a bug? Is this both a bug and a doc update?
@msfussell
There needs to be a docs update for sure. The docs currently state that the message will be rejected if it doesn't meet the mandatory CE envelope spec. Which is not true.
With regards to the missing Id
field, I do believe this is a bug/incomplete feature. This is why I raised this https://github.com/dapr/dapr/issues/6801
My reasoning is purely for the fact that dapr appears to be going to lengths to augment missing CE fields, specifically mandatory fields, if they've not been provided by the user/author. ( source
, specversion
& type
)
However, the id
CE field is the odd one out, dapr isn't augmenting that. Which, doesn't make sense to me.
IMO Either Dapr should attempt to augment all the mandatory fields if they are missing (to create a valid CE envelope) or none of them.
Given this section of the docs https://docs.dapr.io/developing-applications/building-blocks/pubsub/pubsub-cloudevents/#publish-your-own-cloudevent
There are a few statements which don't appear to be true.
Given the following request :
Produces the following CE envelope. :
As you can see, I did not specify any of the CE required properties (
id
,source
,specversion
&type
) however Dapr allowed the message to be published, it did not reject the message as the docs imply.Interestingly the resulting CE envelope (despite Daprs augmentation) is technically invalid according to the CE spec, as the
Id
property is not present.Given both points above, the expected behaviour here is hard to pin point. But If I was to hazard a guess...
This section should be adjusted :
To become :
This still leaves my second point above unsatisfied, so I will raise a bug for that in
dapr/dapr
for that.