Re: [apps-discuss] draft-nottingham-http-problem

Michael Stillwell <mjs@beebo.org> Sun, 10 March 2013 13:33 UTC

Return-Path: <ithinkihaveacat@gmail.com>
X-Original-To: apps-discuss@ietfa.amsl.com
Delivered-To: apps-discuss@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 7724721F86AF for <apps-discuss@ietfa.amsl.com>; Sun, 10 Mar 2013 06:33:41 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.978
X-Spam-Level:
X-Spam-Status: No, score=-1.978 tagged_above=-999 required=5 tests=[BAYES_00=-2.599, FM_FORGED_GMAIL=0.622, NO_RELAYS=-0.001]
Received: from mail.ietf.org ([12.22.58.30]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id uBiO47TutVYK for <apps-discuss@ietfa.amsl.com>; Sun, 10 Mar 2013 06:33:41 -0700 (PDT)
Received: from mail-ie0-x236.google.com (mail-ie0-x236.google.com [IPv6:2607:f8b0:4001:c03::236]) by ietfa.amsl.com (Postfix) with ESMTP id CF4EB21F868E for <apps-discuss@ietf.org>; Sun, 10 Mar 2013 06:33:40 -0700 (PDT)
Received: by mail-ie0-f182.google.com with SMTP id k14so3739559iea.13 for <apps-discuss@ietf.org>; Sun, 10 Mar 2013 06:33:40 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=JBLhLd+akAlnDqN1nCmA39O4mNRuZWz4xfWjRRrgpXk=; b=yrY6zVRJZwGFJdY8Xdx89XLO+g1STzsxD8d4Y//jQmzg2HFKLEV50QOUhOKbvYyEGP MOMqy29wPBTz144r3SPfQjaUcXsOj4ATbgKtZRPA6RiS8zLO764juTCxBJh4DKo7pveN AN3EH06/OLDGGaczn7iDoyeYbFJuOXTF/ouv305Ay63/Txnv6KIhRu+wIX57oDwi/Fty 8nzUdgwiirjsRSCjtKt/D99Mb3QN1bz8e/QrB4/FDWbiKwIV0bItvdYByuyuVhm3FCX3 wSBtaR3M5y/YNDqlawVE1HobjvZjeln2tea6lqZYiTGHTw7Fhx9qNcJbkROA69bVU1ov Wpyw==
MIME-Version: 1.0
X-Received: by 10.42.64.135 with SMTP id g7mr4990193ici.37.1362922420461; Sun, 10 Mar 2013 06:33:40 -0700 (PDT)
Sender: ithinkihaveacat@gmail.com
Received: by 10.64.97.195 with HTTP; Sun, 10 Mar 2013 06:33:40 -0700 (PDT)
In-Reply-To: <A0D1F874-7288-48A8-8032-A819B42DBF8E@mnot.net>
References: <CAC5ZT9WndY1JHYWDuGAnd0=Rg6XiNMhtOoTPtUrnk+teZ33ebA@mail.gmail.com> <5137C467.90805@berkeley.edu> <CAC5ZT9V-1T+Te-JK6aEUiTZyrcFxMVeB-43Ldu-0pN5nmpJ2QQ@mail.gmail.com> <A0D1F874-7288-48A8-8032-A819B42DBF8E@mnot.net>
Date: Sun, 10 Mar 2013 13:33:40 +0000
X-Google-Sender-Auth: dgKUyCiTSR_m89JQ96cc5CUpdjg
Message-ID: <CAC5ZT9U800pgKr_75J+XxbVE4ZsCCqfW8qvd_B3x3JkTjm+OJQ@mail.gmail.com>
From: Michael Stillwell <mjs@beebo.org>
To: Mark Nottingham <mnot@mnot.net>
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: quoted-printable
Cc: Dmitry Limonov <dmitry.limonov@emc.com>, erik.wilde@emc.com, apps-discuss@ietf.org
Subject: Re: [apps-discuss] draft-nottingham-http-problem
X-BeenThere: apps-discuss@ietf.org
X-Mailman-Version: 2.1.12
Precedence: list
List-Id: General discussion of application-layer protocols <apps-discuss.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/apps-discuss>, <mailto:apps-discuss-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/apps-discuss>
List-Post: <mailto:apps-discuss@ietf.org>
List-Help: <mailto:apps-discuss-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/apps-discuss>, <mailto:apps-discuss-request@ietf.org?subject=subscribe>
X-List-Received-Date: Sun, 10 Mar 2013 13:33:41 -0000

On Thu, Mar 7, 2013 at 2:45 PM, Mark Nottingham <mnot@mnot.net> wrote:

> Not quite, but yes, this won't end world hunger. It's a small thing, the real focus is giving help to people who invent their own error formats and trip up in the process (some of the things I've seen really raise the eyebrows, and people spend a *lot* of time trying to get these things right).

So if I have this right, the following (fairly minimal) steps are
sufficient for Github to achieve complete compliance with the JSON
version of problem detail:

1. Do conneg on the Accept header.  If the client prefers
application/api-problem+json to application/json, then switch to
"problem detail" mode.  (Hopefully existing clients are already
sending application/json, but if not, servers need to default to
application/json to avoid breaking existing clients.)

2. Add a "problemType" member to the existing response.  At a minimum,
"problemType" could equal
"http://developer.github.com/v3/#client-errors", though a more
specific URI would be preferable.  (Perhaps this can be mechanically
generated from the URI of the request.)

3. Add a "title" member to the existing response.  Would duplicating
the HTTP status be sufficient?

And for GitHub clients to support "problem detail", they only need to
start sending an accept header of application/api-problem+json, and
treat the response as they would application/json.

For some services, wrapping the original application/json response in
something like:

{
  "problemType": "...",
  "title": "...",
  "error": [original_JSON_error]
}

might be preferable/easier for both client and server.

It's good that not minimal work is required by servers or clients to
support application/api-problem+{json,xml} however in the absence of
shared problemTypes the benefits seem correspondingly minimal.  (A URI
to follow seems like it would be useful[1], but Googling the service
and the error is usually good enough.)

And my guess is that shared problemTypes are unlikely to emerge for
the reason that error responses (unlike successes) are usually unique
to the service.  (c.f. the Anna Karenina principle: happy families are
all alike; unhappy families are unhappy in their own way.)






Cheers,
Michael

[1] On the other hand, the fact that few (any?) services currently
provide this, though there are no obstacles to doing so, suggests that
there is limited demand for this feature.