Re: [Json] Comments by convention

Vinny A <jsontest@yahoo.com> Fri, 07 June 2013 16:45 UTC

Return-Path: <jsontest@yahoo.com>
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 AAEB221F9925 for <json@ietfa.amsl.com>; Fri, 7 Jun 2013 09:45:47 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: 1.997
X-Spam-Level: *
X-Spam-Status: No, score=1.997 tagged_above=-999 required=5 tests=[BAYES_50=0.001, J_CHICKENPOX_45=0.6, MIME_QP_LONG_LINE=1.396]
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 AOFwkykRtIk5 for <json@ietfa.amsl.com>; Fri, 7 Jun 2013 09:45:35 -0700 (PDT)
Received: from nm49-vm4.bullet.mail.ne1.yahoo.com (nm49-vm4.bullet.mail.ne1.yahoo.com [98.138.121.132]) by ietfa.amsl.com (Postfix) with ESMTP id 0619E21F848A for <json@ietf.org>; Fri, 7 Jun 2013 09:45:34 -0700 (PDT)
Received: from [98.138.90.52] by nm49.bullet.mail.ne1.yahoo.com with NNFMP; 07 Jun 2013 16:45:34 -0000
Received: from [98.138.84.42] by tm5.bullet.mail.ne1.yahoo.com with NNFMP; 07 Jun 2013 16:45:34 -0000
Received: from [127.0.0.1] by smtp110.mail.ne1.yahoo.com with NNFMP; 07 Jun 2013 16:45:34 -0000
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1370623534; bh=nlgEJS3jYCdaMElYBpMBv1FniAHJjAnsD6djrliB8Zg=; h=X-Yahoo-Newman-Id:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:X-Rocket-Received:References:In-Reply-To:Mime-Version:Content-Transfer-Encoding:Content-Type:Message-Id:Cc:X-Mailer:From:Subject:Date:To; b=lztfkBEcUnv9i89UkoPex/IPhAgj0IQGmQWqaYIXFdfCqbBwHCPr0ZNTkxY/hOpb2MjG59nVuzGFhrTkxWxfXMhGNnAT9bXveReWt7453Bz8iWinxdIGsDTLkcxq6uD8XwsJiR4O/kwBzX0LuXrg6T910//cGUOKvXvHbjCT4+8=
X-Yahoo-Newman-Id: 271071.13062.bm@smtp110.mail.ne1.yahoo.com
X-Yahoo-Newman-Property: ymail-3
X-YMail-OSG: VU2zV64VM1lOa741_7ee62TxvJRPKJJJTI1hWccKNN14xdz SRCwIVaL4.mlbNugMtR6BhJ43KQQ7jV.XdBe_0xyEZK1DIhe57Pemd1dwq2V anzSAjl_csDtkvTtkxQl0goP_SWKQTXtZQSRIj5vzZn5OFkwGVLz5HlJ8d_9 olwIGpb0bjhrTr76invU5clr1oxfU_S.HfLoPr9W5qbFekKpES9oFrGpJC0k EL9hH50HS4mjLucZgRGp5gp77nAuLw65RJvlzq.kLFxIO9r4PFwB4N22xb76 Bu1CCsyFyOfPBwB_VUEYRroTiW_812l_Qi5KFrXV3QVWDDFZ6lC8kWqWsUKO NCM3BmAmrlcqmBMx6TcYxhYuBpOefTbTV2xQER7oROMyv_wzpVBLhF_5szPa VTeSQwQmxlP40Ht1fRX8IYbzQKHXAl1OBokhDnLeSqU5U2q.qXJ99CaJ40im 1HKVXD6p1swfifOydwASftZ9PKuJ_EvUE5HyKy_yI.clQtbiF65xdwgIfUiw Tcze3Zh35rWRSqjnuZwT8HH_YESlwWZOH_01.ZOt0xz_1VrI20WwnUdPRJ9W zpkdInpO5acm2J6P46EuDpf_vXRk770wnCcWOYP2PG5pr_HCu7ZyG2OIwh_Y -
X-Yahoo-SMTP: indQcmSswBC8IKsm6t4aCAPskK3T
X-Rocket-Received: from [192.168.10.95] (jsontest@64.134.39.87 with ) by smtp110.mail.ne1.yahoo.com with SMTP; 07 Jun 2013 09:45:34 -0700 PDT
References: <641B1C79FB414811BCBDE8BE0FD165D6@codalogic>
In-Reply-To: <641B1C79FB414811BCBDE8BE0FD165D6@codalogic>
Mime-Version: 1.0 (1.0)
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset="us-ascii"
Message-Id: <32388664-98E4-4197-B4F1-2799E18AA429@yahoo.com>
X-Mailer: iPod Mail (9B206)
From: Vinny A <jsontest@yahoo.com>
Date: Fri, 07 Jun 2013 11:45:24 -0500
To: Pete Cordell <petejson@codalogic.com>
Cc: "<json@ietf.org>" <json@ietf.org>
Subject: Re: [Json] Comments by convention
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: Fri, 07 Jun 2013 16:45:47 -0000

Adding to your proposal, I'd like it stated that comments are also first class name:value data pairs; ie if I call (pseudo code):

Jsonobject.get("// description");

Then I will get the value "A short description of the item ordered". Obviously this is also backward compatible.

-----------------
Vinny
www.jsontest.com

On Jun 7, 2013, at 11:31 AM, "Pete Cordell" <petejson@codalogic.com> wrote:

> I along with many wish JSON included comments.  Since they can't retrospectively be added, what are the prospects of documenting a convention for including comments in a JSON message?
> 
> For example, something along the lines of:
> 
> 2.6 Comments
> 
> JSON has no native ability to represent comments.  Instead, by convention, unless overridden by a protocol definition, comments can be represented by name/value pairs (a.k.a. members) with string values of the form:
> 
>   "//": "This is a comment"
> 
> Comments can be associated with a particular member within an object using a comment name of the form "// foo" where "foo" is the name of the member to which the comment applies.
> 
> For example:
> 
>   "order": {
>           "//": "An order item",
>           "// description": "A short description of the item ordered",
>           "description": "1TB HDD",
>           "// price": "The price in USD",
>           "price": 123.45 }
> 
> How much goes up in smoke if we do that?
> 
> Pete Cordell
> Codalogic Ltd
> C++ tools for C++ programmers, http://codalogic.com
> Read & write XML in C++, http://www.xml2cpp.com
> 
> _______________________________________________
> json mailing list
> json@ietf.org
> https://www.ietf.org/mailman/listinfo/json