<?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.29 (Ruby 3.4.4) -->
<rfc xmlns:xi="http://www.w3.org/2001/XInclude" ipr="trust200902" docName="draft-vasters-json-structure-alternate-names-01" category="std" consensus="true" submissionType="IETF" tocInclude="true" sortRefs="true" symRefs="true" version="3">
  <!-- xml2rfc v2v3 conversion 3.31.0 -->
  <front>
    <title>JSON Structure: Alternate Names and Descriptions</title>
    <seriesInfo name="Internet-Draft" value="draft-vasters-json-structure-alternate-names-01"/>
    <author fullname="Clemens Vasters">
      <organization>Microsoft Corporation</organization>
      <address>
        <email>clemensv@microsoft.com</email>
      </address>
    </author>
    <date year="2025" month="December" day="04"/>
    <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="RFC4646"/>.</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="RFC4646"/>.</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="RFC4646">
        <front>
          <title>Tags for Identifying Languages</title>
          <author fullname="A. Phillips" initials="A." surname="Phillips"/>
          <author fullname="M. Davis" initials="M." surname="Davis"/>
          <date month="September" year="2006"/>
          <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, in combination with RFC 4647, replaces RFC 3066, which replaced RFC 1766. This document specifies an Internet Best Current Practices for the Internet Community, and requests discussion and suggestions for improvements.</t>
          </abstract>
        </front>
        <seriesInfo name="RFC" value="4646"/>
        <seriesInfo name="DOI" value="10.17487/RFC4646"/>
      </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-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:
H4sIAAAAAAAAA9VaXW8cVxm+P7/iMO5FInnWTggBVkDxx7px69jBdlohVNVn
Z87uTjI7s8yZsbNYjkjaCyq1ArUSSBUXICFKK0HhLlRc0Z/ipuVn8LzvOTM7
s7u24zaVIBfxzJwz78fzfp9Z3/eFyKM81m3pvby3sy338qwI8iLDg5U411mi
ci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