@@ -114,7 +114,18 @@ export interface SchemaNode extends SchemaNodeMethodsType {
114
114
$id ?: string ;
115
115
$defs ?: Record < string , SchemaNode > ;
116
116
$ref ?: string ;
117
- /** only used for draft <= 2019-09 */
117
+ /**
118
+ * # Items-object schema for additional items for drafts <= 2019-09
119
+ *
120
+ * - `additionalItems` is ignored when items-schema is not an array
121
+ *
122
+ * If `items` is present, and its annotation result is a number, validation succeeds if every
123
+ * instance element at an index greater than that number validates against "additionalItems".
124
+ * Otherwise, if `items` is absent or its annotation result is the boolean true,
125
+ * `additionalItems` is ignored.
126
+ *
127
+ * [Specification](https://json-schema.org/draft/2019-09/draft-handrews-json-schema-02#additionalItems)
128
+ */
118
129
additionalItems ?: SchemaNode ;
119
130
additionalProperties ?: SchemaNode ;
120
131
allOf ?: SchemaNode [ ] ;
@@ -124,7 +135,39 @@ export interface SchemaNode extends SchemaNodeMethodsType {
124
135
dependentSchemas ?: Record < string , SchemaNode | boolean > ;
125
136
else ?: SchemaNode ;
126
137
if ?: SchemaNode ;
138
+ /**
139
+ * # Items-array schema for all drafts
140
+ *
141
+ * - for drafts prior 2020-12 items[]-schema stored as `prefixItems`
142
+ *
143
+ * Validation succeeds if each element of the instance validates against the schema at the
144
+ * same position, if any.
145
+ *
146
+ * The `prefixItems` keyword restricts a number of items from the start of an array instance
147
+ * to validate against the given sequence of subschemas, where the item at a given index in
148
+ * the array instance is evaluated against the subschema at the given index in the `prefixItems`
149
+ * array, if any. Array items outside the range described by the `prefixItems` keyword is
150
+ * evaluated against the items keyword, if present.
151
+ *
152
+ * [Docs](https://www.learnjsonschema.com/2020-12/applicator/prefixitems/)
153
+ * | [Examples](https://json-schema.org/understanding-json-schema/reference/array#tupleValidation)
154
+ */
127
155
prefixItems ?: SchemaNode [ ] ;
156
+ /**
157
+ * # Items-object schema
158
+ *
159
+ * - ⚠️ For drafts < 2020-12, `additionalItems` is still used and must be referenced by `node.additionalItems`
160
+ *
161
+ * Validation succeeds if each element of the instance not covered by `prefixItems` validates
162
+ * against this schema.
163
+ *
164
+ * The items keyword restricts array instance items not described by the sibling `prefixItems`
165
+ * keyword (if any), to validate against the given subschema. Whetherthis keyword was evaluated
166
+ * against any item of the array instance is reported using annotations.
167
+ *
168
+ * [Docs](https://www.learnjsonschema.com/2020-12/applicator/items/)
169
+ * | [Examples](https://json-schema.org/understanding-json-schema/reference/array#items)
170
+ */
128
171
items ?: SchemaNode ;
129
172
not ?: SchemaNode ;
130
173
oneOf ?: SchemaNode [ ] ;
0 commit comments