diff --git a/docs/json-schema.md b/docs/json-schema.md index 23346a50e..01eaaf66a 100644 --- a/docs/json-schema.md +++ b/docs/json-schema.md @@ -453,16 +453,16 @@ For the data array to be valid, the items with indices less than the number of s _schema_: - ```javascript - { - type: "array", - prefixItems: [{type: "integer"}, {type: "string"}] - } - ``` +```javascript +{ + type: "array", + prefixItems: [{type: "integer"}, {type: "string"}] +} +``` - _valid_: `[1]`, `[1, "abc"]`, `[1, "abc", 2]`, `[]` +_valid_: `[1]`, `[1, "abc"]`, `[1, "abc", 2]`, `[]` - _invalid_: `["abc", 1]`, `["abc"]` +_invalid_: `["abc", 1]`, `["abc"]` The schema in example will log warning by default (see `strictTuples` option), because it defines unconstrained tuple. To define a tuple with exactly 2 elements use [minItems](#minitems) and [items](#items-in-draft-2020-12) keywords (see example 2 in [items](#items-in-draft-2020-12)).