Re: [Json] JSON Schema Language: extensibility and unspecified properties

Richard Gibson <richard.gibson@gmail.com> Tue, 20 August 2019 14:34 UTC

Return-Path: <richard.gibson@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 104A3120074 for <json@ietfa.amsl.com>; Tue, 20 Aug 2019 07:34:58 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.997
X-Spam-Level:
X-Spam-Status: No, score=-1.997 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=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 ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id VoupbmOKxAa4 for <json@ietfa.amsl.com>; Tue, 20 Aug 2019 07:34:56 -0700 (PDT)
Received: from mail-lf1-x136.google.com (mail-lf1-x136.google.com [IPv6:2a00:1450:4864:20::136]) (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 8D59212000F for <json@ietf.org>; Tue, 20 Aug 2019 07:34:55 -0700 (PDT)
Received: by mail-lf1-x136.google.com with SMTP id c9so4316744lfh.4 for <json@ietf.org>; Tue, 20 Aug 2019 07:34:55 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=wD4i8AYdfIwRrhcQOt+h5U+E+MQ1/H/n3m3qm33DJqM=; b=GKgyx2E3nNbOzWpyuRtUfF+FJ+Xg2BKZAF1t/dY+67hcsp2vcWpduV2Jb06OflwlIm 2GlAm7wd3qrhaKJPlqKKc0mHKMLDg5DGV5rldRh++SB5kKCPFflwOVwmVVcyA7gYU0l8 QlKTpVf8zhTlOp9df6YnwLEBGtHx7N37UBo6SMKr67JLdcnzfQ1Afz69/xsw8bZd0Wsu kIJGErlMZ15jjjAtJBON2XcJrsjlnKjNT/onE55D/kLnQwun2mQ/VMwzSxPrZOcTg5wY liO3I8x2vwKMo9aqxz5V10SAnSP6iues0lj6L4v/mUOrcS2xOczugaDP6KAdlH1BYT85 +ZyA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=wD4i8AYdfIwRrhcQOt+h5U+E+MQ1/H/n3m3qm33DJqM=; b=KliKeGjLGDflc3BzAvu5flkCz4ZU/50BWHZRJJI1ijv6sGp1sGa6vWI+oklrjkWPnQ nN1TRaWo96zYbOv2+6QUwNeQuVbCt+Z/Szv3IZO2yP5Kc5VPHfiZCOJkXcpp46Q9CQAP iLMgjdjHTzzEoiHERJw4r86Sxz0x2+UI4WGLPP0kLBNhnbdMCenW53AvoC3lNBdoR7xR Z8HQRRpfRE2Jq24hOKrt3eT9FymZ4mRllln9fqR534HvwkKHeGwLYgNKzudCtKs/8ITT ZdbC+7Oodb6yAKIBGsvVGMA7wLndypLhZQ4D9bdV51+EBX7p0Di2DP1iy2jhusd7l4vK E9XQ==
X-Gm-Message-State: APjAAAXkSnl2r5C12JM6oNsNjR22Qbv2aEFAU8tTJk6DwM6Qss/EwMZl Fz4RfaPgAMWAxmeDp+HZ3XC1QoVo9UxsjnBVtmQ=
X-Google-Smtp-Source: APXvYqwDkuX8LcTj3dwJmaEsg/lOquD9q4MajtkMcrgnJ8Wzygmd29Sf4xV+zG84SyYYFNN5ur+Zpg50LToVLWdIoNQ=
X-Received: by 2002:a19:e04f:: with SMTP id g15mr15952372lfj.46.1566311693878; Tue, 20 Aug 2019 07:34:53 -0700 (PDT)
MIME-Version: 1.0
References: <CAJK=1RhXp85cz-pOAQPw2JM=CYHgGSygj4Hw0spht56jbzQE2g@mail.gmail.com> <53094378-B559-49E1-B42B-54FBA8BC35AA@tzi.org> <CAJK=1Rj6Q3CvpF9aYML=47SF_XP49=O2hLhcBo8gZCb73C0RAw@mail.gmail.com> <FDB93E41-9D7D-4BF2-8D01-F4D075774848@tzi.org> <CAJK=1RiE_+nHkeB77DericN498w1v9mf2hsBgnQtgsZTVM9N9A@mail.gmail.com> <118F844A-453D-497D-8107-CF2BD05AC313@tzi.org> <CAJK=1Rgqek+rh+dj2xNWD7WKS48oQoHiqhj5dDT2D3dD7OZs1Q@mail.gmail.com> <CALH+fvpwM1hRByXv1y0UwUYPwKcb2JZT4v5qqZVeySFvEo-Z7A@mail.gmail.com> <CAJK=1RjJUzrpL+=t+5sXAnkYBDKpNazZCViY=PZt7qFFcN2t3g@mail.gmail.com> <CALH+fvqsn_purpNR8KHRe9GtdVizzDCbOSDTK8SMJc-8of-x8w@mail.gmail.com> <CAJK=1RjFaopyCWonU8kgkhowWzB8KXdVNQp_W+A3S7XFdz0fsg@mail.gmail.com> <e1f6f8e9-2bdb-d4e9-3a87-13869adfc8cc@codalogic.com>
In-Reply-To: <e1f6f8e9-2bdb-d4e9-3a87-13869adfc8cc@codalogic.com>
From: Richard Gibson <richard.gibson@gmail.com>
Date: Tue, 20 Aug 2019 10:34:42 -0400
Message-ID: <CALH+fvqXZV54Rf8QX_m_vkrgoto8+5U0_wFYds7TTp45Rd8rAw@mail.gmail.com>
To: Pete Cordell <petejson@codalogic.com>
Cc: Ulysse Carion <ulysse@segment.com>, Carsten Bormann <cabo@tzi.org>, JSON WG <json@ietf.org>
Content-Type: multipart/alternative; boundary="0000000000001f0c6005908d5c78"
Archived-At: <https://mailarchive.ietf.org/arch/msg/json/XU51t-G-HRJA_6RB0T_iBjdHY1o>
Subject: Re: [Json] JSON Schema Language: extensibility and unspecified properties
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: Tue, 20 Aug 2019 14:34:58 -0000

Exactly. binary64 is an obvious option since it is the source of the
bounds, but int64 is equally capable of fulfilling the role. Just like int8
imposes constraints on a value without requiring any particular
machine-local treatment or representation (which should remain irrelevant
to the schema language itself), so too would int53.

On Tue, Aug 20, 2019 at 7:54 AM Pete Cordell <petejson@codalogic.com> wrote:

> On 20/08/2019 04:26, Ulysse Carion wrote:
> >> An "int53" type or other means of requiring that a JSON number have
> zero fractional part and magnitude no greater than 2^53.
> >
> > Ah -- in that case, I think it fails the other part of the criterion I
> > put forward: having "a clear mapping to programming languages in
> > widespread use today." In case the language is unclear, my thinking
> > was that both (1) and (2) need to be satisfied for something to be
> > included in the spec.
> >
> > At least on my view, int53's correspondence is unclear -- should it be
> > a double/f64, or a long/int64_t, with a runtime check to make sure
> > it's in-bounds? That's not very idiomatic. Better, in my view, to
> > stick to uncontroversial things?
>
> IMO, the schema should be about representing what the protocol needs
> rather than how it is represented on a target machine.
>
> An implementation may choose to store an int8 in a 32-bit integer. As
> long as it does suitable bounds checking at the appropriate points
> nothing outside the machine need know that it has chosen to do that.
>
> There may be cases where there is a need for something that is larger
> than int32 but more inter-operable than int64. int53 satisfies that need
> in many cases.
>
> Mapping it to either double/f64 or long/int64_t is a local
> implementation choice.
>
> Pete.
> --
> ---------------------------------------------------------------------
> Pete Cordell
> Codalogic Ltd
> C++ tools for C++ programmers, http://codalogic.com
> Read & write XML in C++, http://www.xml2cpp.com
> ---------------------------------------------------------------------
>