<?xml version='1.0' encoding='UTF-8'?>

<!DOCTYPE rfc [
 <!ENTITY nbsp    "&#160;">
 <!ENTITY zwsp   "&#8203;">
 <!ENTITY nbhy   "&#8209;">
 <!ENTITY wj     "&#8288;">
]> 
<!-- generated by https://github.com/cabo/kramdown-rfc version 1.6.39 (Ruby 3.2.2) -->

<rfc xmlns:xi="http://www.w3.org/2001/XInclude" ipr="trust200902" submissionType="IETF" category="info" consensus="true" docName="draft-ietf-httpapi-yaml-mediatypes-10" number="9512" tocInclude="true" sortRefs="true" symRefs="true" updates="" obsoletes="" xml:lang="en" version="3">
<!-- xml2rfc v2v3 conversion 3.18.0 -->
  <front>

    <title>YAML Media Type</title>
    <seriesInfo name="RFC" value="9512"/>

    <author initials="R." surname="Polli" fullname="Roberto Polli">
      <organization abbrev="DTD, Italian Government">Digital Transformation Department, Italian Government</organization>
      <address>
        <postal>
          <country>Italy</country>
        </postal>
        <email>robipolli@gmail.com</email>
      </address>
    </author>
    <author initials="E." surname="Wilde" fullname="Erik Wilde">
      <organization>Axway</organization>
      <address>
        <postal>
          <country>Switzerland</country>
        </postal>
        <email>erik.wilde@dret.net</email>
      </address>
    </author>
    <author initials="E." surname="Aro" fullname="Eemeli Aro">
      <organization>Mozilla</organization>
      <address>
        <postal>
          <country>Finland</country>
        </postal>
        <email>eemeli@gmail.com</email>
      </address>
    </author>
    <date year="2024" month="February"/>
    <area>art</area>
    <workgroup>httpapi</workgroup>


    <abstract>
<t>This document registers the <tt>application/yaml</tt> media type and the
<tt>+yaml</tt> structured syntax suffix with IANA. Both identify document
components that are serialized according to the YAML specification.
</t>
    </abstract>

</front>
  <middle>

<section anchor="introduction">
      <name>Introduction</name>
      <t>YAML <xref target="YAML"/> is a data serialization format that is
      capable of conveying one or multiple documents in a single presentation
      stream (e.g., a file or a network resource).  It is widely used on the
      Internet, including in the API sector (e.g., see <xref target="OAS"/>),
      but a corresponding media type and structured syntax suffix had not
      previously been registered by IANA.</t>
      <t>To increase interoperability when exchanging YAML streams and
      leverage content negotiation mechanisms when exchanging YAML resources,
      this specification registers the <tt>application/yaml</tt> media type
      and the <tt>+yaml</tt> structured syntax suffix <xref
      target="RFC6838"/>.</t>
      <t>Moreover, it provides security considerations and interoperability
      considerations related to <xref target="YAML"/>, including its relation
      with <xref target="RFC8259"/>.</t>
      <section anchor="notational-conventions">
        <name>Notational Conventions</name>
	<t>
    The key words "<bcp14>MUST</bcp14>", "<bcp14>MUST NOT</bcp14>", "<bcp14>REQUIRED</bcp14>", "<bcp14>SHALL</bcp14>", "<bcp14>SHALL
    NOT</bcp14>", "<bcp14>SHOULD</bcp14>", "<bcp14>SHOULD NOT</bcp14>", "<bcp14>RECOMMENDED</bcp14>", "<bcp14>NOT RECOMMENDED</bcp14>",
    "<bcp14>MAY</bcp14>", and "<bcp14>OPTIONAL</bcp14>" in this document are to be interpreted as
    described in BCP&nbsp;14 <xref target="RFC2119"/> <xref target="RFC8174"/> 
    when, and only when, they appear in all capitals, as shown here.
        </t>

        <t>The terms "content negotiation" and "resource"
        in this document are to be interpreted as in <xref
        target="RFC9110"/>.</t>
        <t>The terms "fragment" and "fragment identifier" in this document are
        to be interpreted as in <xref target="RFC3986"/>.</t>
        <t>The terms "presentation", "stream", "YAML document",
        "representation graph", "tag", "serialization detail", "node", "alias
        node", "anchor", and "anchor name" in this document are to be
        interpreted as in <xref target="YAML"/>.</t>

        <t>Figures containing YAML code always start with the <tt>%YAML</tt>
        directive to improve readability.</t>
      </section>
      <section anchor="application-yaml-fragment">
        <name>Fragment Identification</name>
        <t>A fragment identifies a node in a stream.</t>
        <t>A fragment identifier starting with "*"
is to be interpreted as a YAML alias node (see <xref target="fragment-alias-node"/>).</t>

<t>For single-document YAML streams, a fragment identifier that is
        empty or that starts with "/" is to be interpreted as a JSON Pointer
        <xref target="RFC6901"/> and is evaluated on the YAML
        representation graph, traversing alias nodes; in particular, the
        empty fragment identifier references the root node.  This syntax can
        only reference the YAML nodes that are on a path that is made up of
        nodes interoperable with the JSON data model (see <xref
        target="int-yaml-and-json"/>).</t>
        <t>A fragment identifier is not guaranteed to reference an existing node.
Therefore, applications <bcp14>SHOULD</bcp14> define how an unresolved alias node
ought to be handled.</t>
        <section anchor="fragment-alias-node">
          <name>Fragment Identification via Alias Nodes</name>
          <t>This section describes how to use
alias nodes (see Sections 3.2.2.2 and 7.1 of <xref target="YAML"/>)
as fragment identifiers to designate nodes.</t>
          <t>A YAML alias node can be represented in a URI fragment identifier
by encoding it into bytes using UTF-8 <xref target="RFC3629"/>,
but percent-encoding of those characters is not allowed by the fragment rule
in <xref section="3.5" sectionFormat="of" target="RFC3986"/>.</t>
          <t>If multiple nodes match a fragment identifier,
the first occurrence of such a match is selected.</t>
          <t>Users concerned with interoperability of fragment identifiers:</t>
          <ul spacing="normal">
            <li><bcp14>SHOULD</bcp14> limit alias nodes to a set of characters
that do not require encoding
to be expressed as URI fragment identifiers
(this is generally possible since
anchor names are a serialization detail), and</li>
            <li><bcp14>SHOULD NOT</bcp14> use alias nodes that match multiple nodes.</li>
          </ul>
          <t>In the example resource below, the relative reference (see <xref
          section="4.2" sectionFormat="of" target="RFC3986"/>)
          <tt>file.yaml#*foo</tt> identifies the first alias node
          <tt>*foo</tt> pointing to the node with value <tt>scalar</tt> and
          not to the one in the second document, whereas the relative reference
          <tt>file.yaml#*document_2</tt> identifies the root node of the
          second document <tt>{one: [a, sequence]}</tt>.</t>
          <figure>
            <name>A YAML Stream Containing Two YAML Documents</name>
            <sourcecode type="yaml"><![CDATA[
 %YAML 1.2
 ---
 one: &foo scalar
 two: &bar
   - some
   - sequence
   - items
 ...
 %YAML 1.2
 ---
 &document_2
 one: &foo [a, sequence]
]]></sourcecode>
          </figure>
        </section>
      </section>
    </section>
    <section anchor="media-type-and-structured-syntax-suffix-registrations">
      <name>Media Type and Structured Syntax Suffix Registrations</name>


      <t> This section includes the information required for IANA to register
      the <tt>application/yaml</tt> media type and the <tt>+yaml</tt> structured syntax suffix
      per <xref target="RFC6838"/>.</t>

      <section anchor="application-yaml">
        <name>Media Type <tt>application/yaml</tt></name>
        <t>The media type for YAML is <tt>application/yaml</tt>;
the following information serves as the registration form for this media type.</t>
        <dl>
          <dt>Type name:</dt>
          <dd>
            <t>application</t>
          </dd>
          <dt>Subtype name:</dt>
          <dd>
            <t>yaml</t>
          </dd>
          <dt>Required parameters:</dt>
          <dd>
            <t>N/A</t>
          </dd>
          <dt>Optional parameters:</dt>
          <dd>
            <t>N/A; unrecognized parameters should be ignored.</t>
          </dd>
          <dt>Encoding considerations:</dt>
          <dd>
            <t>binary</t>
          </dd>
          <dt>Security considerations:</dt>
          <dd>
            <t>See <xref target="security-considerations"/> of this document.</t>
          </dd>
          <dt>Interoperability considerations:</dt>
          <dd>
            <t>See <xref target="interoperability-considerations"/> of this document.</t>
          </dd>
          <dt>Published specification:</dt>
          <dd>
            <t><xref target="YAML"/>, this document</t>
          </dd>
          <dt>Applications that use this media type:</dt>
          <dd>
            <t>Applications that need a human-friendly, cross-language, and Unicode-based data serialization language designed around the common data types of dynamic programming languages.</t>
          </dd>
          <dt>Fragment identifier considerations:</dt>
          <dd>
            <t>See <xref target="application-yaml-fragment"/> of this document.</t>
          </dd>

        <dt>Additional information:</dt>
	<dd>
	  <t><br/></t>
	<dl spacing="compact">
          <dt>Deprecated alias names for this
          type:</dt><dd>application/x-yaml, text/yaml, and text/x-yaml. These
          names are used but are not registered.</dd>
          <dt>Magic number(s):</dt><dd>N/A</dd>
          <dt>File extension(s):</dt><dd>"yaml" (preferred) and "yml". See <xref target="int-yaml-filename-extension"/> of this document.</dd>
          <dt>Macintosh file type code(s):</dt><dd>N/A</dd>
          <dt>Windows Clipboard Name:</dt><dd>YAML</dd>
	</dl>
	</dd>
	
          <dt>Person and email address to contact for further information:</dt>
          <dd>
            <t>See the Authors' Addresses section of this document.</t>
          </dd>
          <dt>Intended usage:</dt>
          <dd>
            <t>COMMON</t>
          </dd>
          <dt>Restrictions on usage:</dt>
          <dd>
            <t>None</t>
          </dd>
          <dt>Author:</dt>
          <dd>
            <t>See the Authors' Addresses section of this document.</t>
          </dd>
          <dt>Change controller:</dt>
          <dd>
            <t>IETF</t>
          </dd>
        </dl>
      </section>
      <section anchor="suffix-yaml">
        <name>The <tt>+yaml</tt> Structured Syntax Suffix</name>
        <t>The suffix
<tt>+yaml</tt> <bcp14>MAY</bcp14> be used with any media type whose representation follows
that established for <tt>application/yaml</tt>.
The structured syntax suffix registration form follows.
	See <xref target="RFC6838"/> for definitions of each part of the registration form.</t>

        <dl>
          <dt>Name:</dt>
          <dd>
            <t>YAML Ain't Markup Language (YAML)</t>
          </dd>
          <dt>+suffix:</dt>
          <dd>
            <t><tt>+yaml</tt></t>
          </dd>
          <dt>References:</dt>
          <dd>
            <t><xref target="YAML"/>, this document</t>
          </dd>
          <dt>Encoding considerations:</dt>
          <dd>
            <t>Same as <tt>application/yaml</tt></t>
          </dd>
          <dt>Interoperability considerations:</dt>
          <dd>
            <t>Same as <tt>application/yaml</tt></t>
          </dd>	  
          <dt>Fragment identifier considerations:</dt>
          <dd>
            <t>Unlike <tt>application/yaml</tt>,
there is no fragment identification syntax defined
for <tt>+yaml</tt>.
</t>
            <t>A specific <tt>xxx/yyy+yaml</tt> media type
needs to define the syntax and semantics for fragment identifiers
because the ones defined for <tt>application/yaml</tt>
do not apply unless explicitly expressed.</t>
          </dd>
          <dt>Security considerations:</dt>
          <dd>
            <t>Same as <tt>application/yaml</tt></t>
          </dd>
          <dt>Contact:</dt>
          <dd>
            <t>httpapi@ietf.org or art@ietf.org</t>
          </dd>
          <dt>Author:</dt>
          <dd>
            <t>See the Authors' Addresses section of this document.</t>
          </dd>
          <dt>Change controller:</dt>
          <dd>
            <t>IETF</t>
          </dd>
        </dl>
      </section>
    </section>
    <section anchor="interoperability-considerations">
      <name>Interoperability Considerations</name>
      <section anchor="int-yaml-evolving">
        <name>YAML Is an Evolving Language</name>
        <t>YAML is an evolving language, and over time,
some features have been added and others removed.</t>

<t>The <tt>application/yaml</tt> media type registration is independent of the YAML version.
This allows content negotiation of version-independent YAML resources.</t>
        <t>Implementers concerned about features related to a specific YAML version
can specify it in YAML documents using the <tt>%YAML</tt> directive
(see Section 6.8.1 of <xref target="YAML"/>).</t>
      </section>
      <section anchor="int-yaml-streams">
        <name>YAML Streams</name>
        <t>A YAML stream can contain zero or more YAML documents.</t>

        <t>When receiving a multi-document stream,
an application that only expects single-document streams
should signal an error instead of ignoring the extra documents.</t>

<t>Current implementations consider different documents in a stream independent,
similarly to JSON text sequences (see <xref target="RFC7464"/>);
elements such as anchors are not guaranteed to be referenceable
across different documents.</t>
      </section>
      <section anchor="int-yaml-filename-extension">
        <name>Filename Extension</name>
        <t>The "yaml" filename extension is the preferred one;
it is the most popular and widely used on the web.
The "yml" filename extension is still used.
The simultaneous usage of two filename extensions in the same context
might cause interoperability issues
(e.g., when both a "config.yaml" and a "config.yml" are present).</t>
      </section>
      <section anchor="int-yaml-and-json">
        <name>YAML and JSON</name>
        <t>When using flow collection styles (see Section 7.4 of <xref target="YAML"/>),
a YAML document could look like JSON <xref target="RFC8259"/>;
thus, similar interoperability considerations apply.</t>
        <t>When using YAML as a more efficient format
to serialize information intended to be consumed as JSON,
information not reflected in the representation graph
and classified as presentation or serialization details
(see Section 3.2 of <xref target="YAML"/>) can be discarded.
This includes comments (see Section 3.2.3.3 of <xref target="YAML"/>),
directives, and alias nodes (see Section 7.1 of <xref target="YAML"/>)
that do not have a JSON counterpart.</t>
        <figure anchor="example-json-discards-information">
          <name>JSON Replaces Alias Nodes with Static Values</name>
          <sourcecode type="yaml"><![CDATA[
 %YAML 1.2
 ---
 # This comment will be lost
 # when serializing in JSON.
 Title:
   type: string
   maxLength: &text_limit 64

 Name:
   type: string
   maxLength: *text_limit  # Replaced by the value 64.
]]></sourcecode>
        </figure>
        <t>Implementers need to ensure that relevant
information will not be lost during processing.
For example, they might consider 
alias nodes being replaced by static values as acceptable.</t>
        <t>In some cases, an implementer may want to
define a list of allowed YAML features,
taking into account that the following features might have interoperability
issues with <xref target="RFC8259"/>:</t>
        <ul spacing="normal">
          <li>multi-document YAML streams</li>
          <li>non-UTF-8 encoding. Before encoding YAML streams in UTF-16 or UTF-32,
it is important to note that <xref section="8.1" sectionFormat="of" target="RFC8259"/> mandates the use of UTF-8
when exchanging JSON texts between systems that are not part of a closed ecosystem
and that Section 5.2 of <xref target="YAML"/> recommends the use of UTF-8.</li>
          <li>mapping keys that are not strings</li>
          <li>cyclic references represented using anchors (see <xref target="sec-yaml-exhaustion"/>
and <xref target="example-yaml-cyclic"/>)</li>
          <li>
            <tt>.inf</tt> and <tt>.nan</tt> float values, since JSON does not support them</li>
          <li>non-JSON types,
including the ones associated with tags like <tt>!!timestamp</tt>
that were included in the default schema of older YAML versions</li>
          <li>tags in general, specifically ones that do not map to JSON
          types, e.g., custom and local tags such as <tt>!!python/object</tt>
          and <tt>!mytag</tt> (see Section 2.4 of <xref target="YAML"/>)</li>
        </ul>
        <figure anchor="example-unsupported-keys">
          <name>Example of Mapping Keys and Values Not Supported in JSON in a Multi&nbhy;Document YAML Stream</name>
          <sourcecode type="yaml"><![CDATA[
 %YAML 1.2
 ---
 non-json-keys:
   0: a number
   [0, 1]: a sequence
   ? {k: v}
   : a map
 ---
 non-json-keys:
   !date 2020-01-01: a timestamp
 non-json-value: !date 2020-01-01
 ...
]]></sourcecode>
        </figure>
      </section>
      <section anchor="int-fragment">
        <name>Fragment Identifiers</name>
        <t>To allow fragment identifiers to traverse alias nodes, the YAML
        representation graph needs to be generated before the fragment
        identifier evaluation.  It is important that this evaluation does not
        cause the issues mentioned in Sections <xref
        target="int-yaml-and-json" format="counter"/> and <xref
        target="security-considerations" format="counter"/>, such as infinite loops and
        unexpected code execution.</t>
        <t>Implementers need to consider that the YAML version and supported features (e.g., merge keys)
can affect the generation of the representation graph (see <xref target="example-merge-keys"/>).</t>

<t>In <xref target="application-yaml-fragment"/>, this document extends the use of specifications based on
the JSON data model with support for YAML fragment identifiers.
This is to improve the interoperability of already-consolidated practices,
such as writing <xref target="OAS">OpenAPI documents</xref> in YAML.</t>
        <t><xref target="ex-fragid"/> provides a non-exhaustive list of examples to help
readers understand interoperability issues related to fragment identifiers.</t>
      </section>
    </section>
    <section anchor="security-considerations">
      <name>Security Considerations</name>
      <t>Security requirements for both media types and media type suffixes
are discussed in <xref target="RFC6838" sectionFormat="of" section="4.6"/>.</t>
      <section anchor="sec-yaml-code-execution">
        <name>Arbitrary Code Execution</name>
        <t>Care should be used when using YAML tags because their resolution
        might trigger unexpected code execution.</t>

        <t>Code execution in deserializers should be disabled by default
and only be enabled explicitly.
In the latter case, the implementation should ensure (for example, via specific functions)
that the code execution results in strictly bounded time/memory limits.</t>
        <t>Many implementations provide safe deserializers that address these issues.</t>
      </section>
      <section anchor="sec-yaml-exhaustion">
        <name>Resource Exhaustion</name>
        <t>YAML documents are rooted, connected, directed graphs
and can contain reference cycles,
so they can't be treated as simple trees (see Section 3.2.1 of <xref target="YAML"/>).
An implementation that treats them as simple trees
risks going into an infinite loop while traversing the YAML representation graph.
This can happen:</t>
        <ul spacing="normal">
          <li>when trying to serialize it as JSON or </li>
          <li>when searching/identifying nodes using specifications based on the JSON data model (e.g., <xref target="RFC6901"/>).</li>
        </ul>
        <figure anchor="example-yaml-cyclic">
          <name>A Cyclic Document</name>
          <sourcecode type="yaml"><![CDATA[
 %YAML 1.2
 ---
 x: &x
   y: *x
]]></sourcecode>
        </figure>

        <t>Even if a representation graph is not cyclic, treating it as a
        simple tree could lead to improper behaviors, such as triggering an
        Exponential Data Expansion (e.g., a Billion Laughs Attack).
	</t>
        <figure anchor="example-yaml-1e9lol">
          <name>A Billion Laughs Document</name>
          <sourcecode type="yaml"><![CDATA[
 %YAML 1.2
 ---
 x1: &a1 ["a", "a"]
 x2: &a2 [*a1, *a1]
 x3: &a3 [*a2, *a2]
]]></sourcecode>
        </figure>
        <t>This can be addressed using processors that limit the anchor recursion depth
and validate the input before processing it;
even in these cases, it is important
to carefully test the implementation you are going to use.
The same considerations apply when serializing a YAML representation graph
in a format that does not support reference cycles (see <xref target="int-yaml-and-json"/>).</t>
      </section>
      <section anchor="yaml-streams">
        <name>YAML Streams</name>
        <t>Incremental parsing and processing of a YAML stream can produce partial results
and later indicate failure to parse the remainder of the stream;
to prevent partial processing, implementers might prefer validating and processing all the documents in a stream at the same time.</t>
        <t>Repeated parsing and re-encoding of a YAML stream can result
in the addition or removal of document delimiters (e.g., <tt>---</tt> or <tt>...</tt>)
as well as the modification of anchor names and other serialization details that can break signature validation.</t>
      </section>
      <section anchor="expressing-booleans">
        <name>Expressing Booleans</name>
        <t>Section 10.3.2 of <xref target="YAML"/> specifies that only the scalars matching the
regular expression <tt>true|True|TRUE|false|False|FALSE</tt> are interpreted as booleans.
Older YAML versions were more tolerant (e.g., interpreting <tt>NO</tt> and <tt>N</tt> as <tt>False</tt> and interpreting
<tt>YES</tt> and <tt>Y</tt> as <tt>True</tt>).
When the older syntax is used, a YAML implementation could then interpret
<tt>{insecure: n}</tt> as <tt>{insecure: "n"}</tt> instead of <tt>{insecure: false}</tt>.
Using the syntax defined in Section 10.3.2 of <xref target="YAML"/> prevents these issues.</t>
      </section>
    </section>
    <section anchor="iana-considerations">
      <name>IANA Considerations</name>
      <t> IANA has updated the <eref
      target="https://www.iana.org/assignments/media-types">"Media Types"
      registry</eref> with the registration information in <xref
      target="application-yaml"/> for the
      media type <tt>application/yaml</tt>.
      </t>

      <t>IANA has updated the <eref
      target="https://www.iana.org/assignments/media-type-structured-suffix">"Structured
      Syntax Suffixes" registry</eref> with the registration information in
      <xref target="suffix-yaml"/> for the structured syntax suffix
      <tt>+yaml</tt>.</t>

    </section>
  </middle>
  <back>
<displayreference target="RFC3986" to="URI"/>
<displayreference target="RFC3629" to="UTF-8"/>
<displayreference target="RFC6838" to="MEDIATYPE"/>
<displayreference target="RFC6901" to="JSON-POINTER"/>
<displayreference target="RFC9110" to="HTTP"/>
<displayreference target="RFC8259" to="JSON"/>

    <references>
      <name>References</name>
      <references>
        <name>Normative References</name>

	
<xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.6901.xml"/>
<xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.6838.xml"/>
<xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8259.xml"/>
<xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml"/>
<xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8174.xml"/>
<xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.9110.xml"/>
<xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.3986.xml"/>
<xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.3629.xml"/>


        <reference anchor="YAML" target="https://yaml.org/spec/1.2.2/">
          <front>
            <title>YAML Ain't Markup Language Version 1.2</title>
            <author initials="O" surname="Ben-Kiki">
              <organization/>
            </author>
            <author initials="C" surname="Evans">
              <organization/>
            </author>
            <author initials="I" surname="dot Net">
              <organization/>
            </author>
            <author initials="T" surname="Müller">
              <organization/>
            </author>
            <author initials="P" surname="Antoniou">
              <organization/>
            </author>
            <author initials="E" surname="Aro">
              <organization/>
            </author>
            <author initials="T" surname="Smith">
              <organization/>
            </author>
            <date year="2021" month="October" day="01"/>
          </front>
        </reference>

       <reference anchor="OAS">
          <front>
            <title>OpenAPI Specification</title>
            <author initials="D" surname="Miller">
              <organization/>
            </author>
            <author initials="J" surname="Whitlock">
              <organization/>
            </author>
            <author initials="M" surname="Gardiner">
              <organization/>
            </author>
            <author initials="M" surname="Ralphson">
              <organization/>
            </author>
            <author initials="R" surname="Ratovsky">
              <organization/>
            </author>
            <author initials="U" surname="Sarid">
              <organization/>
            </author>
            <date year="2017" month="July" day="26"/>
          </front>
	  <refcontent>v3.0.0</refcontent>
        </reference>
      </references>
      <references>

        <name>Informative References</name>

<xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.7464.xml"/>

      </references>
    </references>


<section anchor="ex-fragid">
      <name>Examples Related to Fragment Identifier Interoperability</name>
      <section anchor="unreferenceable-nodes">
        <name>Unreferenceable Nodes</name>

        <t> This example shows a couple of YAML nodes that cannot be
        referenced based on the JSON data model since their mapping keys are
        not strings.</t>
        <figure anchor="example-unsupported-paths">
          <name>Example of YAML Nodes That Are Not Referenceable Based on JSON Data Model</name>
          <sourcecode type="yaml"><![CDATA[
 %YAML 1.2
 ---
 a-map-cannot:
   ? {be: expressed}
   : with a JSON Pointer

 0: no numeric mapping keys in JSON
]]></sourcecode>
        </figure>
      </section>
      <section anchor="referencing-a-missing-node">
        <name>Referencing a Missing Node</name>
        <t>In this example, the fragment <tt>#/0</tt> does not reference an existing node.</t>
        <figure anchor="example-missing-node">
          <name>Example of a JSON Pointer That Does Not Reference an Existing Node</name>
          <sourcecode type="yaml"><![CDATA[
 %YAML 1.2
 ---
 0: "JSON Pointer `#/0` references a string mapping key."
]]></sourcecode>
        </figure>
      </section>
      <section anchor="representation-graph-with-anchors-and-cyclic-references">
        <name>Representation Graph with Anchors and Cyclic References</name>
        <t>In this YAML document, the <tt>#/foo/bar/baz</tt> fragment identifier
traverses the representation graph and references the string <tt>you</tt>.
Moreover, the presence of a cyclic reference implies that
there are infinite fragment identifiers <tt>#/foo/bat/../bat/bar</tt>
referencing the <tt>&amp;anchor</tt> node.</t>
        <figure anchor="example-cyclic-graph">
          <name>Example of a Cyclic Reference and Alias Nodes</name>
          <sourcecode type="yaml"><![CDATA[
 %YAML 1.2
 ---
 anchor: &anchor
   baz: you
 foo: &foo
   bar: *anchor
   bat: *foo
]]></sourcecode>
        </figure>

	<t>Many YAML implementations will resolve
<eref target="https://yaml.org/type/merge.html">the merge key "&lt;&lt;:"</eref> defined in YAML 1.1
in the representation graph.
This means that the fragment <tt>#/book/author/given_name</tt> references the string <tt>Federico</tt>
and that the fragment <tt>#/book/&lt;&lt;</tt> will not reference any existing node.</t>
        <figure anchor="example-merge-keys">
          <name>Example of YAML Merge Keys</name>
          <sourcecode type="yaml"><![CDATA[
 %YAML 1.1
 ---
 # Many implementations use merge keys.
 the-viceroys: &the-viceroys
   title: The Viceroys
   author:
     given_name: Federico
     family_name: De Roberto
 book:
   <<: *the-viceroys
   title: The Illusion
]]></sourcecode>
        </figure>
      </section>
    </section>
    <section numbered="false" anchor="acknowledgements">
      <name>Acknowledgements</name>
      <t>Thanks to <contact fullname="Erik Wilde"/> and <contact fullname="David Biesack"/> for being the initial contributors to this specification
and to <contact fullname="Darrel Miller"/> and <contact fullname="Rich Salz"/> for their support during the adoption phase.</t>
      <t>In addition, this document owes a lot to the
      extensive discussion inside and outside the HTTPAPI Working Group.  The
      following contributors helped improve this specification by opening
      pull requests, reporting bugs, asking smart questions, drafting or
      reviewing text, and evaluating open issues: <contact fullname="Tina
      (tinita) Müller"/>, <contact fullname="Ben Hutton"/>, <contact
      fullname="Carsten Bormann"/>, <contact fullname="Manu Sporny"/>, and
      <contact fullname="Jason Desrosiers."/></t>
    </section>

</back>

</rfc>
