Re: [Json] Another problematic JSON Schema use-case

Peter Cordell <petejson@codalogic.com> Thu, 26 May 2016 21:27 UTC

Return-Path: <petejson@codalogic.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 30B7E12D75C for <json@ietfa.amsl.com>; Thu, 26 May 2016 14:27:37 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -0.92
X-Spam-Level:
X-Spam-Status: No, score=-0.92 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RDNS_DYNAMIC=0.982, SPF_HELO_PASS=-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 bn-2ueRgijfx for <json@ietfa.amsl.com>; Thu, 26 May 2016 14:27:35 -0700 (PDT)
Received: from ppsa-online.com (lvps217-199-162-192.vps.webfusion.co.uk [217.199.162.192]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id EDC2012D150 for <json@ietf.org>; Thu, 26 May 2016 14:27:34 -0700 (PDT)
Received: (qmail 25909 invoked from network); 26 May 2016 22:22:42 +0100
Received: from host86-135-56-118.range86-135.btcentralplus.com (HELO ?192.168.1.72?) (86.135.56.118) by lvps217-199-162-217.vps.webfusion.co.uk with ESMTPSA (DHE-RSA-AES128-SHA encrypted, authenticated); 26 May 2016 22:22:42 +0100
To: John Cowan <cowan@mercury.ccil.org>
References: <CAMm+Lwg2rWh0_gjXnSAEAvWtsMO1U3UiA8jsBzc+rRR6fiKcJg@mail.gmail.com> <20160526173719.GA19074@mercury.ccil.org>
From: Peter Cordell <petejson@codalogic.com>
Message-ID: <064f4df2-75d5-6952-cd18-e22e7510b3a6@codalogic.com>
Date: Thu, 26 May 2016 22:27:30 +0100
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0
MIME-Version: 1.0
In-Reply-To: <20160526173719.GA19074@mercury.ccil.org>
Content-Type: text/plain; charset="windows-1252"; format="flowed"
Content-Transfer-Encoding: 7bit
Archived-At: <http://mailarchive.ietf.org/arch/msg/json/gDtXOidDRYzq_3Au92JDzwKaLAA>
Cc: "json@ietf.org" <json@ietf.org>
Subject: Re: [Json] Another problematic JSON Schema use-case
X-BeenThere: json@ietf.org
X-Mailman-Version: 2.1.17
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: Thu, 26 May 2016 21:27:37 -0000

On 26/05/2016 18:37, John Cowan wrote:
>
> Here's a sketch of a simple schema-by-example language:
>


I think sort of thing in JCR by having a directive such as
#infer-types, e.g.

     #infer-types
     { "foo" : "bar" }

'foo' is then any string, not just "bar".

If that is too intrusive, you could have a configuration option to the 
JCR parser to select similar type inferring.

I think that would be useful as 'by-example' is perhaps an easy way to 
start creating a schema, but I feel you'd want to go beyond what it can 
offer within a matter of hours.

Pete.
-- 
---------------------------------------------------------------------
Pete Cordell
Codalogic Ltd
Read & write XML in C++, http://www.xml2cpp.com
---------------------------------------------------------------------