Re: [media-types] Thoughts on suffixes, single and multiple

Orie Steele <orie@transmute.industries> Wed, 17 April 2024 03:35 UTC

Return-Path: <orie@transmute.industries>
X-Original-To: media-types@ietfa.amsl.com
Delivered-To: media-types@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 1C56DC14F60A for <media-types@ietfa.amsl.com>; Tue, 16 Apr 2024 20:35:34 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -7.096
X-Spam-Level:
X-Spam-Status: No, score=-7.096 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_HI=-5, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_DBL_BLOCKED_OPENDNS=0.001, URIBL_ZEN_BLOCKED_OPENDNS=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=transmute.industries
Received: from mail.ietf.org ([50.223.129.194]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 1PqBji0BBjAh for <media-types@ietfa.amsl.com>; Tue, 16 Apr 2024 20:35:29 -0700 (PDT)
Received: from mail-pj1-x1035.google.com (mail-pj1-x1035.google.com [IPv6:2607:f8b0:4864:20::1035]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id C597BC14F5F3 for <media-types@ietf.org>; Tue, 16 Apr 2024 20:35:29 -0700 (PDT)
Received: by mail-pj1-x1035.google.com with SMTP id 98e67ed59e1d1-2a54fb929c8so3352422a91.3 for <media-types@ietf.org>; Tue, 16 Apr 2024 20:35:29 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=transmute.industries; s=google; t=1713324929; x=1713929729; darn=ietf.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=2UaC6n+pEam6Mxv94YKFeCRuZBhFtiMe2YvHNlNOhho=; b=Epw/X1va26SFYuC9trNvZd1aq2MRpTQWkVPr3EZYMzODsM1Bplc1mOPs93LKOuKaMc jhrN8g2PBaljNDSDN1Eq83PfaQLWQ7UrNOz0XAYR7Uyao1syFeo1+65CWXD/zkIe7KM8 9pw4ggHBKhyacHpDK0GDKv0qCWEHnKdyI4IbqytGdahw6qC9QH9rbgbClR37tSq4hoY0 hodxcegFfp95nixrzO90E8pvuxpAnUOqc/QQMRBT4cfv6oSfl88TxZvxVBP+wT+uRIHp 0NjncDhv/9871USE0LwO6UW7qD+k/kaG6kDU6n0WOygOhewQu48jJfTs2wxVRDrmLp3O bghw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713324929; x=1713929729; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=2UaC6n+pEam6Mxv94YKFeCRuZBhFtiMe2YvHNlNOhho=; b=NBvelUchLP0dWFGuwsUtRkBvFeo77IC8CTowwgacyqMt45gUT4TZMelWhlJx45j6c4 J1GmgNtNeM4fFkawJ8AefdGTntzipHU90DFL7jhTAWl8sksapgXnebf48RSQu6IRBe6A /IcH50Gr+F4tdO4mcZFe0o1lg1Rf3V5jkW2dxhLrPgRD0aOETXhIWRhfrOICzCN9+89c Sj5OnJneF8F7TB7zoU8g7/InBW6b5sl1eygjN6pHMveJ/CWeahZCfxS5EFz0Z+JIEWmH flxkuQzh8kLfzewimJ3ymnHqesAX3FEddLRl2T/vtwjs1E889bg22Whycj/q7VVLXIKG mXWg==
X-Gm-Message-State: AOJu0YwcSn6sGSfFKr5P2TtBBfpVIqB1xH+EcPFQmEVC3jDX8BDYxt35 uqS88o++GEh7NbYRXeEsLRJ5IEFPeCUlraZP+eb6l2GwJmDvjTHDjB5r/XVg3Ou5KlZxmCyrPCP tW8f4rbVlR007Ond3hSHiAVdk4VBiwiwIKYQsGmAtl8gArKsg4Tg=
X-Google-Smtp-Source: AGHT+IEp9Vm+/Di1dU4RfKRIRWb/A4xHwiOcdrcD1I61loUqcAqI6FnK7ZTDxO1afBWLar1KxvwFofiDFczOYtBGWuU=
X-Received: by 2002:a17:90b:33c7:b0:2a5:e087:768a with SMTP id lk7-20020a17090b33c700b002a5e087768amr15596507pjb.29.1713324928787; Tue, 16 Apr 2024 20:35:28 -0700 (PDT)
MIME-Version: 1.0
References: <SJ2PR01MB8102985A55F6AFCD88859FD7A30F2@SJ2PR01MB8102.prod.exchangelabs.com>
In-Reply-To: <SJ2PR01MB8102985A55F6AFCD88859FD7A30F2@SJ2PR01MB8102.prod.exchangelabs.com>
From: Orie Steele <orie@transmute.industries>
Date: Tue, 16 Apr 2024 22:35:16 -0500
Message-ID: <CAN8C-_LADKECL2swf=BsMG1k1bpTLKRc4b_h_guTxdA59bMOnA@mail.gmail.com>
To: Darrel Miller <darrel@tavis.ca>
Cc: IETF Media Types <media-types@ietf.org>
Content-Type: multipart/alternative; boundary="000000000000c400bf0616428b7b"
Archived-At: <https://mailarchive.ietf.org/arch/msg/media-types/a0fBfiZcUgKB0xczTJs0CKKjVF8>
Subject: Re: [media-types] Thoughts on suffixes, single and multiple
X-BeenThere: media-types@ietf.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: "IANA mailing list for reviewing Media Type \(MIME Type, Content Type\) registration requests." <media-types.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/media-types>, <mailto:media-types-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/media-types/>
List-Post: <mailto:media-types@ietf.org>
List-Help: <mailto:media-types-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/media-types>, <mailto:media-types-request@ietf.org?subject=subscribe>
X-List-Received-Date: Wed, 17 Apr 2024 03:35:34 -0000

(as an individual / media type complexity enthusiast)

Parameters were discussed in the W3C VCWG and I think on this list
previously as potential alternatives, including some syntax proposed by Ted
and Joe from W3C that looks very similar to what you suggest.

The main argument against parameters is that you then have more complicated
parsing instead of simple string matching, and more error cases to
consider... In other words, worse interoperability, because of too many
alternative expressions of the same media type.

For an example that uses both suffixes and parameters, see:

https://www.w3.org/TR/activitystreams-core/#media-type

application/ld+json; profile="https://www.w3.org/ns/activitystreams"

This could have just been:

application/activity-streams

If that had been the choice and then later a CBOR encoding and a new
profile were needed, a suffix and a parameter could be added, when they are
needed, instead of anticipated in the initial registration.

Starting with a fully suffixed and parameterized media type, seems to
anticipate the success of the base and a need for alternative expressions
of it.

As a general rule, I would avoid parameters and suffixes, unless you have a
lot of evidence that they are necessary... Since once they are present you
have lost the opportunity for a simple and easy to match against media type.

Perhaps the convention of signaling suffixes has escaped for long enough to
memorialize it as a trend with advantages and disadvantages, but I don't
think we've seen near that amount of success for heavily parameterized
media types, except perhaps in AV codecs.


For example:
https://developer.mozilla.org/en-US/docs/Web/Media/Formats/codecs_parameter

Regards,

OS

On Tue, Apr 16, 2024, 10:02 PM Darrel Miller <darrel@tavis.ca> wrote:

> As a follow up to the tests that I did to see if any of the major browsers
> respect +json, which they didn't, I tried the same experiment with +xml and
> got the same results.  None of the browsers I tried, used the +xml suffix
> to cause XML rendering.
>
> This leads me to feel like that we are debating over what is theoretically
> possible, but in the 23 years since suffixes were formalized, that
> theoretical value has not been widely realized. We do not have a clear
> guidance on what the suffix means.  For example,  +json and +gzip are
> achieving quite distinct goals. We have seen that introducing multiple
> suffixes has raised a range of new concerns that we do not have clear
> answers for.
>
> Most of the proposed uses of single and multiple suffixes that I have seen
> are either trying provide an encoding format that overlaps with
> Content-Encoding, or they are being used as a indicator to client or server
> of the specific format of some content where multiple contents are
> supported.
>
> An example of the latter scenario is what we have been trying to do with
> the registration of the media type for OpenAPI descriptions
> https://www.ietf.org/archive/id/draft-ietf-httpapi-rest-api-mediatypes-05.html#section-2.1
>
> The proposal is to register application/openapi+yaml and
> application/openapi+json.  This allows clients to conneg the format they
> desire and servers to advertise the format they are returning.
>
> However, upon reflection of all this conversation around suffixes, my
> question is why not do this?
>
> application/openapi;format=yaml
> application/openapi;format=json
>
> By defining an optional format parameter for the media type, we only have
> to have one registration, we get the same value and a client has the option
> to omit the format if either is supported.
>
> John Klensin made the comment in one of the recent IETF mediaman meetings
> that parameters for media types were created to prevent there being an
> explosion of media type registrations.
>
> Is there a reason why media type parameters cannot be used in many of
> these other use cases that are currently struggle to shoehorn information
> into suffixes?
>
> e.g.
> application/vc;format=jsonld
> application/did;format=jsonld
> application/voucher;format=json;sig=jose
> application/voucher;format=cbor;sig=cose
>
>
> I think suffixes were an experiment into encoding some meaning into part
> of a media type name that did not produce the desired results. I don't
> believe that if we decided to remove that meaning that anything on the
> internet will break.  Existing suffixes can remain, but I think moving
> forward we should be looking towards leveraging parameters, not suffixes
> for capturing meta information about media types.
>
> Darrel
> _______________________________________________
> media-types mailing list
> media-types@ietf.org
> https://www.ietf.org/mailman/listinfo/media-types
>