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.