Re: [Json] JSON Schema Language

Carsten Bormann <cabo@tzi.org> Sun, 05 May 2019 06:36 UTC

Return-Path: <cabo@tzi.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 10DF0120049 for <json@ietfa.amsl.com>; Sat, 4 May 2019 23:36:46 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -4.2
X-Spam-Level:
X-Spam-Status: No, score=-4.2 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3] 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 xwG7WK12oJ27 for <json@ietfa.amsl.com>; Sat, 4 May 2019 23:36:44 -0700 (PDT)
Received: from smtp.uni-bremen.de (gabriel-vm-2.zfn.uni-bremen.de [134.102.50.17]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 3C59212000E for <json@ietf.org>; Sat, 4 May 2019 23:36:44 -0700 (PDT)
Received: from [192.168.217.106] (p54A6CC75.dip0.t-ipconnect.de [84.166.204.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.uni-bremen.de (Postfix) with ESMTPSA id 44xbkL35JFzySR; Sun, 5 May 2019 08:36:42 +0200 (CEST)
Content-Type: text/plain; charset="utf-8"
Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\))
From: Carsten Bormann <cabo@tzi.org>
In-Reply-To: <35E2623E-753D-4918-8AF4-BF0BC5DE4868@bzfx.net>
Date: Sun, 05 May 2019 08:36:41 +0200
Cc: Anders Rundgren <anders.rundgren.net@gmail.com>, Ulysse Carion <ulysse@segment.com>, json@ietf.org
X-Mao-Original-Outgoing-Id: 578731000.013554-d7a4afd0e9e5d2e67b9351cfce1febf0
Content-Transfer-Encoding: quoted-printable
Message-Id: <876194AE-E1A5-438D-A2A0-58568ED10FE5@tzi.org>
References: <CAJK=1RjV1uv0eOdtFZ8cKn-FfCwCiGP5r2hOz1UamiM6YV4H1A@mail.gmail.com> <39682ec8-f993-a44c-d3e2-1638d2c1608f@gmail.com> <29CAE1CE-D6CB-4796-B2F2-2095BE921385@tzi.org> <AD5ABD9C-F5F2-477D-B862-529C890D5472@bzfx.net> <DA1767B8-22D6-4EA9-8112-4B36B79E9039@tzi.org> <D21B379B-23CC-48B3-BE10-D2777308E2E0@bzfx.net> <40f80ea0-d130-3f3b-39fa-2c84e802ed55@gmail.com> <35E2623E-753D-4918-8AF4-BF0BC5DE4868@bzfx.net>
To: Austin Wright <aaa@bzfx.net>
X-Mailer: Apple Mail (2.3445.9.1)
Archived-At: <https://mailarchive.ietf.org/arch/msg/json/zI3SNCLfBGYC3hiBVitJpXdxXvE>
Subject: Re: [Json] JSON Schema Language
X-BeenThere: json@ietf.org
X-Mailman-Version: 2.1.29
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: Sun, 05 May 2019 06:36:46 -0000

On May 5, 2019, at 08:16, Austin Wright <aaa@bzfx.net> wrote:
> 
> If the encoder knows the value will always be an integer, why add a fractional part?

(1) The encoder may not be privy to that information (it is a generic encoder).
(2) The encoder may try to fulfill a conflicting set of rules, set up by a different fork of the base standard, e.g.:

If the data comes as a floating point typed value, encode it as NR2 or NR3.
If the data comes as an integer typed value, encode it as NR1.
(This rule set is intended to preserve the distinction in implementation types, which may be important to some other application.
It is common in programming language notation, and since JSON was also derived from a programming language notation [albeit one without this rule set!], it is a common mistake to assume that this rule set can be applied to JSON without cost or damage.)

These conflicting sets of rules are exactly why it's so detrimental to fork a base standard with your own set of rules.

Grüße, Carsten