Re: [apps-discuss] draft-ietf-appsawg-json-pointer
"Paul C. Bryan" <pbryan@anode.ca> Thu, 25 October 2012 23:25 UTC
Return-Path: <pbryan@anode.ca>
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 EB5D421F856D for <apps-discuss@ietfa.amsl.com>; Thu, 25 Oct 2012 16:25:56 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.598
X-Spam-Level:
X-Spam-Status: No, score=-2.598 tagged_above=-999 required=5 tests=[BAYES_00=-2.599, HTML_MESSAGE=0.001]
Received: from mail.ietf.org ([64.170.98.30]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 3-X2bU-z+kY2 for <apps-discuss@ietfa.amsl.com>; Thu, 25 Oct 2012 16:25:55 -0700 (PDT)
Received: from maple.anode.ca (maple.anode.ca [72.14.183.184]) by ietfa.amsl.com (Postfix) with ESMTP id B082421F84F2 for <discuss@apps.ietf.org>; Thu, 25 Oct 2012 16:25:55 -0700 (PDT)
Received: from [10.126.22.51] (nat-204-14-239-210-sfo.net.salesforce.com [204.14.239.210]) by maple.anode.ca (Postfix) with ESMTPSA id 6BAC86452; Thu, 25 Oct 2012 23:25:54 +0000 (UTC)
From: "Paul C. Bryan" <pbryan@anode.ca>
To: Mark Nottingham <mnot@mnot.net>
In-Reply-To: <DB07EC11-2DB8-4FD7-9539-F6E6E4E87A63@mnot.net>
References: <5086C026.7030908@skoegl.net> <DB07EC11-2DB8-4FD7-9539-F6E6E4E87A63@mnot.net>
Content-Type: multipart/alternative; boundary="=-22Z+tvKYNSOH9B8Ad6b7"
Date: Thu, 25 Oct 2012 16:25:31 -0700
Message-ID: <1351207531.29744.17.camel@pbryan-wsl.internal.salesforce.com>
Mime-Version: 1.0
X-Mailer: Evolution 2.28.3
Cc: Apps Discuss <discuss@apps.ietf.org>, Stefan Kögl <stefan@skoegl.net>
Subject: Re: [apps-discuss] draft-ietf-appsawg-json-pointer
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, 25 Oct 2012 23:25:57 -0000
I agree. JSON specifies only strings as member names, so there is no
ambiguity when resolving within an object. This issue boils-down to the
difference between JSON objects and Python dictionaries.
To help answer your question, perhaps I could know more about the Python
JSON library you're using to serialize Python data structures. How will
it handle the case where a key is not a string?
Without knowing this, I would be inclined to fail on non-string keys,
because the data structure is not conforming to the JSON specification.
Paul
On Wed, 2012-10-24 at 16:02 +1100, Mark Nottingham wrote:
> [forwarding to the WG]
>
> Hi Stefan,
>
> My .02 - this is really a question about JSON implementation, I think. JSON-Patch is designed to operate upon JSON documents (where this question doesn't come up), not upon Python data structures.
>
> Cheers,
>
>
> On 24/10/2012, at 3:04 AM, Stefan Kögl <stefan@skoegl.net> wrote:
>
> > -----BEGIN PGP SIGNED MESSAGE-----
> > Hash: SHA1
> >
> > Dear Working Group,
> >
> > I'm the maintainer of python-json-pointer [1], a Python implementation
> > of the json-pointer drafts.
> >
> > In Python the natural representation of a JSON object is a dictionary.
> > One of the differences is that a Python dictionary can have keys of
> > different types. I could, for instance, define the following dictionary
> >
> > {"1": "a", 1: "b"}
> >
> > and try to resolve the pointer /1. I see several possible ways of
> > resolving such cases:
> >
> > * Ignore any non-string key
> > * Fail on non-string keys
> > * Interpret both keys as equal and fail according to the following
> > sentence of the current draft:
> > " If a referenced member name is not unique in an object, the member
> > that is referenced is not unique in an object, the member that is
> > referenced is undefined, and evaluation fails (see below). "
> >
> > I understand that this problem can not occur in "pure" JSON where keys
> > can only be strings, but I assume that also implementations in other
> > languages will face the same issue. What is the opinion of the working
> > group on this? Maybe it could be addressed in future drafts.
> >
> >
> > Best regards,
> >
> > Stefan Kögl
> >
> >
> > [1] https://github.com/stefankoegl/python-json-pointer
> > -----BEGIN PGP SIGNATURE-----
> > Version: GnuPG v1.4.11 (GNU/Linux)
> > Comment: Using GnuPG with Mozilla - http://www.enigmail.net/
> >
> > iEYEARECAAYFAlCGwCUACgkQ638pvJMAJ9BbsQCfYeu9SVDSKE2Z6DBYUKaAl1/b
> > Z9gAoLRaMjzBgun8K8Wd3QEic0bYTxaC
> > =ttNc
> > -----END PGP SIGNATURE-----
>
> --
> Mark Nottingham http://www.mnot.net/
>
>
>
> _______________________________________________
> apps-discuss mailing list
> apps-discuss@ietf.org
> https://www.ietf.org/mailman/listinfo/apps-discuss
- Re: [apps-discuss] draft-ietf-appsawg-json-pointer Mark Nottingham
- Re: [apps-discuss] draft-ietf-appsawg-json-pointer Paul C. Bryan
- Re: [apps-discuss] draft-ietf-appsawg-json-pointer Stefan Kögl