[Json] Re: Proposal for use of JSON Text vs JSON Document in JSON Schema

David Kemp <dk190a@gmail.com> Tue, 19 May 2026 22:46 UTC

Return-Path: <dk190a@gmail.com>
X-Original-To: json@mail2.ietf.org
Delivered-To: json@mail2.ietf.org
Received: from localhost (localhost [127.0.0.1]) by mail2.ietf.org (Postfix) with ESMTP id D9553F11BDE1 for <json@mail2.ietf.org>; Tue, 19 May 2026 15:46:13 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ietf.org; s=ietf1; t=1779230773; bh=lv/5fQ61bcwLzx9JDF8nafRDKk1by1z+ibAXNjM7Re4=; h=References:In-Reply-To:From:Date:Subject:To:Cc; b=VQQiOsxB013xd9SnB1GQ5U3B7aNMEx4oS/QqSvASyeX9WuFTmmtXQ8W7wMiDn3FZx Hc7wsbkf4cmmU22YV/vLk5kePl47h8vMNXTJZN/K8Q0Oa1dHd2COSC+2pasGH96ruB X4Ki4esNgcFxnG7UXk5OAOIsdx3dIOwP4qXt11A0=
X-Virus-Scanned: amavisd-new at ietf.org
X-Spam-Flag: NO
X-Spam-Score: -2.098
X-Spam-Level:
X-Spam-Status: No, score=-2.098 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-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] autolearn=ham autolearn_force=no
Authentication-Results: mail2.ietf.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com
Received: from mail2.ietf.org ([166.84.6.31]) by localhost (mail2.ietf.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 8lF69aMz6ilv for <json@mail2.ietf.org>; Tue, 19 May 2026 15:46:13 -0700 (PDT)
Received: from mail-vk1-xa30.google.com (mail-vk1-xa30.google.com [IPv6:2607:f8b0:4864:20::a30]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (P-256) server-digest SHA256) (No client certificate requested) by mail2.ietf.org (Postfix) with ESMTPS id EC057F11BD5F for <json@ietf.org>; Tue, 19 May 2026 15:46:06 -0700 (PDT)
Received: by mail-vk1-xa30.google.com with SMTP id 71dfb90a1353d-56f75445470so3170621e0c.2 for <json@ietf.org>; Tue, 19 May 2026 15:46:06 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; t=1779230760; cv=none; d=google.com; s=arc-20240605; b=AcZKVh6unPMaXcMcSjDiWUxSRUEOahp6K2navunTE7YevhT+QX5i3MkxfnFOoMmIAI pMFSswFQ+uOXGQaR17adZABZ/t5A4AOp4A8OIeCQp95SmEcVAIGrPJCRfJuwyMLuzgoE btpMtLN78d30sTfSIJhW2tqbBVEYyV1C2wck3lOWS3LQe/++GNi0oM24eX8JP95pLlRU FM36RNZeQfD0cI0Fjo0fVkvz31mrGGaXT9Kbs+kVPp4jDLHrthTaxMRp+C4AG7fzKXoR j83dwmMpIudeopVAx20Z68DjQ7uztahb5WPAAXawsmRP31b222KRvb5TgMN1oJ2TzMX3 xN4A==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:dkim-signature; bh=8vQ5aVnhE20IacRR21+UqXy0cF4Sn+pwuY5oqY8SuoI=; fh=DCO/e6WJjZHrVWGjxPyVEKN7iLlqj8Y4jHwPahEAlMk=; b=TBqhFLBZMMSnelyZ2roZHVO3HDuXJTJmtsa1swwpigdrme5jGemwDr4kTvp0wsuibP X/BfT25ynS5CoMpR3sH+8tp8WQAJf7TLA75ntIwxYwGKUaGHc75LFl37UOTBqq6zan7D XYy2w9E+PjR5dAZQ+708pRGZkZ3Ae39I+hty9wU2nsN/tG2NawKqtKMsjTBb8YiwUBjQ 9qM5dyOCRFlosyZwGSDA7kswNIB3E065NUN4iuARoX9m7lJlimEa5uq3dS9TmoWF4buW aJG2VqIJqjy4lMMIEM/HhOzUOseEkeGRipE7qPuOiy4RMj9NrKAq16DZ9u5EcsueF5Gr NHLA==; darn=ietf.org
ARC-Authentication-Results: i=1; mx.google.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1779230760; x=1779835560; darn=ietf.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=8vQ5aVnhE20IacRR21+UqXy0cF4Sn+pwuY5oqY8SuoI=; b=XAhxoK92E+eqrXrzrktec4BUWTFHHYaPwCw0m5ODupLZA6KyXfMYLytwIPjx518HFx 16Gjd64aD0MzTfOJrD57JIL0DlY9YOH9+PdqCs8i0QO1llVU6RXvS32aI1JurWDnpVxJ jmA5b+lwyYWRTpmYwVtzd9JrmX6X5j3bldPOuavz+Hgq2l26kbqEAuEoY14M/N7JoqTh +SZ4nvv4HSgSHRn7z9YtElCNclidV9dAKFU8m0Ed+qpjHaio0DaHZ9syHBmuYDzouadQ 2pHyP8BHFL0DZa44YgJaOOiN9xgNhNY2ngkryojh33WVXh6tiyfLkyt7A6Qd69E5lvR2 2vPw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779230760; x=1779835560; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=8vQ5aVnhE20IacRR21+UqXy0cF4Sn+pwuY5oqY8SuoI=; b=Sls2KP9shKiX5pE4nymxbYkwLqm7tyUvURCZvx7J340xYJIyPolm+p8C14N0YpNcAn ocs4FmZBUCyNVdUFNr5HF8URlTltrYBzJS0P/i0lkWTM3825tehwTj95WoaOFrC2dfal i7wi1ZGuVsJeXV5LPc0yF5TnwY6AoDTfvZZpZZ4WS/oEME4nSrfV2+DMg26VsGEXvD7q R2auKGYezBnQbviXPNpwLs3omxKN0ByFmlb8BUl9R14R8+uWL83ZJmdsUFcWZs9uCfgF +FZeSmXkHsV5+tcyMWo+kHw5o2hRKf1U4j5273/TkNd6SLm0lH5Fo+gpQWxS6vZ90PqC 0ioQ==
X-Forwarded-Encrypted: i=1; AFNElJ+cJVjWhqiRdamarNjghAotnz4gu8V5q9FmpZFRSqDlo6Z5Ko2C4Ch8LEsRvSB+DArt2+fJ@ietf.org
X-Gm-Message-State: AOJu0Yxqa2T/WGcHW2ylKWIStatW87o72PEKBxs4MjP5VLv3zz8ILgwZ 1S8g+zrSQZbFE5T7+mAL5j1FY1Bp+kMkgMYltzqGOu+YuV89qmC25b0cqw8iyMo3tPYqGxBX+py mJZoEglcwdvVGGdT+qU3buif83Kf4VP4=
X-Gm-Gg: Acq92OHSPV/Hmn/1EFUleIiY15Zj/MFbLxj1OQEcWmox3aAhDecF5sb6kfIOpNg3xf3 8dO/PvcWBo0VX8hHRc7KBe+QajQI4OBXeP8eFX0Rk2UEzpEUroNNKaub/ZcDdY0uhGqECjfklVV W/aiEPwOL3zIWth8tZ/GF4q1LqCSeGIy4w0gFOa5WKHVq8/XV1SS1/cXuSb+4w+/XoPktFMOeVm PTd7X7M6AqmoRzUYPL7H7g6YXBoCgFtW5IYTO3Ei3iSsHnzRw/Exhw2S7X5JCtjOYJnCGgs73ci zoWvjb4RWCGUk8M724Bp3Yx3PFQCqZx/s5/ApYWC
X-Received: by 2002:a05:6122:910:b0:56e:e9cf:7134 with SMTP id 71dfb90a1353d-5760be33374mr12172557e0c.3.1779230759581; Tue, 19 May 2026 15:45:59 -0700 (PDT)
MIME-Version: 1.0
References: <CAEi+uC7geTKVn-NXkDsBaPo39dcKLMJ+G2ffFW4229mJd-O5_w@mail.gmail.com> <MN2PR17MB4031C8B63AFF804B4FB54A69CD002@MN2PR17MB4031.namprd17.prod.outlook.com> <725352192.2278846.1779206890302@mail.yahoo.com> <CAE5tNmrjo6mBQCbjpU43R2DafkovMTdX25=zzsZ_g8SrV3DefA@mail.gmail.com> <65D17014-7F89-41BD-B883-D1EA1F56AD29@tzi.org> <2098935972.2327556.1779216811802@mail.yahoo.com>
In-Reply-To: <2098935972.2327556.1779216811802@mail.yahoo.com>
From: David Kemp <dk190a@gmail.com>
Date: Tue, 19 May 2026 18:45:47 -0400
X-Gm-Features: AVHnY4I8WqkUGnQbYKD4auL9S2nZ__V0QBaObrLKZMJCRMiDe4zGRdajk80wZek
Message-ID: <CAE5tNmqNuykd7+zGAV_KAGKE+jS2=-miEVfcrotBMaRZyxWUJw@mail.gmail.com>
To: Henry Andrews <andrews_henry@yahoo.com>
Content-Type: multipart/alternative; boundary="00000000000065fa87065233714a"
Message-ID-Hash: QH6DHSYD3YIHKFXCGSGKHFETTC54RAVI
X-Message-ID-Hash: QH6DHSYD3YIHKFXCGSGKHFETTC54RAVI
X-MailFrom: dk190a@gmail.com
X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-json.ietf.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header
CC: Carsten Bormann <cabo@tzi.org>, Lisa Dusseault <lisa.dusseault@gmail.com>, JSON WG <json@ietf.org>, "Salz, Rich" <rsalz=40akamai.com@dmarc.ietf.org>
X-Mailman-Version: 3.3.9rc6
Precedence: list
Subject: [Json] Re: Proposal for use of JSON Text vs JSON Document in JSON Schema
List-Id: "JavaScript Object Notation (JSON) WG mailing list" <json.ietf.org>
Archived-At: <https://mailarchive.ietf.org/arch/msg/json/DuBxXfsiu_Lw2qjqlNVhBsnSyNQ>
List-Archive: <https://mailarchive.ietf.org/arch/browse/json>
List-Help: <mailto:json-request@ietf.org?subject=help>
List-Owner: <mailto:json-owner@ietf.org>
List-Post: <mailto:json@ietf.org>
List-Subscribe: <mailto:json-join@ietf.org>
List-Unsubscribe: <mailto:json-leave@ietf.org>

1. Because the JSON metaschema is a JSON value, it defines a Schema type
and every JSON Schema value is an instance of that type.  This is the key
to everything.
2. JSON Schema instances can be serialized as JSON documents or YAML
documents. (Using an IM the same JSON Schema instance could be serialized
as an XML document.)
3. The $id keyword is an absolute IRI that defines the namespace of every
Schema instance, allowing qualified references to every
namespace#$defs-name type (using fragment notation) or prefix:$defs-name
(using QNAMEs if prefix abbreviations are assigned to namespaces).
4. Every type defined in every Schema instance is a unit of serialization.

To take a random example, the JSON Schema for CycloneDX at
https://github.com/CycloneDX/specification/blob/master/schema/bom-1.6.schema.json
has a namespace "$id": "http://cyclonedx.org/schema/bom-1.6.schema.json",
an unnamed root type with two required properties, and finally at line 534
it has top-level definitions
that could be referenced externally, starting with cdx:refType if the
referencer defines "cdx" as the prefix for the referenced namespace.

That file is a JSON document that defines a "bom-1.6.schema".  There could
also be a YAML document ".../bom-1.6.schema.yaml" that defines the
identical "bom-1.6.schema".  They are both instances of the JSON metaschema
so you can call the value a "schema instance" or "schema value" or simply a
"schema", whereas a CycloneDX value parsed from a JSON or YAML document
would be a "cdx-bom-1.6 instance" or "cdx-bom-1.6 value" or simply a
"cdx-1.6 bom".  The $id namespace should be semantically a URN even if it
has an http:// scheme, with no file pathnames or extensions.

I think of "resource" as being a physical thing, so the bom-1.6-schema.json
file and bom-1.6-schema.yaml file are different resources that parse to the
identical schema. The identical files copied to a different server would be
two additional different resources, for a total of 4. If that is what
resource means, then a document is a resource. A namespace is not a
resource.

Regards,
David

On Tue, May 19, 2026 at 2:53 PM Henry Andrews <andrews_henry@yahoo.com>
wrote:

> David and Carsten,
>   I agree that "JSON value" is pretty close to what we have been doing
> with "JSON Schema document", but Carsten does note part of the concern here.
>
> I think we've also gotten some wires crossed a bit, though, as we are
> talking about the _schemas_, not the things that schemas describe (which,
> IIRC, in the latest draft we call "inputs" prior to validation, and then
> "instances" if they pass validation.  In prior drafts, we used "instance"
> rather more broadly).
>
> So what we're really discussing here is more akin to "schema document"
> than "JSON document"/"JSON value".  We call it a "JSON Schema document"
> because it is "JSON Schema" that we're talking about, but the "JSON" part
> is not the important part.  It's schema documents vs schema resources.
>
> Therefore, we really can't call these things "instances" as that is what
> things that the schema describes have been called for many years.
>
> I'm going to try to summarize the various concepts:
>
> * JSON Schema in the form of JSON text: application/schema+json or similar
> media type; A serialization format to allow interoperable exchange of
> schemas
> * JSON Schema in the form of YAML text: (application/schema+yaml or
> similar media type;  Same as above, but with YAML.  If we want to add that.
> * JSON Schema as a unit of serialization: currently "JSON Schema
> document", but under debate.  Not required to have ever been actual JSON.
> * JSON Schema as an identifiable unit: "JSON Schema resource"; identified
> by an absolute-URI (e.g. a "primary resource" in terms of RFC3986)
> * JSON input (and potential instance) in the form of JSON text:
> application/json, possibly with a profile param, or possibly a media type
> like application/schema-instance+json; a media type or media type parameter
> for interoperably associating an input (potential instance) with a schema
> in exchanges such as via HTTP
> * input (and potential instance), independent of serialization format, if
> any: I think we just call this the input or instance?  We don't make a
> particularly big deal about serializing inputs/instances, IIRC.
>
> BTW I am really appreciating the effort to bring rigor to the
> terminology.  It's something we always struggled with.
>
> thanks,
> -henry
>
> On Tuesday, May 19, 2026 at 09:54:38 AM PDT, Carsten Bormann <cabo@tzi.org>
> wrote:
>
>
> On 2026-05-19, at 18:41, David Kemp <dk190a@gmail.com> wrote:
> >
> > s/JSON document/JSON value/g
> >
> > As Carsten said, there is already a clearly-defined word for the concept
> of "contrasting schema values with resources" and "an instance value is a
> unit of serialization".  That word is "value", not "document".  Using a
> word in a way that contradicts its widely-understood meaning is a recipe
> for confusion.
>
> Right, I talked about the difference between the JSON text and the JSON
> value (value that is parsed/ingested from JSON).
>
> However, people also seemed to want to have a “whole” vs. “part”
> distinction.
> If we need to avoid the term “document”, the JSON value that is the whole
> thing the JSON schema model is trying to describe could be called “JSON
> instance”.
> We also need a word for the JSON value that describes the whole JSON
> schema model — I obviously like the word model, but I’m not going to make a
> proposal.
> (Note also that the model may be composed from more than one JSON Schema
> value/text.)
>
> (If you want to save a bit of time, you might want to have a look how we
> solved a related terminology problem in RFC 9880.)
>
> Grüße, Carsten
>
>