Re: [Json] [Technical Errata Reported] RFC8259 (7617)

Rob Sayre <sayrer@gmail.com> Fri, 25 August 2023 05:11 UTC

Return-Path: <sayrer@gmail.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 A0DC5C151533 for <json@ietfa.amsl.com>; Thu, 24 Aug 2023 22:11:05 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.104
X-Spam-Level:
X-Spam-Status: No, score=-2.104 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, URIBL_BLOCKED=0.001, URIBL_DBL_BLOCKED_OPENDNS=0.001, URIBL_ZEN_BLOCKED_OPENDNS=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com
Received: from mail.ietf.org ([50.223.129.194]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 3dEIkwRuHPpR for <json@ietfa.amsl.com>; Thu, 24 Aug 2023 22:11:01 -0700 (PDT)
Received: from mail-ed1-x535.google.com (mail-ed1-x535.google.com [IPv6:2a00:1450:4864:20::535]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 4B93CC14CE27 for <json@ietf.org>; Thu, 24 Aug 2023 22:11:01 -0700 (PDT)
Received: by mail-ed1-x535.google.com with SMTP id 4fb4d7f45d1cf-52a3ff5f0abso793154a12.1 for <json@ietf.org>; Thu, 24 Aug 2023 22:11:01 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1692940260; x=1693545060; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=H6SvUzF4EyAcu893X2zEuhe1fZh7HmtjaSSL6fkTPbg=; b=ZufeknoxMVicnN6BqkRwODukVgxtGYicWsk2gq3fTp2BwrVQddS2XmsmdHwCBgESR7 fcQ5FM+L0ibLeAx8Z+4pvH5yfsZeEeNKeLCWlnGg6y8SiZa97tdgIWJ4dd76YWidzsSR P+3rRdYjvC8IAqZISKFVT+h2JFNCnmRywovv4qu35oZ/QuNW+RSWhyc/EhnnZle8th2P Ar65/u2r04FfTxXTskjPhyt2P2yW/XJBiw+MRlz7nzAYBQOLvaQxpiCu1PE3YETEEyjI PBcRV16FOJy+Z//HpWawsuK24WWAS1EbNVvbeYipCBkSkRuiecC1oAJ2SHPnuR4muQHX hUTA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692940260; x=1693545060; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=H6SvUzF4EyAcu893X2zEuhe1fZh7HmtjaSSL6fkTPbg=; b=CZt6JiJBGKGnXT1/q0Ps49qbcabFH5kgmruidsVqS3bGI8Vq6/e7aql3POX2KqNpiF 4taBwEeFVLFiMHwy4jgF6pW5PFxf6gFbe6t333y5pjVN106fsADp+hqWloOlNOmQamvF Gw9GAM5gjYPgcLEsCuAMwDOczbMtnGr3gk1+ikG7JoQV+3987N7ecs3V+rKJ+FF5JWkX EvKuweDleS0i/tDdgo3zta8kpDPISqTREG4OfMuTzFEHpxAgUWziLnUHjocwgejmFZYN xWz4fxEEs7YnqoXD3MYfocDq3Vs24oz1s65GZcnDvql6OEDkSxbzK5iUBv1Li/GE7qvJ R70g==
X-Gm-Message-State: AOJu0YwCb8S61q97hIrjIfQUIQJ5qYYoyaHhkfresxRqAXDSgqoS/H+J IUUmGQD3/akoWaIk7cI87EYNtOb4GXo1cRqOtyE=
X-Google-Smtp-Source: AGHT+IGchU6h8FNm/k+C3kJ2lpcuqmADstU1AZHIKpoDP4QoXMEZ2hop2rfBVDuhCDOHkLUkU0vckdSMQKZTCquG1qo=
X-Received: by 2002:a50:fa93:0:b0:523:102f:3cdd with SMTP id w19-20020a50fa93000000b00523102f3cddmr14330400edr.19.1692940259457; Thu, 24 Aug 2023 22:10:59 -0700 (PDT)
MIME-Version: 1.0
References: <20230825043204.35FABAFB45@rfcpa.amsl.com>
In-Reply-To: <20230825043204.35FABAFB45@rfcpa.amsl.com>
From: Rob Sayre <sayrer@gmail.com>
Date: Thu, 24 Aug 2023 22:10:48 -0700
Message-ID: <CAChr6Sxjs_vhOVbt7_tdZ3tDC+E6TXfbdc0vEwZPyEEYphTqkw@mail.gmail.com>
To: RFC Errata System <rfc-editor@rfc-editor.org>
Cc: tbray@textuality.com, superuser@gmail.com, francesca.palombini@ericsson.com, linuxwolf+ietf@outer-planes.net, guillaume.fortin@debigare.com, json@ietf.org
Content-Type: multipart/alternative; boundary="000000000000ca7eb70603b85e98"
Archived-At: <https://mailarchive.ietf.org/arch/msg/json/GNT2ME_kneI71oeyTU0IpyrtJjw>
Subject: Re: [Json] [Technical Errata Reported] RFC8259 (7617)
X-BeenThere: json@ietf.org
X-Mailman-Version: 2.1.39
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: Fri, 25 Aug 2023 05:11:05 -0000

On Thu, Aug 24, 2023 at 9:32 PM RFC Errata System <rfc-editor@rfc-editor.org>
wrote:

> --------------------------------------
> You may review the report below and at:
> https://www.rfc-editor.org/errata/eid7617
>
> --------------------------------------
> Type: Technical
> Reported by: Guillaume Fortin-Debigaré <guillaume.fortin@debigare.com>
>
> Notes
> -----
> IEEE 754 does not consider negative zero and positive zero to be the same
> numeric value, even though it considers them equal. Despite this,
> JavaScript serializes negative zero as the JSON text "0", which contradicts
> the original text.
>

I don't think this is a problem with the JSON RFC. The dispute here is
about JSON.stringify(), part of the ECMAScript specification. Consult:

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify

There are many such choices in there:

JSON.stringify({test: 0})
'{"test":0}'
JSON.stringify({test: -0})
'{"test":0}'
JSON.stringify({test: Infinity})
'{"test":null}'


> My suggested correction mentions "rational numbers in decimal or
> scientific notation" since it's never explicitly mentioned in the document
> how a number should be interpreted when parsed to maximize
> interoperability. This version addresses that concern at the same time.
>

The document does say "A number is represented in base 10 using decimal
digits."

JSON.parse('{"test": 0}')
{test: 0}
JSON.parse('{"test": -0}')
{test: -0}

thanks,
Rob