Skip to content

Should throw if specversion attribute is missing #332

Closed
@satazor

Description

@satazor

Describe the Bug

Does not throw if event doesn't have a specversion attribute, and fallbacks to 1.0. The spec says that the specversion attribute is mandatory, so I think this library should fail when it's missing, instead of "magically" falling back.

Steps to Reproduce

  1. Receiver.accept({ 'Content-Type': 'application/cloudevents+json' }, { id: 'foo', source: 'foo', type: 'foo' });
  2. Prints console.error saying it will fallback to 1.0
  3. Validation passes

Expected Behavior
It should throw, since the specversion attribute is missing

Metadata

Metadata

Assignees

Labels

module/libRelated to the main source codemodule/transport/httpIssues related to the HTTP transport protocol implementation

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions