[Json] Fwd: Inconsistency between RFC 8259 and RFC 5234

Tim Bray <tbray@textuality.com> Tue, 12 December 2017 23:55 UTC

Return-Path: <tbray@textuality.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 0FD7F126DCA for <json@ietfa.amsl.com>; Tue, 12 Dec 2017 15:55:59 -0800 (PST)
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=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=textuality-com.20150623.gappssmtp.com
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 aKMQjHSq7ZOE for <json@ietfa.amsl.com>; Tue, 12 Dec 2017 15:55:57 -0800 (PST)
Received: from mail-wm0-x229.google.com (mail-wm0-x229.google.com [IPv6:2a00:1450:400c:c09::229]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id B5B74126CBF for <json@ietf.org>; Tue, 12 Dec 2017 15:55:56 -0800 (PST)
Received: by mail-wm0-x229.google.com with SMTP id 64so1818168wme.3 for <json@ietf.org>; Tue, 12 Dec 2017 15:55:56 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=textuality-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=YSRB0C7w2120pcREhC2JKp2T9DiF4PBTZem9skSu7AU=; b=T6lujqJkrNV+9NZoWXXCc/8YiO7uTVAl1++C4G+7nCx4+hvNbeCjoxNBdB3WAC6IvI 1yTqU1DkMs8oRrRqaGEi1xqIEdO87Vhqg3UTsgGC9L+KgiCtZNaDE98OEJsPlrHaca5h lTN9feW0gxG/fQigS85jTgbjii21FWbgFXXtrcvMJ9soWnzEAQuv8RFjMdBOhMn6m4qY 8nBmttc5annqfYGhus10sjqVQfA2AWJW+0mzO0N0MNKnzXCGa2Bfnjr7S1O/RxtAh3NF fse6gZJ3NES5+6GDbxaw/1LkLu800ds6DON5l5pKDYkYYT+yTkepq5WRv0qvj55XZAOk XYsA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=YSRB0C7w2120pcREhC2JKp2T9DiF4PBTZem9skSu7AU=; b=H7jbaayzWy8rYQjEjSwLzUBWvpz64tRy7OF45VFw3NgwpXJZdv8U7ZpCnWcciL3xGF VXb2Q5zw4HUIJyJCbIh4rREnUgd6U9CpCPfZlnsFZj0BI7aJYiP9ycaAInxHbXTn1jgQ 61ZBig6tWJrfZZquTsQxkZe+zaLDGUzFMhsjUpr20ero9iqoGk/WwqgETitgNxXuG4Ru eXEtE9xhnVbbGIM19DXdNdC2IlaOLO/enhwhc8VZkXU0ZwU4PeeaJILKTQ+wiYqYffmJ VmnWQTxx4CScCtoRiYqL1eGiZXE4QxK6rNb9yXoU2Q95sFRTa1mx9VLsMuhh+Zbhyr/O mCog==
X-Gm-Message-State: AKGB3mKYQOYAqm9tynDRJpsB1DVkslIdokTCy/b7ItTVslGLKbQyTFqY r9Wwvqxj/z3l/4/46DK5E4RLU+ss7EhCKEgazctn8POc
X-Google-Smtp-Source: ACJfBou7Gmlc59KtCWqshhkwqEsEgJUnA3i/va8IwZ4//SrmdDNois5lC5KlaE8X1ek46e8aYAWi9DiMsuZFfxLJOhg=
X-Received: by 10.80.139.180 with SMTP id m49mr5258965edm.36.1513122954983; Tue, 12 Dec 2017 15:55:54 -0800 (PST)
MIME-Version: 1.0
Received: by 10.80.243.1 with HTTP; Tue, 12 Dec 2017 15:55:54 -0800 (PST)
X-Originating-IP: [64.141.86.146]
Received: by 10.80.243.1 with HTTP; Tue, 12 Dec 2017 15:55:54 -0800 (PST)
In-Reply-To: <CAPeSZfAYyU34Qfwzn7ESgGCb052uZn0SZqeDyfvpw-5du2sqKA@mail.gmail.com>
References: <CAPeSZfAYyU34Qfwzn7ESgGCb052uZn0SZqeDyfvpw-5du2sqKA@mail.gmail.com>
From: Tim Bray <tbray@textuality.com>
Date: Tue, 12 Dec 2017 23:55:54 +0000
Message-ID: <CAHBU6ivZ9zLN3Np+AYszu5TK4kv88uOHq7VvMEiyERGFhh=cnQ@mail.gmail.com>
To: json@ietf.org
Content-Type: multipart/alternative; boundary="94eb2c19578e3bd9bc05602d640c"
Archived-At: <https://mailarchive.ietf.org/arch/msg/json/YBHyyHQxtVwpCVyx6jHZTL6gvTU>
Subject: [Json] Fwd: Inconsistency between RFC 8259 and RFC 5234
X-BeenThere: json@ietf.org
X-Mailman-Version: 2.1.22
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: Tue, 12 Dec 2017 23:55:59 -0000

Ouch, I think he's right.
---------- Forwarded message ----------
From: "Dale Schumacher" <dale.schumacher@gmail.com>
Date: Dec 12, 2017 12:42 PM
Subject: Inconsistency between RFC 8259 and RFC 5234
To: "Tim Bray" <tbray@textuality.com>
Cc: "Douglas Crockford" <douglas@crockford.com>

I'm attempted to reach out to you directly, since https://www.rfc-editor.
org/info/rfc8259 (the recommended feedback channel) currently returns "RFC
8259 does not exist".

It appears that the JSON grammar makes use of two "Core" ABNF rules:

         DIGIT          =  %x30-39
                                ; 0-9

         HEXDIG         =  DIGIT / "A" / "B" / "C" / "D" / "E" / "F"


However, JSON allows both upper and lower case in Unicode escapes within a
string. In which case, the grammar for such escapes:

      char = unescaped /
          escape (
              %x22 /          ; "    quotation mark  U+0022
              %x5C /          ; \    reverse solidus U+005C
              %x2F /          ; /    solidus         U+002F
              %x62 /          ; b    backspace       U+0008
              %x66 /          ; f    form feed       U+000C
              %x6E /          ; n    line feed       U+000A
              %x72 /          ; r    carriage return U+000D
              %x74 /          ; t    tab             U+0009
              %x75 4HEXDIG )  ; uXXXX                U+XXXX


is incorrect.

If I may be permitted a recommendation, I would suggest that the JSON
grammar _not_ use the "Core" ABNF rules. Instead it could provide local
definitions such as:

      digit0-9 = %x30-39         ; 0-9

      hexdigit = digit0-9 / %x41-x46 / %x61-66


The use of "Core" ABNF rules doesn't seem to save much, in this case, and
the indirection makes it easy to overlook this inconsistency.

Thanks for your consideration,
Dale Schumacher