Re: [apps-discuss] media type for partial JSON updates?

mike amundsen <mamund@yahoo.com> Thu, 29 December 2011 16:07 UTC

Return-Path: <mca@amundsen.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 EF04721F8A64 for <apps-discuss@ietfa.amsl.com>; Thu, 29 Dec 2011 08:07:39 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -0.68
X-Spam-Level:
X-Spam-Status: No, score=-0.68 tagged_above=-999 required=5 tests=[BAYES_00=-2.599, FM_FORGED_GMAIL=0.622, FORGED_YAHOO_RCVD=2.297, RCVD_IN_DNSWL_LOW=-1]
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 6iVqefMJyksi for <apps-discuss@ietfa.amsl.com>; Thu, 29 Dec 2011 08:07:39 -0800 (PST)
Received: from mail-pz0-f44.google.com (mail-pz0-f44.google.com [209.85.210.44]) by ietfa.amsl.com (Postfix) with ESMTP id 3F35321F8A55 for <apps-discuss@ietf.org>; Thu, 29 Dec 2011 08:07:39 -0800 (PST)
Received: by dajz8 with SMTP id z8so12605054daj.31 for <apps-discuss@ietf.org>; Thu, 29 Dec 2011 08:07:39 -0800 (PST)
MIME-Version: 1.0
Received: by 10.68.72.230 with SMTP id g6mr87508307pbv.119.1325174858931; Thu, 29 Dec 2011 08:07:38 -0800 (PST)
Sender: mca@amundsen.com
Received: by 10.143.93.9 with HTTP; Thu, 29 Dec 2011 08:07:38 -0800 (PST)
In-Reply-To: <4EFC8C98.10901@gmx.de>
References: <4EFC8C98.10901@gmx.de>
Date: Thu, 29 Dec 2011 11:07:38 -0500
X-Google-Sender-Auth: EmOEfttaOz0t2BGM4SU0uzPmeY8
Message-ID: <CAPW_8m7oLLLVkinrjEdUvtZYjUDM5V9HVtVH_HnhNOBGixHfAQ@mail.gmail.com>
From: mike amundsen <mamund@yahoo.com>
To: Julian Reschke <julian.reschke@gmx.de>
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Cc: IETF Apps Discuss <apps-discuss@ietf.org>
Subject: Re: [apps-discuss] media type for partial JSON updates?
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: Thu, 29 Dec 2011 16:07:40 -0000

Julian:


I think there is already an XML format for PATCH, right? (can't seem
to find it right now) It might not bee too much work to spin up a
parallel media type definition using the JSON format.

That document might be proper place to describe a typical PATCH media
type as (improvising here) "a format designed to *modify* an existing
entity rather than replace all or part of an existing entity and/or
introduce the notion of "partial updates" through the description of
the PATCH method.

mca
http://amundsen.com/blog/
http://twitter.com@mamund
http://mamund.com/foaf.rdf#me




On Thu, Dec 29, 2011 at 10:51, Julian Reschke <julian.reschke@gmx.de> wrote:
> Hi,
>
> a few days ago, there was an epic thread over on rest-discuss
> (<http://tech.groups.yahoo.com/group/rest-discuss/message/18011>) on the use
> of HTTP PUT for partial updates of JSON-modeled data.
>
> (Of course we all know over here that PUT isn't for partial updates :-)
>
> However, apparently many people currently do this, as it's simply convenient
> to send a subset of the object and have the server just update those fields.
>
> Now it's obvious that these kind of requests really should use PATCH,
> because that's what it's for after all. What's missing here is a media type
> describing this, though.
>
> Should we document patch semantics for this use case, and define a matching
> media type?
>
> It might be a light-weight alternative to what
> <https://tools.ietf.org/html/draft-pbryan-json-patch-04> describes. For
> example, taking the example from
> <https://tools.ietf.org/html/draft-pbryan-json-patch-04#appendix-A.5>:
>
>   {
>       "baz": "qux",
>       "foo": "bar"
>   }
>
>   A JSON Patch document:
>
>   [
>         { "replace": "/baz", "value": "boo" }
>   ]
>
>   The resulting JSON document:
>
>   {
>       "baz": "boo",
>       "foo": "bar"
>   }
>
> ...the alternative notation would be...:
>
>
>   {
>       "baz": "boo"
>   }
>
> ...sent with PATCH and an internet media type such as
> "application/partial-update-json".
>
> Feedback appreciated,
>
> Julian
>
> PS: And yes, this would only allow replacing things; but this might be good
> enough for many use cases. Not defining something for this will cause people
> to stick with PUT, or to use PATCH with an incorrect media type, which we
> should avoid.
> _______________________________________________
> apps-discuss mailing list
> apps-discuss@ietf.org
> https://www.ietf.org/mailman/listinfo/apps-discuss