Visual RFC.
ALL RFCs / RFC 7493
Read the RFC ↗
RFC 7493 / Internet JSON interoperability

Detect duplicate names before building an object

03

Member names are compared after decoding escapes. A parser that overwrites duplicates may erase the evidence before you check it.

RFC 7493 · § 2.3EXAMPLE
4 / 4
Detect duplicate names before building an objectPrecomposed é and e plus combining acute remain different character sequences. Their similar appearance does not authorize normalization or merging.Check names before values are overwrittenName A: é = U+00E9Name B: e + U+0301Different decoded character sequencesNot duplicate names under this comparisonNo Unicode normalization is addedEach object has its own name set · arrays retain order
04
Preserve distinct character sequences

Precomposed and decomposed names are not duplicates under the decoded-sequence comparison; no Unicode normalization is invented.

Source for this drawing: RFC 7493 · Read RFC section 2.3 ↗

Protocol participantThreat or exceptionProtocol controlSimplified drawings · precise section references
New to this? Start hereA quick picture + helpful background

First, agree how to read the message.

An encoding tells a reader how to interpret bytes. A format tells it how values fit together. Correctly reading a value does not make that value trustworthy.

Helpful first, if these ideas are unfamiliar

These pictures are analogies to help you learn. The linked RFC explains the actual rules.

Related RFCs and changes

“Updates” changes part of an earlier RFC. “Obsoletes” replaces it. This list shows selected related documents.

KEY POINT

Compare decoded names within each object; do not confuse object order with array order.

  • Objects in I-JSON MUST NOT have members with duplicate names. Compare the Unicode character sequences after processing escapes (§2.3). In {"a":1,"\u0061":2}, both names decode to a, so the object fails even though its source spellings differ.
  • Duplicate detection must preserve the incoming member sequence long enough to see both names. Applying a first-wins or last-wins map conversion and then checking its keys loses that evidence. The illustration stops at the duplicate gate before accepting an object; it does not invent a JSON error packet (§§2.3,3).
  • The scope is each object. {"left":{"x":1},"right":{"x":2}} does not duplicate a member name in the same object. Conversely, a repeated name in a nested object still violates the rule. Keys such as __proto__ are ordinary names for this profile, not permission to mutate a language prototype.
  • Order of object members does not change I-JSON meaning; receivers MAY treat messages differing only in member order as equivalent (§2.3). This is not canonical byte order and does not reorder arrays. [1,2] and[2,1] remain different ordered JSON arrays.
  • Compare decoded sequences without silently normalizing them. The name é (U+00E9) differs from e followed by U+0301; case also remains significant. I-JSON does not require these distinct names to be merged. Schema/application restrictions may be stricter, and a valid name is not trusted authority.
DETAILS

Offline illustrative messages and bounded helpers, not a production parser, full calendar validator or authentication protocol. Reported errata are not adopted as verified corrections.

Read the RFC section ↗

All chapters in RFC 7493

Drawing view

Scroll the drawing to see every part. Playback controls stay above it.

RFC 9700 / CHAPTERS

Chapters

For full details, tables, algorithms, and exceptions, read the original RFC.

RFC status and corrections ↗