Objects
Work in Progress!
Last updated
Work in Progress!
Last updated
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.
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.
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 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.
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.
Symbol
Characters
Unicode
Description
,
Comma
U+002C
Used as a value separator
:
Colon
U+003A
Key-value separator
[
Open Square Bracket
U+005B
Begins an array boundary
]
Close Square Bracket
U+005D
Closes an array boundary
{
Open Curly
Bracket
U+007B
Begins an object boundary
}
Close Curly Bracket
U+007D
Closes an object boundary