Re: [Json] Allow any JSON value at the top level

"Markus Lanthaler" <markus.lanthaler@gmx.net> Tue, 11 June 2013 08:09 UTC

Return-Path: <markus.lanthaler@gmx.net>
X-Original-To: json@ietfa.amsl.com
Delivered-To: json@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 037C621F9A91 for <json@ietfa.amsl.com>; Tue, 11 Jun 2013 01:09:49 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.15
X-Spam-Level:
X-Spam-Status: No, score=-1.15 tagged_above=-999 required=5 tests=[BAYES_00=-2.599, MSGID_MULTIPLE_AT=1.449]
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 Yjc0ItQTYP8w for <json@ietfa.amsl.com>; Tue, 11 Jun 2013 01:09:35 -0700 (PDT)
Received: from mout.gmx.net (mout.gmx.net [212.227.17.20]) by ietfa.amsl.com (Postfix) with ESMTP id 2C34F21F96FE for <json@ietf.org>; Tue, 11 Jun 2013 01:09:35 -0700 (PDT)
Received: from mailout-de.gmx.net ([10.1.76.19]) by mrigmx.server.lan (mrigmx001) with ESMTP (Nemesis) id 0MEphU-1UalyZ3W7W-00FyE7 for <json@ietf.org>; Tue, 11 Jun 2013 10:09:33 +0200
Received: (qmail invoked by alias); 11 Jun 2013 08:09:33 -0000
Received: from 84-115-182-43.dynamic.surfer.at (EHLO Vostro3500) [84.115.182.43] by mail.gmx.net (mp019) with SMTP; 11 Jun 2013 10:09:33 +0200
X-Authenticated: #419883
X-Provags-ID: V01U2FsdGVkX18WY2l9APYWQ2lOCrbCaoCncjorFs302NBmdYz5Vo rsEz+ciKq2oO06
From: Markus Lanthaler <markus.lanthaler@gmx.net>
To: json@ietf.org
References: <A723FC6ECC552A4D8C8249D9E07425A70FC33B5B@xmb-rcd-x10.cisco.com> <51b23e6d.6196420a.0b15.4245SMTPIN_ADDED_BROKEN@mx.google.com> <CAChr6SwrveU=fesF8VidDYWzeYMu2c1+=38+__BqHArxTiW5mg@mail.gmail.com> <51b4dbbe.64da440a.1fc2.6dd2SMTPIN_ADDED_BROKEN@mx.google.com> <CAChr6Sx_obmG+=sY100ySBLmevN0VJ_0Z9TjYGxcXKOx+UtnJA@mail.gmail.com> <51b4ec44.ea05420a.7c73.ffffa487SMTPIN_ADDED_BROKEN@mx.google.com> <CAChr6SxiZ2Yz6SiozQZpuYoGKSzWnUux6PukyWDkcvKsVyyRbQ@mail.gmail.com> <51b507b1.c686e00a.3a7e.ffffa0adSMTPIN_ADDED_BROKEN@mx.google.com> <CAO1wJ5R2H27qh-DWG5B8CzutkTFWxn-h+Qi1jiet23axxmvLyA@mail.gmail.com>
In-Reply-To: <CAO1wJ5R2H27qh-DWG5B8CzutkTFWxn-h+Qi1jiet23axxmvLyA@mail.gmail.com>
Date: Tue, 11 Jun 2013 10:09:31 +0200
Message-ID: <015001ce667b$00c45340$024cf9c0$@lanthaler>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
X-Mailer: Microsoft Office Outlook 12.0
Thread-Index: Ac5mEWLljQoDo5lvRKy50hj9aPPZRgAaRt1w
Content-Language: de
X-Y-GMX-Trusted: 0
Subject: Re: [Json] Allow any JSON value at the top level
X-BeenThere: json@ietf.org
X-Mailman-Version: 2.1.12
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: Tue, 11 Jun 2013 08:09:49 -0000

On Sent: Monday, June 10, 2013 9:33 PM, Jacob Davies wrote:
> Lots of people do this, in my experience, including me pretty often.

I was hoping for something more concrete. Something like "Facebook's,
Google's and Bing's APIs are doing that. Here are the links."


> The big problem with the current requirement is that arbitrary
> sub-values of a JSON value cannot be sent as application/json.

Of course not. How would you path a JSON object or array by just sending a
number? How should that number be interpreted?


> So for
> instance, if you wish to implement a form of PATCH on a JSON document,
> you must demand that clients wrap their new value in a JSON object or
> array instead of sending raw primitive values.

Are you really talking about PATCH? Looks more like a PUT to me.. PATCH
requires a different media type anyway.


> If you implement a
> service returning an inherently primitive value (e.g. a plain-text
> document server) you must wrap your responses in a JSON object or
> array even though there is nothing else that could reasonably be
> added.

... or you just return text/plain. That would even enable browsers to render
the responses.


Cheers,
Markus


--
Markus Lanthaler
@markuslanthaler