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

John Cowan <> Wed, 09 March 2016 21:55 UTC

Return-Path: <>
Received: from localhost (localhost []) by (Postfix) with ESMTP id 6809312DA36 for <>; Wed, 9 Mar 2016 13:55:01 -0800 (PST)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: -0.703
X-Spam-Status: No, score=-0.703 tagged_above=-999 required=5 tests=[BAYES_20=-0.001, RCVD_IN_DNSWL_LOW=-0.7, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id QzxGQ-2_ahgS for <>; Wed, 9 Mar 2016 13:54:51 -0800 (PST)
Received: from ( []) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by (Postfix) with ESMTPS id 45E6212D8B9 for <>; Wed, 9 Mar 2016 13:54:51 -0800 (PST)
Received: from cowan by with local (Exim 4.72) (envelope-from <>) id 1adloN-0003yq-4e; Wed, 09 Mar 2016 16:38:31 -0500
Date: Wed, 9 Mar 2016 16:38:31 -0500
From: John Cowan <>
To: Rob Sayre <>
Message-ID: <>
References: <> <> <>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <>
User-Agent: Mutt/1.5.20 (2009-06-14)
Sender: John Cowan <>
Archived-At: <>
Cc: "Manger, James" <>, "" <>
Subject: Re: [Json] Go JSON parser ignores the case of member names
X-Mailman-Version: 2.1.17
Precedence: list
List-Id: "JavaScript Object Notation \(JSON\) WG mailing list" <>
List-Unsubscribe: <>, <>
List-Archive: <>
List-Post: <>
List-Help: <>
List-Subscribe: <>, <>
X-List-Received-Date: Wed, 09 Mar 2016 21:55:01 -0000

Rob Sayre scripsit:

> Well, there are ways to avoid it too (see below). I see it more as an
> object-mapper convenience than a JSON conformance problem. I imagine object
> mapping libraries in other languages have this feature too.

The problem arises in cases like this: Suppose the spec says that key
"alg" specifies the name of the algorithm, and defaults to "none" if
there is no key.  Then if the upstream provider sends {"typ" : "JWS",
"ALG": "HS256"}, then a receiver written in Go will see the algorithm
as HS256, whereas any other receiver will see the algorithm as "none".
That's almost certainly not the desired result.

John Cowan
To say that Bilbo's breath was taken away is no description at all.  There are
no words left to express his staggerment, since Men changed the language that
they learned of elves in the days when all the world was wonderful. --The Hobbit