Skip to content

JSON format implicit datacontenttype is asymmetrical #880

@jskeet

Description

@jskeet

Just trying to write tests for the clarifications in #861, and I think there's an asymmetry:

  • When deserializing a CloudEvent, if datacontenttype isn't specified it defaults to application/json
  • When serializing a CloudEvent, there's no such defaulting that I can see

I suspect that we should say that if datacontenttype is missing when serializing - and if data is present - it should default to application/json, so the payload should be serialized as JSON.

I'll proceed along those lines, and we can discuss whether that was actually the intention - and I can put together a PR to clarify the spec if so.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions