RE: [p3-payload] Media-Type -- Two Values, One Cup Anti-Pattern?

On Friday, January 20, 2012 12:47 PM, Bjoern Hoehrmann wrote: 
> The media type meta data is often lost (or ignored, or not checked
> for),
> so I would recommend against relying on its presence for new types,
> i.e.
> it might be better to use one type for all the subtypes and use an in-
> ternal discriminator (but I haven't looked at your use case in detail).

Unfortunately that doesn't seem to be possible. All documents will be valid
JSON but their structure is completely different.


> If you do need separate types, then a "+ld" would be odd; "+json" would
> indicate that you can handle the data if you can handle JSON, but you
> would not be able to use the "+ld" in the same way. Besides, it would

OK, thanks, that was what I thought as well.


> seem to me that `application/ld-frame+json` would be more in keeping
> with the terminology.

True! Might be a good alternative


> https://www.ietf.org/mailman/listinfo/ietf-types would be the place to
> discuss this in any case as far as the media type perspective goes.

Thank you very much for this link.


Eric, let me include the reply to your mail as well in here:


On Friday, January 20, 2012 12:42 PM, Eric J. Bowman wrote:
> From looking at the string "application/ld+json", even though I don't
> know what "ld" means, I know that the sender's intended processing
> model is JSON-based, so I can parse it in javascript and get objects,
> fwiw.

That's how it works.. but if you have a JSON-LD parser you can do more with
it, e.g., use hyperlinks.


> > but some people argued that the best practice would be to use
> > application/frame+ld+json which looks weird to me.
> >
> 
> The guidelines are being rewritten to include "+json" etc. right now, I
> doubt multiple "+" syntax will be allowed.  What you have there isn't
> what suffixes are meant to do, at all.

OK, that was my opinion as well. Do you have a link at hand where I can find
more information about this rewriting effort?



--
Markus Lanthaler
@markuslanthaler

Received on Friday, 20 January 2012 05:54:44 UTC