Re: [Json] Schemas & so on

Anders Rundgren <> Mon, 02 May 2016 05:58 UTC

Return-Path: <>
Received: from localhost (localhost []) by (Postfix) with ESMTP id 2254E12D0F5 for <>; Sun, 1 May 2016 22:58:12 -0700 (PDT)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: -2.699
X-Spam-Status: No, score=-2.699 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_LOW=-0.7, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: (amavisd-new); dkim=pass (2048-bit key)
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id C1Q55qTAYw8N for <>; Sun, 1 May 2016 22:58:10 -0700 (PDT)
Received: from ( [IPv6:2a00:1450:400c:c09::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by (Postfix) with ESMTPS id C5DD212B062 for <>; Sun, 1 May 2016 22:58:09 -0700 (PDT)
Received: by with SMTP id g17so125233322wme.1 for <>; Sun, 01 May 2016 22:58:09 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;; s=20120113; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to; bh=XPaC1sHiy3PTj4gwd9p5X+fgSxYWWC9bGYBPDRyg7OE=; b=xLTdfCOlh6Wq480R9li5BJzVmOQeMOdXG+ly/A6893f6PrT04VS0yHhxYWqGSTCHh1 VunfK4cnt0b36X8orexlhKlAZKqQYbWAAVlrZs0JwecYTlGakCcxvxrzmfEUy2g2O5XY ABDpsavc6FXuNBNepxZoqrzV+OJUBSKiMUKNZvpiA54nV5zRa+Q1lQ6sN0JAzp40swvM 6E+kMFSRNu8ORt48i+wg6PLT2aj2LI8pKTbPeRq56oMLQ8+FQmkqFIyyIvUSaNpitcuk CuamaSWqSvXbnTYacU7K4qyMxJ3jE/PCFxGmobWN7vgMnjFUeKLMz8Yd/7QPHrd+Ed0m 4CUQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;; s=20130820; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to; bh=XPaC1sHiy3PTj4gwd9p5X+fgSxYWWC9bGYBPDRyg7OE=; b=S7f8XbQAwrLjEVLNVpxgHRcNLMrRx/3w+1K9mrQWe4zt9aznF0YcLFmhUnhf/I+ryx YbBf3W21B0/AyQ4MsyGvKWe1SSFgsByobA90HnZl4nwH9gL1OrflUFgixHVMyJ+QoxzY dwmPs0VvTT7fq99Y9vhbsxcsglEP3t8eAe41qKPWlQepZFna5RC53CzQfJE0ITdbzgFr 2EwJC2YjAFlM/HB1U5LetdXfq2J4H8g+7ZpRneWQOtqKqKpTjq6yi5jR45TuS1TxyiDc 6EF+gzL5AyCZ/WGYVfT0Eo2QViUooZiE5m0ZEj3K84hzHTOOnErDPnOeoJII2ImK8jyQ OHCg==
X-Gm-Message-State: AOPr4FW8lVoU7V7LaVPXkzUiDfjLtfTAOohKGOMt5TGVGfW4qKJNsFj/w6xEFY9gAxZMTQ==
X-Received: by with SMTP id qb5mr33615343wjc.171.1462168688166; Sun, 01 May 2016 22:58:08 -0700 (PDT)
Received: from [] ( []) by with ESMTPSA id vu4sm28412695wjc.27.2016. (version=TLSv1/SSLv3 cipher=OTHER); Sun, 01 May 2016 22:58:07 -0700 (PDT)
To: Tim Bray <>, "" <>
References: <>
From: Anders Rundgren <>
Message-ID: <>
Date: Mon, 2 May 2016 07:57:52 +0200
User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.0
MIME-Version: 1.0
In-Reply-To: <>
Content-Type: multipart/alternative; boundary="------------160C499AE62A551E8E7DD5CC"
Archived-At: <>
Subject: Re: [Json] Schemas & so on
X-Mailman-Version: 2.1.17
Precedence: list
List-Id: "JavaScript Object Notation \(JSON\) WG mailing list" <>
List-Unsubscribe: <>, <>
List-Archive: <>
List-Post: <>
List-Help: <>
List-Subscribe: <>, <>
X-List-Received-Date: Mon, 02 May 2016 05:58:12 -0000

On 2016-05-01 22:55, Tim Bray wrote:
> I find myself tasked with specifying a JSON-based DSL and preparing it for public release, with a validator and so on.
> I had never really concerned myself much with options for JSON language definition, but have discovered they’re not very good.  The JSON Schema project is not terribly appealing - opaque spec, poor documentation and tools - and smells of neglect (last I-D expired in 2013).  It's been suggested that a good approach would be just to write a jq program that emits true or false.
> Is there good conventional wisdom about formally specifying a JSON dialect?

I had used XML Schema for 10Y+ before I became a JSON "convert".

I addressed the problem you mentioned in another and less formal way:

1. Creating a strongly typed JSON parser with access methods like getString(), getInt() etc.  This also supports some derived types that you most likely need such as dateTime, BigInteger and BigDecimal (for the financial industry).

2. The I added a method for verifying that all elements have been read.

This works quite well but of course do not address the documentation issue or the ability creating JSON from static object declaration.


> -- 
> - Tim Bray (If you’d like to send me a private message, see
> _______________________________________________
> json mailing list