You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/guide/format-overview.md
+34Lines changed: 34 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -107,6 +107,40 @@ items[3]:
107
107
108
108
Each element starts with `- ` at one indentation level deeper than the parent array header.
109
109
110
+
### Objects as List Items
111
+
112
+
When an array element is an object, it appears as a list item:
113
+
114
+
```yaml
115
+
items[2]:
116
+
- id: 1
117
+
name: First
118
+
- id: 2
119
+
name: Second
120
+
extra: true
121
+
```
122
+
123
+
When a tabular array is the first field of a list-item object, the tabular header appears on the hyphen line, with rows indented two levels deeper and other fields indented one level deeper:
124
+
125
+
```yaml
126
+
items[1]:
127
+
- users[2]{id,name}:
128
+
1,Ada
129
+
2,Bob
130
+
status: active
131
+
```
132
+
133
+
When the object has only a single tabular field, the same pattern applies:
134
+
135
+
```yaml
136
+
items[1]:
137
+
- users[2]{id,name}:
138
+
1,Ada
139
+
2,Bob
140
+
```
141
+
142
+
This is the canonical encoding for list-item objects whose first field is a tabular array.
143
+
110
144
### Arrays of Arrays
111
145
112
146
When you have arrays containing primitive inner arrays:
Copy file name to clipboardExpand all lines: docs/reference/syntax-cheatsheet.md
+22Lines changed: 22 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -97,6 +97,28 @@ items[3]:
97
97
98
98
:::
99
99
100
+
> [!NOTE]
101
+
> When a list-item object has a tabular array as its first field, the tabular header appears on the hyphen line. Rows are indented two levels deeper than the hyphen, and other fields are indented one level deeper. This is the canonical encoding for this pattern.
0 commit comments