-
Notifications
You must be signed in to change notification settings - Fork 87
Open
Description
SDK is using case-sensitive checks when formatting CloudEvents to Json based on "datacontenttype" value. MIME types type and subtype are case insensitive according to the spec.
For example, this code snippet throws exception:
System.ArgumentException: 'JsonEventFormatter cannot serialize data of type System.String with content type 'application/JSON''
CloudEvent cloudEvent = new CloudEvent
{
Id = "event-id",
Type = "event-type",
Source = new Uri("https://cloudevents.io/"),
Time = DateTimeOffset.UtcNow,
DataContentType = "application/JSON",
Data = "text"
};
CloudEventFormatter formatter = new JsonEventFormatter();
var httpContent = cloudEvent.ToHttpContent(ContentMode.Structured, formatter);
Metadata
Metadata
Assignees
Labels
No labels