Re: [Json] Schema Requirements (Was: Re: Nudging the English-language vs. formalisms discussion forward)

Nico Williams <> Thu, 20 February 2014 21:54 UTC

Return-Path: <>
Received: from localhost ( []) by (Postfix) with ESMTP id 3C8711A0337 for <>; Thu, 20 Feb 2014 13:54:03 -0800 (PST)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: -1.378
X-Spam-Status: No, score=-1.378 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FM_FORGED_GMAIL=0.622, RCVD_IN_DNSWL_NONE=-0.0001] autolearn=no
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id pwfjoPsguvV0 for <>; Thu, 20 Feb 2014 13:54:01 -0800 (PST)
Received: from ( []) by (Postfix) with ESMTP id 26EC21A032F for <>; Thu, 20 Feb 2014 13:54:00 -0800 (PST)
Received: from (localhost []) by (Postfix) with ESMTP id 88D321E05C for <>; Thu, 20 Feb 2014 13:53:56 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed;; h= mime-version:in-reply-to:references:date:message-id:subject:from :to:cc:content-type;; bh=y/Xx3wZ6CeTFlMHk6/3P 7//44o8=; b=T8wAiRqh0MdMF5VEbr9+f+bdv0zR1cnIUn22x1Sfl12Q9b16KJP4 yDAR9Om2FQ3g6xATLYzuYT5/O2vNltah3X3Vi8WguWScbsDb6gL4j6J/SjRiO0f8 8iJcP0lvAFQzvI41w1QC81JwPJ9JgTd1zzstTwNdJNWArMJui26TAbA=
Received: from ( []) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: by (Postfix) with ESMTPSA id C7F971E059 for <>; Thu, 20 Feb 2014 13:53:55 -0800 (PST)
Received: by with SMTP id f8so181140wiw.13 for <>; Thu, 20 Feb 2014 13:53:51 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;; s=20130820; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=ThnpQXXlXXg8hMzGwJgqHetUHZZxyfn160LNCUwBY2s=; b=AO3dpS28QV1GjZAMOdOE0Ohgwbbroesrh9eYM5yNNM2PuBa0Z/jKADrMnQM+LftARS pNoRN1r3I6GLUqV+dRqv+JX4yFZS+4izblNjDcciT3JDvYTdz7Mb+O2yGCB0Hfk3zZ2f n6AskhwneQEppXfjRI77YQU9JiFO58ZKMkvP2P42yPC5BSopIX2DyEbNx8J4JPE+RqK4 Yp0XzLs3ebBwbBLigxC8/pKNkCqEvG9flwy/ujyqMQ2ZlitEl05MKhnSkyMw1f41Aznz naWaIi0xt8oi+a00JRkkflbFP4c9fWjM7Nul7AD8vGT4QeWbMNBaD8MKQCABZHqwP+QP fsRA==
MIME-Version: 1.0
X-Received: by with SMTP id yk14mr399812wib.5.1392933231781; Thu, 20 Feb 2014 13:53:51 -0800 (PST)
Received: by with HTTP; Thu, 20 Feb 2014 13:53:51 -0800 (PST)
In-Reply-To: <7B10598788A345A4A13093E4CE09E8A5@codalogic>
References: <> <> <> <> <> <> <> <357740A8AA0F4316BE630917321FAB4D@codalogic> <B1EBE05A69362F001777F807@cyrus.local> <47BB9131737D42218A6382DEF45BBE2C@codalogic> <> <AF211B67DB3D453D9DE8F8FA53886F73@codalogic> <> <FE06CD427A4044B995F57C4926A1C8C2@codalogic> <> <> <7B10598788A345A4A13093E4CE09E8A5@codalogic>
Date: Thu, 20 Feb 2014 15:53:51 -0600
Message-ID: <>
From: Nico Williams <>
To: Pete Cordell <>
Content-Type: text/plain; charset="UTF-8"
Cc: Phillip Hallam-Baker <>, JSON WG <>
Subject: Re: [Json] Schema Requirements (Was: Re: Nudging the English-language vs. formalisms discussion forward)
X-Mailman-Version: 2.1.15
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: Thu, 20 Feb 2014 21:54:03 -0000

On Thu, Feb 20, 2014 at 1:42 PM, Pete Cordell <> wrote:
> ----- Original Message From: "Nico Williams"
>> This sounds to me like an argument about how to handle extensibility.
>> We should first consider whether we want schema extensibility and if
>> we do, whether we want it to be explicit (like the ... extensibility
>> marker in ASN.1) or implicit (like implicit ... ASN.1 extensibility
>> markers in every type).
> I assume you're taling about extensibility of the vocabularies defined by a
> schema rather than extensibility of the schema language itself?

Yes.  See ASN.1's extensibility marker.

Briefly, if you end a structure/set/choice type with '...' then
decoders are supposed to not fail just because unknown fields are
included in the input; the decoders.  (There's more to it, but I'm

>> My position: we should want extensibility, and it should be explicit
>> (because having every type be implicitly extensible is a PITA for code
>> generation).
> What aspect do you find a PITA?  Supporting both implicit extensibility and
> explicit extensibility is surely harder than just supporting implicit
> extensibility?

Let's say you're generating C structs from the schema, and a given
type is intended to be extensible, that it's an object.  So now you
need to decide what your parser will do when faced with names in this
object that were not known when the C code was generated.  There's two
options: ignore them, or make them available as a C representation of
an object with all the unexpected names.  The latter can be important
at times (e.g., when you're eventually going to re-encode the inputs
and you want to preserve those unknown bits).

So far so good.  But if you make every type extensible by default,
then you're polluting those C structs and the generated code even if
mostly you don't need extensibility -- this is the PITA.  IMO
extensibility needs to be requested explicitly, but then the problem
you run into is people forgetting to do so.