sdk-go
sdk-go copied to clipboard
Support structured syntax suffixes for custom content types
We have data coming into our system which can have dynamic content types, and we attempt to handle it regardless of the underlying format. For example we have an application which is feeding us data using a vendor-specific content type, i.e. application/vnd.my-app+json
, and we'd like to pass this into the cloudevents SDK.
The problem is that the current codec implementation expects an exact match on the content type in order to load up the Encoder
/Decoder
, see https://github.com/cloudevents/sdk-go/blob/main/v2/event/datacodec/codec.go
We would like to support the standard set of IANA Structured Syntax Suffixes, so if the codec receives a custom content type, but has a +json
, +xml
suffix etc., then we use the correct codec.
Happy for one of our team to contribute a PR, just thought I'd open it up for discussion first.