Right now, codecs work for generic encoding (eg. application/json, text/xml, …)
But in a business app, our types could have their own mime type (eg. application/vnd.mycompany.customers.v1+json).
This would kind mix encoding (json) and structural validation (does customer have the right field in the correct business format?). Some kind of marshal and validate mixup.
I need to think about a way, to mix them without coupling them. I guess the right interface could make wonders.
Right now, codecs work for generic encoding (eg.
application/json
,text/xml
, …)But in a business app, our types could have their own mime type (eg.
application/vnd.mycompany.customers.v1+json
). This would kind mix encoding (json) and structural validation (does customer have the right field in the correct business format?). Some kind ofmarshal
andvalidate
mixup.I need to think about a way, to mix them without coupling them. I guess the right interface could make wonders.
ref: