Additional Items in Tuples

There is no new keyword for the additional items in tuple arrays. You can use the items keyword to define the schema for the additional items in a tuple array.

We will use the same example as the previous lesson.

1{
2  "name": "John Doe",
3  "age": 25,
4  "address": [123, "Main St", "Avenue", "NW"]
5}

You can set the items keyword to false to disallow additional items in the tuple array. Example

1{
2  "type": "array",
3  "items": false
4}

Now, try to modify the address property on the side editor, to allow only string values as additional items in the tuple array.

Hint: add a subschema to the items keyword to define the schema for the additional items.

Loading...
Output
Please click the button or use
Shift+Enter
to view the output