You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(mapping <a>strings</a> to values in the <ahref="#JSON-value-space">value space</a> where the order of <adata-cite="INFRA#map-entry">map entries</a>is not significant),
1847
+
mapping <a>strings</a> to values in the <ahref="#JSON-value-space">value space</a> where the key-value pairs are ordered by key (using <adata-cite="I18N-GLOSSARY#dfn-code-point" class="lint-ignore">Unicode code points</a>order),
1848
1848
<adata-cite="INFRA#list">lists</a>
1849
-
(of values in the <ahref="#JSON-value-space">value space</a>), and
1849
+
of values in the <ahref="#JSON-value-space">value space</a>, and
1850
1850
literal values (<adata-cite="INFRA#boolean">`true`, `false`</a>, and <adata-cite="INFRA#nulls">`null`</a>)
1851
1851
from [[[INFRA]]] [[INFRA]] and [[[XMLSCHEMA11-2]]] [[XMLSCHEMA11-2]].
1852
1852
1853
1853
<pclass="note">The value space of <adata-cite="INFRA#ordered-map">maps</a>
1854
1854
and <adata-cite="INFRA#list">lists</a> does not include values having themselves as members,
1855
1855
which cannot be represented in JSON.</p>
1856
1856
1857
-
<p>Two values (|a| and |b|) are considered equal if any of the following are true:
1858
-
<ul>
1859
-
<li>They are the same <a>string</a>,
1860
-
number (<adata-cite="XMLSCHEMA11-2#double"><strong>xsd:double</strong></a>), or
1861
-
literal value.</li>
1862
-
<li>They are both <adata-cite="INFRA#list">lists</a> containing <adata-cite="INFRA#list-item">items</a>
1863
-
which are pairwise equal – meaning that each <adata-cite="INFRA#list-item">item</a>
1864
-
in |a| is equal the <adata-cite="INFRA#list-item">item</a>
1865
-
at the corresponding index in |b|,
1866
-
and both |a| and |b| have the same <adata-cite="INFRA#list-size">size</a>.</li>
1867
-
<li>They are both <adata-cite="INFRA#ordered-map">maps</a> with equal <adata-cite="INFRA#map-entry">entries</a>
1868
-
– meaning that for each entry <var>e<sub>a</sub></var> in |a|
1869
-
there exists an entry <var>e<sub>b</sub></var> in |b|
1870
-
such that the <adata-cite="INFRA#map-key">key</a> in <var>e<sub>a</sub></var>
1871
-
equals the <adata-cite="INFRA#map-key">key</a> in <var>e<sub>b</sub></var>,
1872
-
the <adata-cite="INFRA#map-value">value</a> in <var>e<sub>a</sub></var>
1873
-
equals the <adata-cite="INFRA#map-value">value</a> in <var>e<sub>b</sub></var>,
1874
-
and both |a| and |b| have the same <adata-cite="INFRA#map-size">size</a>.
1875
-
<divclass="note">Two JSON Objects containing maps which are serialized with entries in a different order will be equal under this definition when transformed to the value space.
1876
-
For example, `{ "a": 1, "b": 2 } and { "b": 2, "a": 1 }` are considered equal.
1877
-
As a result of the value space being defined using terminology from [[INFRA]],
1878
-
property values which can contain more than one item, such as <adata-cite="INFRA#list">lists</a> and <adata-cite="INFRA#ordered-map">maps</a>,
1879
-
are explicitly ordered.
1880
-
All list-like value structures in [[INFRA]] are ordered,
1881
-
whether or not that order is significant.
1882
-
For the purposes of this specification, unless otherwise stated,
1883
-
<adata-cite="INFRA#ordered-map">map</a> ordering is not important
1884
-
and implementations are not expected to produce or consume deterministically ordered values.
1885
-
</div>
1886
-
</li>
1887
-
</ul>
1857
+
<p>Two values are considered equal if and only if they are the same element of the value space.</p>
The constraint to order map entries in the value space is only meant to make the order of object-member the lexical space irrelevant. In other word, it ensures that both lexical values <code>{"a": "b", "c": "d"}</code> and <code>{"c": "d", "a": "b"}</code> are mapped to the same element of the value space. Implementations may omit to sort the entries, as long as they treat the maps in the value space as unordered.
1908
+
</p>
1935
1909
<pclass="issue" data-number="116">The issue refers to the use
1936
1910
of <adata-cite="INFRA#ordered-map">ordered map</a>
1937
1911
from [[INFRA]] for describing the value space of <adata-cite="RFC8259#section-4">JSON Objects</a>
0 commit comments