-
Notifications
You must be signed in to change notification settings - Fork 69
CloudEvent Constructor Validation Error Too Generic #364
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
Comments
The error is occurring because you are using throw new ValidationError(`invalid extension name: ${key}`); I would not recommend using the workaround (loose validation) if the intent is for this event to propagate to other systems, given that it is not valid. |
Thanks. A nice error like in the spec would be good:
https://github.com/cloudevents/spec/blob/master/spec.md#attribute-naming-convention |
Would like to get feedback from event providers as to the strictness. I imagine some provider probably serves an event with a key >20 characters. Hopefully that doesn't break customer apps. I do see your point on the goal of keeping events clean when propagating. |
This commit changes the messages produced when validating extension names and values, including the offending name or value in the message, and including text from the CloudEvent specification, or a link to the type system. Fixes: cloudevents#364 Signed-off-by: Lance Ball <[email protected]>
This commit changes the messages produced when validating extension names and values, including the offending name or value in the message, and including text from the CloudEvent specification, or a link to the type system. Fixes: #364 Signed-off-by: Lance Ball <[email protected]>
Describe the Bug
Hi, I'm trying to debug an error from a different user. They're using this SDK.
Their code is like this:
However, running this produces the following output:
I think this output could be improved. I don't really know what is wrong and don't know if the user is really trying to create an extension.
Workaround:
Steps to Reproduce
Thanks!
The text was updated successfully, but these errors were encountered: