Objects
Work in Progress!
Objects are a fundamental element in Internet Object documents, providing a clear and intuitive way to represent structured data.
An object is expressed as a sequence of values (and key/value pairs) separated by commas (,
U+002C
). For simplicity, clarity, and ease of reading, Internet Object supports two modes for objects: Open and Closed. The Open mode does not require enclosing values in curly brackets and is only supported for top-level objects.
Syntax
Open Object
Closed Object
Object Structural Characters
Characteristics
Objects can contain values of various types, including other objects, arrays, strings, numbers, boolean, and null. Keys can also be attached to all or some of the values to provide more information and make the objects more self-explanatory. The keys are valid Internet Object string values, and any format of string (Open, Regular, Raw) can be used to represent them.
Basic object
An object is essentially an ordered collection of values similar to CSV records.
Objects with child objects and arrays.
An object is not required to be wrapped inside the curly braces unless it is a child object. However, putting them in between the braces will not make it invalid.
Object with Inline Keys
Object structure also supports unique inline keys. In the following example isActive
, address
, and personalities
have associated keys.
Inline keys can be attached to all the values or some of them. When an object contains both types of values (key value and non-key value), the key-value pair must be placed after the non-key values (sequential values).
As the object keys are valid Internet Object String values, any format of string (Open, Regular, Raw) can be used to represent them.
Empty objects and empty trailing values
An empty object must be enclosed by curly braces.
An object can contain empty values. The following object contains two empty values, after the name John Doe, and the second before the address.
Trailing empty commas are ignored.
Last updated