<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE rfc [
  <!ENTITY nbsp    "&#160;">
  <!ENTITY zwsp   "&#8203;">
  <!ENTITY nbhy   "&#8209;">
  <!ENTITY wj     "&#8288;">
]>
<?xml-stylesheet type="text/xsl" href="rfc2629.xslt" ?>
<!-- generated by https://github.com/cabo/kramdown-rfc version 1.7.39 (Ruby 3.4.9) -->
<rfc xmlns:xi="http://www.w3.org/2001/XInclude" ipr="trust200902" docName="draft-vasters-json-structure-alternate-names-03" category="std" consensus="true" submissionType="IETF" tocInclude="true" sortRefs="true" symRefs="true" version="3">
  <!-- xml2rfc v2v3 conversion 3.33.0 -->
  <front>
    <title>JSON Structure: Alternate Names and Descriptions</title>
    <seriesInfo name="Internet-Draft" value="draft-vasters-json-structure-alternate-names-03"/>
    <author fullname="Clemens Vasters">
      <organization>Microsoft Corporation</organization>
      <address>
        <email>clemensv@microsoft.com</email>
      </address>
    </author>
    <date year="2026" month="June" day="09"/>
    <area>Web and Internet Transport</area>
    <workgroup>Building Blocks for HTTP APIs</workgroup>
    <keyword>Internet-Draft</keyword>
    <abstract>
      <?line 42?>

<t>This document is an extension to JSON Structure Core. It defines three
annotation keywords, <tt>altnames</tt>, <tt>altenums</tt>, and <tt>descriptions</tt>, which allow
schema authors to provide alternative identifiers, display names, and
multi-variant descriptions for types, properties, and enumeration values.</t>
    </abstract>
    <note removeInRFC="true">
      <name>About This Document</name>
      <t>
        The latest revision of this draft can be found at <eref target="https://json-structure.github.io/alternate-names/draft-vasters-json-structure-alternate-names.html"/>.
        Status information for this document may be found at <eref target="https://datatracker.ietf.org/doc/draft-vasters-json-structure-alternate-names/"/>.
      </t>
      <t>
      </t>
      <t>Source for this draft and an issue tracker can be found at
        <eref target="https://github.com/json-structure/alternate-names"/>.</t>
    </note>
  </front>
  <middle>
    <?line 50?>

<section anchor="introduction">
      <name>Introduction</name>
      <t>This document is an extension to JSON Structure Core <xref target="JSTRUCT-CORE"/>. It
defines three annotation keywords, <tt>altnames</tt>, <tt>altenums</tt>, and <tt>descriptions</tt>,
which allow schema authors to provide alternative identifiers, display names,
and multi-variant descriptions for types, properties, and enumeration values.</t>
      <t>These annotations facilitate mapping between internal schema identifiers and
external data representations (e.g., JSON keys that do not conform to identifier
rules) and support internationalization by enabling localized labels.</t>
    </section>
    <section anchor="conventions">
      <name>Conventions</name>
      <t>The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL
NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED",
"MAY", and "OPTIONAL" in this document are to be interpreted as
described in BCP 14 <xref target="RFC2119"/> <xref target="RFC8174"/> when, and only when, they
appear in all capitals, as shown here.
<?line -6?>
      </t>
    </section>
    <section anchor="keywords">
      <name>Keywords</name>
      <t>This section defines the alternate names and symbols annotations.</t>
      <section anchor="the-altnames-keyword">
        <name>The <tt>altnames</tt> Keyword</name>
        <t>The <tt>altnames</tt> keyword provides alternative names for a named type or property.
Alternate names are not subject to the identifier syntax restrictions imposed on
<tt>name</tt> and MAY be used to map internal schema names to external representations.</t>
        <t>The value of <tt>altnames</tt> MUST be a map where each key is a purpose indicator and
each value is a string representing an alternate name.</t>
        <ul spacing="normal">
          <li>
            <t>The key <tt>"json"</tt> is RESERVED. When used, it specifies the property key to use
for a property when encoded in JSON. This allows for JSON keys that do not
conform to identifier rules.</t>
          </li>
          <li>
            <t>Keys starting with the prefix <tt>"lang:"</tt> (e.g., <tt>"lang:en"</tt>, <tt>"lang:fr"</tt>) are
RESERVED for localized display names. The suffix after the colon specifies the
language code. The language code MUST conform to <xref target="RFC5646"/>.</t>
          </li>
          <li>
            <t>Other keys are allowed for custom usage, provided they do not conflict with
the reserved keys or prefixes.</t>
          </li>
        </ul>
        <t>The <tt>altnames</tt> keyword MAY be included in any schema element that has an
explicit name (i.e., named types or properties). When present, the alternate
names provide additional mappings that schema processors MAY use for encoding,
decoding, or user interface display.</t>
        <t>Example:</t>
        <sourcecode type="json"><![CDATA[
{
  "Person": {
    "type": "object",
    "altnames": {
      "json": "person_data",
      "lang:en": "Person",
      "lang:de": "Person"
    },
    "properties": {
      "firstName": {
        "type": "string",
        "altnames": {
          "json": "first_name",
          "lang:en": "First Name",
          "lang:de": "Vorname"
        }
      },
      "lastName": {
        "type": "string",
        "altnames": {
          "json": "last_name",
          "lang:en": "Last Name",
          "lang:de": "Nachname"
        }
      }
    },
    "required": ["firstName", "lastName"]
  }
}
]]></sourcecode>
      </section>
      <section anchor="the-altenums-keyword">
        <name>The <tt>altenums</tt> Keyword</name>
        <t>The <tt>altenums</tt> keyword provides alternative representations (symbols) for
enumeration values defined by a type using the <tt>enum</tt> keyword. Alternate symbols
allow schema authors to map internal enum values to external codes or localized
display symbols.</t>
        <t>The value of <tt>altenums</tt> MUST be a JSON object (map) where each key is a purpose
indicator and each corresponding value is an object mapping each enumeration
value (as defined in the <tt>enum</tt> array) to its alternate symbol.</t>
        <ul spacing="normal">
          <li>
            <t>The key <tt>"json"</tt> is RESERVED and MUST be used to specify alternate symbols for
JSON encoding.</t>
          </li>
          <li>
            <t>Keys beginning with <tt>"lang:"</tt> (e.g., <tt>"lang:en"</tt>, <tt>"lang:es"</tt>) are RESERVED
for providing localized alternate symbols.</t>
          </li>
          <li>
            <t>Additional keys are permitted for custom usage, subject to no conflicts with
reserved keys or prefixes.</t>
          </li>
        </ul>
        <t>The <tt>altenums</tt> keyword MUST be used only with schemas that include an <tt>enum</tt>
keyword. When present, it provides alternative representations for each
enumeration value that schema processors MAY use for encoding or display
purposes.</t>
        <sourcecode type="json"><![CDATA[
{
  "Color": {
    "type": "string",
    "enum": ["RED", "GREEN", "BLUE"],
    "altenums": {
      "json": {
        "RED": "#FF0000",
        "GREEN": "#00FF00",
        "BLUE": "#0000FF"
      },
      "lang:en": {
        "RED": "Red",
        "GREEN": "Green",
        "BLUE": "Blue"
      },
      "lang:de": {
        "RED": "Rot",
        "GREEN": "Grün",
        "BLUE": "Blau"
      }
    }
  }
}
]]></sourcecode>
      </section>
      <section anchor="the-descriptions-keyword">
        <name>The <tt>descriptions</tt> Keyword</name>
        <t>The <tt>descriptions</tt> keyword provides multi-variant descriptions as an alternative
to the <tt>description</tt> keyword. It allows schema authors to provide localized or
context-specific descriptions for types, properties, or enumeration values.</t>
        <t>The value of <tt>descriptions</tt> MUST be a map where each key is a purpose indicator
and each value is a string representing a description.</t>
        <ul spacing="normal">
          <li>
            <t>Keys beginning with <tt>"lang:"</tt> (e.g., <tt>"lang:en"</tt>, <tt>"lang:fr"</tt>) are RESERVED
for localized descriptions. The suffix after the colon specifies the language
code. The language code MUST conform to <xref target="RFC5646"/>.</t>
          </li>
          <li>
            <t>Other keys are allowed for custom usage, provided they do not conflict with
the reserved keys or prefixes.</t>
          </li>
        </ul>
        <t>The <tt>descriptions</tt> keyword MAY be included in any schema element that can have a
description. When present, the descriptions provide additional mappings that
schema processors MAY use for user interface display.</t>
        <t>Example:</t>
        <sourcecode type="json"><![CDATA[
{
  "Person": {
    "type": "object",
    "descriptions": {
      "lang:en": "A person object with first and last name",
      "lang:de": "Ein Person-Objekt mit Vor- und Nachnamen",
      "lang:fr": "Un objet personne avec prénom et nom de famille",
      "lang:cn": "一个带有名字和姓氏的人对象",
      "lang:jp": "名前と姓を持つ人物オブジェクト"
    },
    "properties": {
      "firstName": {
        "type": "string",
        "descriptions": {
          "lang:en": "The first name of the person",
          "lang:de": "Der Vorname der Person",
          "lang:fr": "Le prénom de la personne",
          "lang:cn": "人的名字",
          "lang:jp": "人の名前"
        }
      },
      "lastName": {
        "type": "string",
        "descriptions": {
          "lang:en": "The last name of the person",
          "lang:de": "Der Nachname der Person",
          "lang:fr": "Le nom de famille de la personne",
          "lang:cn": "人的姓氏",
          "lang:jp": "人の姓"
        }
      }
    },
    "required": ["firstName", "lastName"]
  }
}
]]></sourcecode>
      </section>
    </section>
    <section anchor="enabling-the-annotations">
      <name>Enabling the Annotations</name>
      <t>Alternate names and symbols annotations can be enabled in a schema or
meta-schema by adding the <tt>JSONSchemaAlternateNames</tt> key to the <tt>$uses</tt> clause
when referencing the extended meta-schema:</t>
      <sourcecode type="json"><![CDATA[
{
  "$schema": "https://json-structure.org/meta/extended/v0/#",
  "$id": "myschema",
  "$uses": [
    "JSONStructureAlternateNames"
  ],
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "altnames": {
        "lang:fr": "Nom"
      }
    }
  }
}
]]></sourcecode>
      <t>The annotation are enabled by default in the validation meta-schema:</t>
      <sourcecode type="json"><![CDATA[
{
  "$schema": "https://json-structure.org/meta/validation/v0/#",
  "$id": "myschema",
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "altnames": {
        "lang:fr": "Nom"
      }
    }
  }
}
]]></sourcecode>
    </section>
    <section anchor="security-and-interoperability-considerations">
      <name>Security and Interoperability Considerations</name>
      <t>Alternate names and symbols annotations do not affect the validation of instance
data. They are purely metadata and MUST be ignored by validators that do not
support this extension. However, applications that rely on alternate names for
mapping or localization MUST implement appropriate safeguards to ensure that the
alternate identifiers are used consistently.</t>
    </section>
    <section anchor="iana-considerations">
      <name>IANA Considerations</name>
      <t>This document has no IANA actions.</t>
    </section>
  </middle>
  <back>
    <references anchor="sec-normative-references">
      <name>Normative References</name>
      <reference anchor="RFC2119">
        <front>
          <title>Key words for use in RFCs to Indicate Requirement Levels</title>
          <author fullname="S. Bradner" initials="S." surname="Bradner"/>
          <date month="March" year="1997"/>
          <abstract>
            <t>In many standards track documents several words are used to signify the requirements in the specification. These words are often capitalized. This document defines these words as they should be interpreted in IETF documents. This document specifies an Internet Best Current Practices for the Internet Community, and requests discussion and suggestions for improvements.</t>
          </abstract>
        </front>
        <seriesInfo name="BCP" value="14"/>
        <seriesInfo name="RFC" value="2119"/>
        <seriesInfo name="DOI" value="10.17487/RFC2119"/>
      </reference>
      <reference anchor="RFC5646">
        <front>
          <title>Tags for Identifying Languages</title>
          <author fullname="A. Phillips" initials="A." role="editor" surname="Phillips"/>
          <author fullname="M. Davis" initials="M." role="editor" surname="Davis"/>
          <date month="September" year="2009"/>
          <abstract>
            <t>This document describes the structure, content, construction, and semantics of language tags for use in cases where it is desirable to indicate the language used in an information object. It also describes how to register values for use in language tags and the creation of user-defined extensions for private interchange. This document specifies an Internet Best Current Practices for the Internet Community, and requests discussion and suggestions for improvements.</t>
          </abstract>
        </front>
        <seriesInfo name="BCP" value="47"/>
        <seriesInfo name="RFC" value="5646"/>
        <seriesInfo name="DOI" value="10.17487/RFC5646"/>
      </reference>
      <reference anchor="RFC8174">
        <front>
          <title>Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words</title>
          <author fullname="B. Leiba" initials="B." surname="Leiba"/>
          <date month="May" year="2017"/>
          <abstract>
            <t>RFC 2119 specifies common key words that may be used in protocol specifications. This document aims to reduce the ambiguity by clarifying that only UPPERCASE usage of the key words have the defined special meanings.</t>
          </abstract>
        </front>
        <seriesInfo name="BCP" value="14"/>
        <seriesInfo name="RFC" value="8174"/>
        <seriesInfo name="DOI" value="10.17487/RFC8174"/>
      </reference>
      <reference anchor="JSTRUCT-CORE" target="https://json-structure.github.io/core/draft-vasters-json-structure-core.html">
        <front>
          <title>JSON Structure Core</title>
          <author fullname="Clemens Vasters">
            <organization/>
          </author>
          <date>n.d.</date>
        </front>
      </reference>
    </references>
    <?line 298?>

<section numbered="false" anchor="changes-from-draft-vasters-json-structure-alternate-names-01">
      <name>Changes from draft-vasters-json-structure-alternate-names-01</name>
      <ul spacing="normal">
        <li>
          <t>Updated all RFC 4646 references to RFC 5646 (BCP 47) in the references
block, <tt>altnames</tt> section, and <tt>descriptions</tt> section.</t>
        </li>
      </ul>
    </section>
    <section numbered="false" anchor="changes-from-draft-vasters-json-structure-alternate-names-00">
      <name>Changes from draft-vasters-json-structure-alternate-names-00</name>
      <ul spacing="normal">
        <li>
          <t>Fixed section heading levels throughout the document.</t>
        </li>
      </ul>
    </section>
    <section numbered="false" anchor="acknowledgments">
      <name>Acknowledgments</name>
      <t>TODO acknowledge.</t>
    </section>
  </back>
  <!-- ##markdown-source:
H4sIA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