Re: [Json] Call for real-world examples of how parsers deal with duplicate keys

Nico Williams <nico@cryptonector.com> Thu, 06 June 2013 22:32 UTC

Return-Path: <nico@cryptonector.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 C09F921F962A for <json@ietfa.amsl.com>; Thu, 6 Jun 2013 15:32:21 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.977
X-Spam-Level:
X-Spam-Status: No, score=-1.977 tagged_above=-999 required=5 tests=[BAYES_00=-2.599, FM_FORGED_GMAIL=0.622]
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 qrY2VcNVVe8o for <json@ietfa.amsl.com>; Thu, 6 Jun 2013 15:32:13 -0700 (PDT)
Received: from homiemail-a30.g.dreamhost.com (caiajhbdccac.dreamhost.com [208.97.132.202]) by ietfa.amsl.com (Postfix) with ESMTP id D4EDF21F9424 for <json@ietf.org>; Thu, 6 Jun 2013 15:32:12 -0700 (PDT)
Received: from homiemail-a30.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a30.g.dreamhost.com (Postfix) with ESMTP id C896721DE7D for <json@ietf.org>; Thu, 6 Jun 2013 15:32:10 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=cryptonector.com; h= mime-version:in-reply-to:references:date:message-id:subject:from :to:cc:content-type; s=cryptonector.com; bh=plaqhp2TLfXBRv3NYg0W hX8+98g=; b=RT6dcWv3X5IEEXBA4QB//maM0RIUgkU47r1ZC5KorEP0U5jdYWkG AXK/XXO/kOg+MoSNybvMRI+fYviWsxDFKcLsbvk4VDlV5yIulKvhaWMiUaXkptUM DHGKqmTW0bxDS/HzewfcaVq8j+JcZ4UJApGSCycNrXwvMehafWL1ifg=
Received: from mail-wg0-f45.google.com (mail-wg0-f45.google.com [74.125.82.45]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: nico@cryptonector.com) by homiemail-a30.g.dreamhost.com (Postfix) with ESMTPSA id 5D61B21DE6F for <json@ietf.org>; Thu, 6 Jun 2013 15:32:10 -0700 (PDT)
Received: by mail-wg0-f45.google.com with SMTP id n12so2562493wgh.0 for <json@ietf.org>; Thu, 06 Jun 2013 15:32:08 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=y2SgDwrpHizVy/lNeGpecB1EmWOUHWuZdM/jw+Mg8WM=; b=K1J1jxJoNSk+P6s7eA0VKWyjTwoQtWrABljSxnCbAxIsOU6SXNNaLS2jVD5DCthK2X 333raQ6N/nBVbL13SAHFnkdCCNM67YVycQzmND6LPVUfmDgEUyoFNzM/k8/0Di6UTWVd edUJjAwn4xGsGeML2J4CwQO1n92Jc9KD8+8BhmI7MTg3/0yfffGuq/0v7ludGEGGXddW pSQkhJuLwQT0gztHy88NaxhV9sFI1pDB3l5MUQkfBAjWBnhxyOhGksNty9N1xqtArX0/ RLzeMI/oQmZ/KWrdalUV8rPfxNC9WIdy57506Z46nfUle8Weq/l6dMSgazP2wP6kH/13 mXVg==
MIME-Version: 1.0
X-Received: by 10.181.12.1 with SMTP id em1mr151114wid.4.1370557928225; Thu, 06 Jun 2013 15:32:08 -0700 (PDT)
Received: by 10.216.63.136 with HTTP; Thu, 6 Jun 2013 15:32:08 -0700 (PDT)
In-Reply-To: <C79C116D-16A4-41BA-9E5A-1055E6B9C941@vpnc.org>
References: <C79C116D-16A4-41BA-9E5A-1055E6B9C941@vpnc.org>
Date: Thu, 06 Jun 2013 17:32:08 -0500
Message-ID: <CAK3OfOh=bcEFWvw7W2K-O3M_PfzyTdead_SbKjTDdQ4GtGqCmQ@mail.gmail.com>
From: Nico Williams <nico@cryptonector.com>
To: Paul Hoffman <paul.hoffman@vpnc.org>
Content-Type: text/plain; charset="UTF-8"
Cc: "json@ietf.org" <json@ietf.org>
Subject: Re: [Json] Call for real-world examples of how parsers deal with duplicate keys
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: Thu, 06 Jun 2013 22:32:32 -0000

On Thu, Jun 6, 2013 at 12:41 PM, Paul Hoffman <paul.hoffman@vpnc.org> wrote:
> {"a":1,"a":2}

jq 1.3 returns 2:

%  echo '{"a":1,"a":2}'|./jq '.a'
2
%

Heimdal's parser takes the last value as well (from code inspection).

Nico
--