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

* Markus Lanthaler wrote:
>May I just ask a quick question on this. We are currently working on a
>JSON-based media type (JSON-LD) and plan to use the application/ld+json
>media type for it. Do you think that's a bad practice?
>
>Unfortunately in JSON there's no way to specify such processing instructions
>within the representation as you propose. From looking at the current
>registered media types and discussions with a number of people (mostly from
>the WHATWG) we thought that's the best practice, so I'm a bit confused now.

The main criticism with "+json" types that I am aware of was that it's a
bit of an ad-hoc convention that unlike "+xml" was undocumented. That is
getting addressed now though and there are people making serious argu-
ments against "+json" types, they are not posting them to `ietf-types`.
There are plenty of people in the process or registering "+json" types,
I would regard using the convention a best practise.

>A related issue we stumbled into is how we define further "subtypes". E.g.
>we will need a way to describe a "JSON-LD frame". The first idea was to use
>application/frame-ld+json but some people argued that the best practice
>would be to use application/frame+ld+json which looks weird to me.

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).
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
seem to me that `application/ld-frame+json` would be more in keeping
with the terminology.

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.
-- 
Björn Höhrmann · mailto:bjoern@hoehrmann.de · http://bjoern.hoehrmann.de
Am Badedeich 7 · Telefon: +49(0)160/4415681 · http://www.bjoernsworld.de
25899 Dagebüll · PGP Pub. KeyID: 0xA4357E78 · http://www.websitedev.de/ 

Received on Friday, 20 January 2012 04:47:35 UTC