Visual RFC.
ALL RFCs / RFC 8785
Read the RFC ↗
RFC 8785 / REPEATABLE JSON BYTES

Check the input first

01

Canonical means one repeatable representation of parsed data. First exclude ambiguous names, invalid characters and unsupported numbers.

RFC 8785 · § 3.1EXAMPLE
4 / 4
Check the input firstFour separate input cases enter the JCS input gate. A unique a property with value1 is accepted. Duplicate decoded a names and a lone surrogate stop before canonical output. Negative zero is a separate parser case which follows the verified erratum recommendation to error and stop; that recommendation is SHOULD, not MUST.Separate input cases · validate first-0Parser security checkcheck inputSHOULD error · stopChosen policy: reject negative zeroNo canonical outputVerified erratum 7920 · SHOULD, not MUST
04
Follow the verified security recommendation.

Separate input -0: the parser generates an error and stops, following both SHOULDs in erratum 7920. This is not a new MUST.

Source for this drawing: RFC 8785 · Read RFC section 3.1 ↗

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

Deterministic output starts with unambiguous input.

  • Input MUST be adapted to I-JSON: no duplicate object names, Unicode string data, and numbers expressible as IEEE 754 double precision (binary64). I-JSON also excludes Unicode noncharacters.
  • Duplicate names are compared after decoding escapes. A parser that silently keeps the last value cannot establish that the original input had no duplicates. Lone surrogates, NaN and Infinity MUST terminate JCS processing with an error.
  • Verified erratum 7920 adds a SHOULD: a parser encountering -0 SHOULD generate an error, which SHOULD stop processing. The underlying number serializer still maps negative zero to 0; these are different stages.
DETAILS

Four separate input cases are shown, not a stream of repairs. The negative-zero case follows the recommended rejection. This Informational, Independent Submission uses BCP 14 requirements for conforming implementations; it is not an IETF Standards Track publication. See https://www.rfc-editor.org/errata/eid7920 .

Read the RFC section ↗

All chapters in RFC 8785

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 ↗