Re: [Json] Media types, extensibility in draft-ietf-json-i-json-02

Phillip Hallam-Baker <ietf@hallambaker.com> Wed, 02 July 2014 14:40 UTC

Return-Path: <hallam@gmail.com>
X-Original-To: json@ietfa.amsl.com
Delivered-To: json@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id E72CD1A02EF for <json@ietfa.amsl.com>; Wed, 2 Jul 2014 07:40:40 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.277
X-Spam-Level:
X-Spam-Status: No, score=-1.277 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FM_FORGED_GMAIL=0.622, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, SPF_PASS=-0.001] autolearn=no
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id w-bacP25aZx4 for <json@ietfa.amsl.com>; Wed, 2 Jul 2014 07:40:39 -0700 (PDT)
Received: from mail-wi0-x229.google.com (mail-wi0-x229.google.com [IPv6:2a00:1450:400c:c05::229]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 267781A02C1 for <json@ietf.org>; Wed, 2 Jul 2014 07:40:39 -0700 (PDT)
Received: by mail-wi0-f169.google.com with SMTP id hi2so9140440wib.4 for <json@ietf.org>; Wed, 02 Jul 2014 07:40:37 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=sQMmLdGZSpFitKGxyWsitC4v5wi8TqRP75L+J1ay4f0=; b=LMOisUJ4s5IUfkCgWj7YwPXQsfWvyQFXfbhM1hIp4TTdpMP9z3I79smp+tvujlTpdS dYWcBkqHDCXdSVNnngWlMUPoFibc6eO+R6yss5EjYqdZTRafwDxNjwWI94M98EOgaTsq PCG0MHpuGRQYRJm25wgtAcsnBRC8CrVzvLYKMV4sXak9gSJ0mvlsqJjwTfY8/7xIuzHR VD9K/DVTLHkj7v4DJT7alxgc2Qj2Tci2rAifDXqk1jibliyu6nQf5E2ie1+MgHy/T6KQ w392J4toZgtq1XEbG/GgQuO93SPK+Q8wfJjWna1XhKx0nnghXtWQ9iMNn2e2HtN7pVpC gMsQ==
MIME-Version: 1.0
X-Received: by 10.180.101.39 with SMTP id fd7mr4712859wib.65.1404312037714; Wed, 02 Jul 2014 07:40:37 -0700 (PDT)
Sender: hallam@gmail.com
Received: by 10.194.79.136 with HTTP; Wed, 2 Jul 2014 07:40:37 -0700 (PDT)
In-Reply-To: <CALcoZionwZ1gn0hkhq4sKcDKg3LK13+d-XvBzXUA4iHjS6PHNA@mail.gmail.com>
References: <CALcoZionwZ1gn0hkhq4sKcDKg3LK13+d-XvBzXUA4iHjS6PHNA@mail.gmail.com>
Date: Wed, 02 Jul 2014 10:40:37 -0400
X-Google-Sender-Auth: yURpqhM-5Djpoe_n5_hjlSboSLk
Message-ID: <CAMm+LwgU5veinaNJ6ptLJ509QD3R5=LEbpfmNjZSy5C+8jfPXg@mail.gmail.com>
From: Phillip Hallam-Baker <ietf@hallambaker.com>
To: Mark Baker <distobj@acm.org>
Content-Type: multipart/alternative; boundary="f46d041825d229719304fd36e007"
Archived-At: http://mailarchive.ietf.org/arch/msg/json/2Ut5aIECd8_PCgRtDnzZOCRmGA8
Cc: JSON WG <json@ietf.org>
Subject: Re: [Json] Media types, extensibility in draft-ietf-json-i-json-02
X-BeenThere: json@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: "JavaScript Object Notation \(JSON\) WG mailing list" <json.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/json>, <mailto:json-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/json/>
List-Post: <mailto:json@ietf.org>
List-Help: <mailto:json-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/json>, <mailto:json-request@ietf.org?subject=subscribe>
X-List-Received-Date: Wed, 02 Jul 2014 14:40:41 -0000

On Tue, Jul 1, 2014 at 11:04 PM, Mark Baker <distobj@acm.org> wrote:

> Greetings,
>
> There's no mention of which media type I-JSON content should use. A
> quick check of the archives shows recent discussion about
> application/xxx+i-json and application/i-json, but I don't know why it
> isn't yet in the draft. I think it's essential to get this correct,
> given the compatibility goals of the format.
>

I disagree.

The only use for Content-Type is for content negotiation. There is no
situation in which a negotiation that makes a distinction between JSON and
I-JSON makes any sense.

Content identification that tells me a document is JSON is useless unless I
know the schema or purpose of the document.


If I write a protocol then I am going to tell people to use I-JSON encoding
or there is no value to it. If the sender has an option to choose between
JSON and I-JSON then I have to implement both and nothing is saved or
simplified.

There is one situation in which I might use a content type and that is
where a protocol is offered in more than one encoding. For example, SAML in
JSON. If I have an application that has no XML except for one Web Service I
might well offer that service in JSON or XML. Another case where
negotiation is frequently desirable is where a protocol designer has become
confused by REST ideology and has the idea that request parameters should
be URI encoded and responses returned in JSON. Many of us would much prefer
to do everything in one format.


So I don't see any reason to revisit the issue of a content-type. JSON and
I-JSON are the same thing as far as content negotiation is concerned and
the distinction is useless for content identification.

Where it would be useful to revise things would be to define a particular
way to specify the semantics of a JSON document, or at least the protocol
family.


For example, I have a protocol that allows a client to retrieve the current
phinger (.phb) document corresponding to a phingerprint (hash of the public
key info). The content is encoded in JSON. But it is not just any JSON, it
is JSON encoding of a phinger which is a personal PKI root file.

Since the mechanism being used here is the /.well-known convention
(/.well-known/ppe at the moment for testing), it would make sense to re-use
the prefix assigned for that as a modifier to the content-type

Content-Type: application/json; protocol=ppe