Objects and arrays
02Object members map string names to values. Arrays retain an ordered sequence of elements.
Related RFCs and changes
“Updates” changes part of an earlier RFC. “Obsoletes” replaces it. This list shows selected related documents.
DIAGRAM§ 4 ↗
RFC 8259 · § 4EXAMPLE
3 / 3
03
Avoid ambiguous mappings.
Two members named role can produce different results in different implementations.
Protocol participantThreat or exceptionProtocol controlSimplified drawings · precise section references
Read the updated RFC section ↗
Use names for members and positions for ordered elements.
- Object names are strings; a colon separates name and value, and commas separate members. Names should be unique.
- An array is ordered, can be empty, and may mix value types.
- Applications that depend on object-member order are less interoperable because parsers expose that order differently.
Duplicate object names can be accepted by the grammar but produce incompatible consumer behavior: last value, all values, or an error. Use unique names to avoid this ambiguity.
Read the RFC section ↗Diagrams simplify the RFC. Read the linked sections for complete requirements.
Privacy