Re: [Json] JSON Schema Language

Phillip Hallam-Baker <ietf@hallambaker.com> Wed, 29 May 2019 20:54 UTC

Return-Path: <hallam@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 937DE1201E2 for <json@ietfa.amsl.com>; Wed, 29 May 2019 13:54:34 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.719
X-Spam-Level:
X-Spam-Status: No, score=-1.719 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, FREEMAIL_FORGED_FROMDOMAIN=0.198, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=no 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 e2rz818baHNU for <json@ietfa.amsl.com>; Wed, 29 May 2019 13:54:32 -0700 (PDT)
Received: from mail-ot1-f54.google.com (mail-ot1-f54.google.com [209.85.210.54]) (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 B2E461201E0 for <json@ietf.org>; Wed, 29 May 2019 13:54:32 -0700 (PDT)
Received: by mail-ot1-f54.google.com with SMTP id i8so3456837oth.10 for <json@ietf.org>; Wed, 29 May 2019 13:54:32 -0700 (PDT)
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=mR0yORgt8M8e8Vq1ORdFV49b8Zwq8gsE3MizIZSN4dw=; b=n/srzzPF+A0jCQhl/tAxxbNiGA1Ln/Z0XqDu4C4PCplLPn86Rrm4BhOxSDMYGZgjlo W+RCVJ2ib2/xOgCRpanwvi3t9My1d3+tuNkPra4hBF/TfKLBRC87wB3tWLjTN+ghxQ5s HQGVOog1ZTGsMv9nqKslBx18ckys7MAdhlU9iKAbiYnkz0VDoWSJqD67yG13DURDTKBl cgmj9kBPZZFSMOeuwwB8GDhWguleiaqWq93CPe2nn0ig12Wkh0VEGnrYHfKvFw1GrmBq eCO7zCoEP42ROuCHtplxLxjApMmQALd/GL3hvMGCEr9lMXRK4AV3OKnrOc6lIceNoQ1H 6LCw==
X-Gm-Message-State: APjAAAVWMrX1aS2HjEOj/2vmQpF8R91dw5cVgvVF7Ft5uh2HMDmDuTvI KBH24ZFmVlWdmWM/Vhj5QW7yX3Y1tVR8Pk1uQDI=
X-Google-Smtp-Source: APXvYqzthYVFu/2CBEroNHZ1NyE8d+s0s30ydvJ90Ex3Zpo2H8bxBnkOIeuNudnKXrMygbR+jFrcg2IvHyi5i4Ro0Ho=
X-Received: by 2002:a9d:3442:: with SMTP id v60mr5286061otb.112.1559163271985; Wed, 29 May 2019 13:54:31 -0700 (PDT)
MIME-Version: 1.0
References: <CAJK=1Rj7PBD-bbwvsqgjQQzp4Aoidb-W2q5Lj6asMHHDHaTVYQ@mail.gmail.com> <646abf11-496b-c120-45d6-2a1aeab051a8@codalogic.com> <8224451C-F21B-41E5-A834-A9005050CB1F@tzi.org> <CAJK=1RjdYD6TZCNrw=H3d9ZLKLxZZOwVCOYYPwfbP+1ETDDz1Q@mail.gmail.com> <11CDA7F6-30BB-40E4-8926-2EDCBCFD785B@tzi.org> <CAHBU6iv8ZsFM5yco5gi+gcyU8d=u3bOSgiKaF6-hv-GARgNh9w@mail.gmail.com> <CAChr6SwNvG4Z7TKUxAVeH7HMVWiPsEBNb12K9zVkjaGt2_v0fw@mail.gmail.com> <CAHBU6ivTD_v7L-wQ+P9TmSfBY=5N+k-caaZ0TZhg6yZ_SWR_aA@mail.gmail.com> <CAChr6SzD8qdETafQKKU41BcYayTWf+C4GENd9FNzy5JYOv5jRQ@mail.gmail.com> <CAHBU6isx5aB94U-vn_t6GGoQ9W+ATDNYR6_+CtXgOhFho5Qh-g@mail.gmail.com> <20190529144005.GC11773@localhost>
In-Reply-To: <20190529144005.GC11773@localhost>
From: Phillip Hallam-Baker <ietf@hallambaker.com>
Date: Wed, 29 May 2019 16:54:11 -0400
Message-ID: <CAMm+Lwhdzhy9iApLrQ6yoJkzqOxQ3VH+bnc+7f76WKW7VMTUYw@mail.gmail.com>
To: Nico Williams <nico@cryptonector.com>
Cc: Tim Bray <tbray@textuality.com>, JSON WG <json@ietf.org>, Carsten Bormann <cabo@tzi.org>, Ulysse Carion <ulysse@segment.com>, Rob Sayre <sayrer@gmail.com>
Content-Type: multipart/alternative; boundary="000000000000f93f41058a0cfcc9"
Archived-At: <https://mailarchive.ietf.org/arch/msg/json/ib3CZlag4XkAZ5QSOYE__rNKcFE>
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: Wed, 29 May 2019 20:54:34 -0000

On Wed, May 29, 2019 at 10:59 AM Nico Williams <nico@cryptonector.com>
wrote:

> On Tue, May 28, 2019 at 08:47:16PM -0700, Tim Bray wrote:
> > TBH, what I want from a schema system is (a) useful error messages and
> (b)
> > ability to drive code generation, classes and serializer/deserializers
> and
> > so on.
>
> This is all I want as well.  Validation and codegen.
>


I use mine for code generation and for document generation. The drafts are
produced by the same source that generates the code used to create the
examples.

Validation is another issue entirely. I don't think it is actually useful
beyond 'can the data be deserialized'. It is problematic if someone sends a
string in a field where I really need an integer, but additional fields I
will simply ignore unless they are in some SAML Conditions like structure
which MUST be understood. But the only reason to use that approach is when
you require a means of signalling a breaking change.

The tools I am currently using are on Github and they work on Windows, OSX
and Linux.

This is not the approach I would use if I was going to propose a standard.
There are a half dozen different schema systems that vary by small degrees
for different purposes that I think could be merged.


https://github.com/hallambaker/PHB-Build-Tools