Re: [Json] Go JSON parser ignores the case of member names

John Cowan <cowan@mercury.ccil.org> Thu, 10 March 2016 02:15 UTC

Return-Path: <cowan@ccil.org>
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 F18B812DD18 for <json@ietfa.amsl.com>; Wed, 9 Mar 2016 18:15:09 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.602
X-Spam-Level:
X-Spam-Status: No, score=-2.602 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id yDc_wp6PpFcI for <json@ietfa.amsl.com>; Wed, 9 Mar 2016 18:15:08 -0800 (PST)
Received: from earth.ccil.org (earth.ccil.org [192.190.237.11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 5317212DCF4 for <json@ietf.org>; Wed, 9 Mar 2016 18:15:08 -0800 (PST)
Received: from cowan by earth.ccil.org with local (Exim 4.72) (envelope-from <cowan@ccil.org>) id 1adq7y-0006d9-Bc; Wed, 09 Mar 2016 21:15:02 -0500
Date: Wed, 9 Mar 2016 21:15:02 -0500
From: John Cowan <cowan@mercury.ccil.org>
To: Rob Sayre <sayrer@gmail.com>
Message-ID: <20160310021502.GD9515@mercury.ccil.org>
References: <255B9BB34FB7D647A506DC292726F6E13BBE5873A1@WSMSG3153V.srv.dir.telstra.com> <20160309012028.GQ32247@mercury.ccil.org> <CAChr6SyGoRO-CgH5cPSXLLhnqkd5kJb9XpJ-evgJ1kB=mUot9A@mail.gmail.com> <20160309213830.GB9515@mercury.ccil.org> <CAChr6SwdCcb=xd+K4J2tbDqKSmqWjEoO8DKhb1QrtG9KEo28rw@mail.gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <CAChr6SwdCcb=xd+K4J2tbDqKSmqWjEoO8DKhb1QrtG9KEo28rw@mail.gmail.com>
User-Agent: Mutt/1.5.20 (2009-06-14)
Sender: John Cowan <cowan@ccil.org>
Archived-At: <http://mailarchive.ietf.org/arch/msg/json/FuOQ70EsG8cHbXYi5OiBNFfGHV8>
Cc: "Manger, James" <James.H.Manger@team.telstra.com>, "json@ietf.org" <json@ietf.org>
Subject: Re: [Json] Go JSON parser ignores the case of member names
X-BeenThere: json@ietf.org
X-Mailman-Version: 2.1.17
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: <https://mailarchive.ietf.org/arch/browse/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, 10 Mar 2016 02:15:10 -0000

Rob Sayre scripsit:

> I understand the situation. I guess I don't agree there's a conformance
> problem here, since there are plenty of other APIs in the standard package
> that don't do this transformation, and even the API in question doesn't do
> this transformation for all arguments. They're right below the section
> James quoted.

Ah.  I didn't know that.

> BTW, here's how to get a similar effect using the widely-used Java library
> Jackson[0]:
> 
> ObjectMapper objectMapper = new ObjectMapper();
> objectMapper.configure(MapperFeature.ACCEPT_CASE_INSENSITIVE_PROPERTIES,
> true);

Sure, but this is a feature you have to enable specifically, not the
default.  But from what you are saying, the Go case mapping is not the
default either.

It's perfectly reasonable, given how much ill-formed or incorrect JSON
there is, to have relaxed modes.  It's just that the main mode should
be strict.

-- 
John Cowan          http://www.ccil.org/~cowan        cowan@ccil.org
Verbogeny is one of the pleasurettes of a creatific thinkerizer.
        --Peter da Silva