Harmonize validation of CloudEvents
See original GitHub issueIs your feature request related to a problem? Please describe.
My problem is related to the validation of extensions. While new CloudEvent()
rightfully rejects an extension named my-extension
(problem being the -
) it is perfectly okay for HTTP.toEvent()
and even to ce.validate()
.
Describe the solution you would like to see
I think the creation of a CE should always have the same validations in place, no matter if its created by new CloudEvent()
or via HTTP.toEvent()
. I also think the validate()
method should consider extensions.
Additional context
I transport my CEs via HTTP and therefore have a service that takes an HTTP request with HTTP.toEvent()
, validates the CE with ce.validate()
and then puts it in my event broker. On the consuming side there is a service that takes the event from the broker, creates a new CloudEvent with new CloudEvent()
and sends it via axios using the HTTP.binary()
function.
Issue Analytics
- State:
- Created a year ago
- Comments:9 (4 by maintainers)
Top GitHub Comments
Hey @lance, sorry for the long wait. I was able to validate your code – not sure what I did wrong there in the past, it is working as expected. Sorry!
Hey @lance, I am currently traveling, I am not sure when I will be able trying to reproduce this, sorry. But will definitely do!