[
	{
		"description": "a schema given for items",
		"schema": {
			"$schema": "https://json-schema.org/draft/2020-12/schema",
			"items": {
				"type": "integer"
			}
		},
		"tests": [
			{
				"description": "valid items",
				"data": [
					1,
					2,
					3
				],
				"valid": true
			},
			{
				"description": "wrong type of items",
				"data": [
					1,
					"x"
				],
				"valid": false
			},
			{
				"description": "ignores non-arrays",
				"data": {
					"foo": "bar"
				},
				"valid": true
			},
			{
				"description": "JavaScript pseudo-array is valid",
				"data": {
					"0": "invalid",
					"length": 1
				},
				"valid": true
			}
		]
	},
	{
		"description": "items with boolean schema (true)",
		"schema": {
			"$schema": "https://json-schema.org/draft/2020-12/schema",
			"items": true
		},
		"tests": [
			{
				"description": "any array is valid",
				"data": [
					1,
					"foo",
					true
				],
				"valid": true
			},
			{
				"description": "empty array is valid",
				"data": [],
				"valid": true
			}
		]
	},
	{
		"description": "items with boolean schema (false)",
		"schema": {
			"$schema": "https://json-schema.org/draft/2020-12/schema",
			"items": false
		},
		"tests": [
			{
				"description": "any non-empty array is invalid",
				"data": [
					1,
					"foo",
					true
				],
				"valid": false
			},
			{
				"description": "empty array is valid",
				"data": [],
				"valid": true
			}
		]
	},
	{
		"description": "items and subitems",
		"schema": {
			"$schema": "https://json-schema.org/draft/2020-12/schema",
			"$defs": {
				"item": {
					"type": "array",
					"items": false,
					"prefixItems": [
						{
							"$ref": "#/$defs/sub-item"
						},
						{
							"$ref": "#/$defs/sub-item"
						}
					]
				},
				"sub-item": {
					"type": "object",
					"required": [
						"foo"
					]
				}
			},
			"type": "array",
			"items": false,
			"prefixItems": [
				{
					"$ref": "#/$defs/item"
				},
				{
					"$ref": "#/$defs/item"
				},
				{
					"$ref": "#/$defs/item"
				}
			]
		},
		"skip": {
			"v2": "extract error: cannot compile resulting schema: explicit error (_|_ literal) in source:\n    generated.cue:10:12\n",
			"v3": "extract error: cannot compile resulting schema: explicit error (_|_ literal) in source:\n    generated.cue:10:12\n"
		},
		"tests": [
			{
				"description": "valid items",
				"data": [
					[
						{
							"foo": null
						},
						{
							"foo": null
						}
					],
					[
						{
							"foo": null
						},
						{
							"foo": null
						}
					],
					[
						{
							"foo": null
						},
						{
							"foo": null
						}
					]
				],
				"valid": true,
				"skip": {
					"v2": "could not compile schema",
					"v3": "could not compile schema"
				}
			},
			{
				"description": "too many items",
				"data": [
					[
						{
							"foo": null
						},
						{
							"foo": null
						}
					],
					[
						{
							"foo": null
						},
						{
							"foo": null
						}
					],
					[
						{
							"foo": null
						},
						{
							"foo": null
						}
					],
					[
						{
							"foo": null
						},
						{
							"foo": null
						}
					]
				],
				"valid": false,
				"skip": {
					"v2": "could not compile schema",
					"v3": "could not compile schema"
				}
			},
			{
				"description": "too many sub-items",
				"data": [
					[
						{
							"foo": null
						},
						{
							"foo": null
						},
						{
							"foo": null
						}
					],
					[
						{
							"foo": null
						},
						{
							"foo": null
						}
					],
					[
						{
							"foo": null
						},
						{
							"foo": null
						}
					]
				],
				"valid": false,
				"skip": {
					"v2": "could not compile schema",
					"v3": "could not compile schema"
				}
			},
			{
				"description": "wrong item",
				"data": [
					{
						"foo": null
					},
					[
						{
							"foo": null
						},
						{
							"foo": null
						}
					],
					[
						{
							"foo": null
						},
						{
							"foo": null
						}
					]
				],
				"valid": false,
				"skip": {
					"v2": "could not compile schema",
					"v3": "could not compile schema"
				}
			},
			{
				"description": "wrong sub-item",
				"data": [
					[
						{},
						{
							"foo": null
						}
					],
					[
						{
							"foo": null
						},
						{
							"foo": null
						}
					],
					[
						{
							"foo": null
						},
						{
							"foo": null
						}
					]
				],
				"valid": false,
				"skip": {
					"v2": "could not compile schema",
					"v3": "could not compile schema"
				}
			},
			{
				"description": "fewer items is valid",
				"data": [
					[
						{
							"foo": null
						}
					],
					[
						{
							"foo": null
						}
					]
				],
				"valid": true,
				"skip": {
					"v2": "could not compile schema",
					"v3": "could not compile schema"
				}
			}
		]
	},
	{
		"description": "nested items",
		"schema": {
			"$schema": "https://json-schema.org/draft/2020-12/schema",
			"type": "array",
			"items": {
				"type": "array",
				"items": {
					"type": "array",
					"items": {
						"type": "array",
						"items": {
							"type": "number"
						}
					}
				}
			}
		},
		"tests": [
			{
				"description": "valid nested array",
				"data": [
					[
						[
							[
								1
							]
						],
						[
							[
								2
							],
							[
								3
							]
						]
					],
					[
						[
							[
								4
							],
							[
								5
							],
							[
								6
							]
						]
					]
				],
				"valid": true
			},
			{
				"description": "nested array with invalid type",
				"data": [
					[
						[
							[
								"1"
							]
						],
						[
							[
								2
							],
							[
								3
							]
						]
					],
					[
						[
							[
								4
							],
							[
								5
							],
							[
								6
							]
						]
					]
				],
				"valid": false
			},
			{
				"description": "not deep enough",
				"data": [
					[
						[
							1
						],
						[
							2
						],
						[
							3
						]
					],
					[
						[
							4
						],
						[
							5
						],
						[
							6
						]
					]
				],
				"valid": false
			}
		]
	},
	{
		"description": "prefixItems with no additional items allowed",
		"schema": {
			"$schema": "https://json-schema.org/draft/2020-12/schema",
			"prefixItems": [
				{},
				{},
				{}
			],
			"items": false
		},
		"tests": [
			{
				"description": "empty array",
				"data": [],
				"valid": true,
				"skip": {
					"v2": "5 errors in empty disjunction:\nconflicting values [] and {...} (mismatched types list and struct):\n    generated.cue:3:1\n    generated.cue:3:61\n    instance.json:1:1\nconflicting values bool and [] (mismatched types bool and list):\n    generated.cue:3:8\n    instance.json:1:1\nconflicting values null and [] (mismatched types null and list):\n    generated.cue:3:1\n    instance.json:1:1\nconflicting values number and [] (mismatched types number and list):\n    generated.cue:3:15\n    instance.json:1:1\nconflicting values string and [] (mismatched types string and list):\n    generated.cue:3:24\n    instance.json:1:1\n",
					"v3": "7 errors in empty disjunction:\nconflicting values [] and bool (mismatched types list and bool):\n    generated.cue:3:8\n    instance.json:1:1\nconflicting values [] and null (mismatched types list and null):\n    generated.cue:3:1\n    instance.json:1:1\nconflicting values [] and number (mismatched types list and number):\n    generated.cue:3:15\n    instance.json:1:1\nconflicting values [] and string (mismatched types list and string):\n    generated.cue:3:24\n    instance.json:1:1\nconflicting values [] and {...} (mismatched types list and struct):\n    generated.cue:3:61\n    instance.json:1:1\nincompatible list lengths (0 and 4):\n    generated.cue:3:33\nexplicit error (_|_ literal) in source:\n    generated.cue:3:54\n"
				}
			},
			{
				"description": "fewer number of items present (1)",
				"data": [
					1
				],
				"valid": true,
				"skip": {
					"v2": "5 errors in empty disjunction:\nconflicting values [1] and {...} (mismatched types list and struct):\n    generated.cue:3:1\n    generated.cue:3:61\n    instance.json:1:1\nconflicting values bool and [1] (mismatched types bool and list):\n    generated.cue:3:8\n    instance.json:1:1\nconflicting values null and [1] (mismatched types null and list):\n    generated.cue:3:1\n    instance.json:1:1\nconflicting values number and [1] (mismatched types number and list):\n    generated.cue:3:15\n    instance.json:1:1\nconflicting values string and [1] (mismatched types string and list):\n    generated.cue:3:24\n    instance.json:1:1\n",
					"v3": "7 errors in empty disjunction:\nconflicting values [1] and bool (mismatched types list and bool):\n    generated.cue:3:8\n    instance.json:1:1\nconflicting values [1] and null (mismatched types list and null):\n    generated.cue:3:1\n    instance.json:1:1\nconflicting values [1] and number (mismatched types list and number):\n    generated.cue:3:15\n    instance.json:1:1\nconflicting values [1] and string (mismatched types list and string):\n    generated.cue:3:24\n    instance.json:1:1\nconflicting values [1] and {...} (mismatched types list and struct):\n    generated.cue:3:61\n    instance.json:1:1\nincompatible list lengths (1 and 4):\n    generated.cue:3:33\nexplicit error (_|_ literal) in source:\n    generated.cue:3:54\n"
				}
			},
			{
				"description": "fewer number of items present (2)",
				"data": [
					1,
					2
				],
				"valid": true,
				"skip": {
					"v2": "5 errors in empty disjunction:\nconflicting values [1,2] and {...} (mismatched types list and struct):\n    generated.cue:3:1\n    generated.cue:3:61\n    instance.json:1:1\nconflicting values bool and [1,2] (mismatched types bool and list):\n    generated.cue:3:8\n    instance.json:1:1\nconflicting values null and [1,2] (mismatched types null and list):\n    generated.cue:3:1\n    instance.json:1:1\nconflicting values number and [1,2] (mismatched types number and list):\n    generated.cue:3:15\n    instance.json:1:1\nconflicting values string and [1,2] (mismatched types string and list):\n    generated.cue:3:24\n    instance.json:1:1\n",
					"v3": "7 errors in empty disjunction:\nconflicting values [1,2] and bool (mismatched types list and bool):\n    generated.cue:3:8\n    instance.json:1:1\nconflicting values [1,2] and null (mismatched types list and null):\n    generated.cue:3:1\n    instance.json:1:1\nconflicting values [1,2] and number (mismatched types list and number):\n    generated.cue:3:15\n    instance.json:1:1\nconflicting values [1,2] and string (mismatched types list and string):\n    generated.cue:3:24\n    instance.json:1:1\nconflicting values [1,2] and {...} (mismatched types list and struct):\n    generated.cue:3:61\n    instance.json:1:1\nincompatible list lengths (2 and 4):\n    generated.cue:3:33\nexplicit error (_|_ literal) in source:\n    generated.cue:3:54\n"
				}
			},
			{
				"description": "equal number of items present",
				"data": [
					1,
					2,
					3
				],
				"valid": true,
				"skip": {
					"v2": "6 errors in empty disjunction:\nconflicting values [1,2,3] and {...} (mismatched types list and struct):\n    generated.cue:3:1\n    generated.cue:3:61\n    instance.json:1:1\nconflicting values bool and [1,2,3] (mismatched types bool and list):\n    generated.cue:3:8\n    instance.json:1:1\nconflicting values null and [1,2,3] (mismatched types null and list):\n    generated.cue:3:1\n    instance.json:1:1\nconflicting values number and [1,2,3] (mismatched types number and list):\n    generated.cue:3:15\n    instance.json:1:1\nconflicting values string and [1,2,3] (mismatched types string and list):\n    generated.cue:3:24\n    instance.json:1:1\nexplicit error (_|_ literal) in source:\n    generated.cue:3:54\n",
					"v3": "6 errors in empty disjunction:\nconflicting values [1,2,3] and bool (mismatched types list and bool):\n    generated.cue:3:8\n    instance.json:1:1\nconflicting values [1,2,3] and null (mismatched types list and null):\n    generated.cue:3:1\n    instance.json:1:1\nconflicting values [1,2,3] and number (mismatched types list and number):\n    generated.cue:3:15\n    instance.json:1:1\nconflicting values [1,2,3] and string (mismatched types list and string):\n    generated.cue:3:24\n    instance.json:1:1\nconflicting values [1,2,3] and {...} (mismatched types list and struct):\n    generated.cue:3:61\n    instance.json:1:1\nexplicit error (_|_ literal) in source:\n    generated.cue:3:54\n"
				}
			},
			{
				"description": "additional items are not permitted",
				"data": [
					1,
					2,
					3,
					4
				],
				"valid": false
			}
		]
	},
	{
		"description": "items does not look in applicators, valid case",
		"schema": {
			"$schema": "https://json-schema.org/draft/2020-12/schema",
			"allOf": [
				{
					"prefixItems": [
						{
							"minimum": 3
						}
					]
				}
			],
			"items": {
				"minimum": 5
			}
		},
		"tests": [
			{
				"description": "prefixItems in allOf does not constrain items, invalid case",
				"data": [
					3,
					5
				],
				"valid": false
			},
			{
				"description": "prefixItems in allOf does not constrain items, valid case",
				"data": [
					5,
					5
				],
				"valid": true
			}
		]
	},
	{
		"description": "prefixItems validation adjusts the starting index for items",
		"schema": {
			"$schema": "https://json-schema.org/draft/2020-12/schema",
			"prefixItems": [
				{
					"type": "string"
				}
			],
			"items": {
				"type": "integer"
			}
		},
		"tests": [
			{
				"description": "valid items",
				"data": [
					"x",
					2,
					3
				],
				"valid": true,
				"skip": {
					"v2": "6 errors in empty disjunction:\nconflicting values [\"x\",2,3] and {...} (mismatched types list and struct):\n    generated.cue:3:1\n    generated.cue:3:60\n    instance.json:1:1\nconflicting values bool and [\"x\",2,3] (mismatched types bool and list):\n    generated.cue:3:8\n    instance.json:1:1\nconflicting values null and [\"x\",2,3] (mismatched types null and list):\n    generated.cue:3:1\n    instance.json:1:1\nconflicting values number and [\"x\",2,3] (mismatched types number and list):\n    generated.cue:3:15\n    instance.json:1:1\nconflicting values string and [\"x\",2,3] (mismatched types string and list):\n    generated.cue:3:24\n    instance.json:1:1\n0: conflicting values \"x\" and int (mismatched types string and int):\n    generated.cue:3:1\n    generated.cue:3:50\n    generated.cue:3:53\n    instance.json:1:2\n",
					"v3": "6 errors in empty disjunction:\nconflicting values \"x\" and int (mismatched types string and int):\n    generated.cue:3:53\n    instance.json:1:2\nconflicting values [\"x\",2,3] and bool (mismatched types list and bool):\n    generated.cue:3:8\n    instance.json:1:1\nconflicting values [\"x\",2,3] and null (mismatched types list and null):\n    generated.cue:3:1\n    instance.json:1:1\nconflicting values [\"x\",2,3] and number (mismatched types list and number):\n    generated.cue:3:15\n    instance.json:1:1\nconflicting values [\"x\",2,3] and string (mismatched types list and string):\n    generated.cue:3:24\n    instance.json:1:1\nconflicting values [\"x\",2,3] and {...} (mismatched types list and struct):\n    generated.cue:3:60\n    instance.json:1:1\n"
				}
			},
			{
				"description": "wrong type of second item",
				"data": [
					"x",
					"y"
				],
				"valid": false
			}
		]
	},
	{
		"description": "items with heterogeneous array",
		"schema": {
			"$schema": "https://json-schema.org/draft/2020-12/schema",
			"prefixItems": [
				{}
			],
			"items": false
		},
		"tests": [
			{
				"description": "heterogeneous invalid instance",
				"data": [
					"foo",
					"bar",
					37
				],
				"valid": false
			},
			{
				"description": "valid instance",
				"data": [
					null
				],
				"valid": true,
				"skip": {
					"v2": "6 errors in empty disjunction:\nconflicting values [null] and {...} (mismatched types list and struct):\n    generated.cue:3:1\n    generated.cue:3:55\n    instance.json:1:1\nconflicting values bool and [null] (mismatched types bool and list):\n    generated.cue:3:8\n    instance.json:1:1\nconflicting values null and [null] (mismatched types null and list):\n    generated.cue:3:1\n    instance.json:1:1\nconflicting values number and [null] (mismatched types number and list):\n    generated.cue:3:15\n    instance.json:1:1\nconflicting values string and [null] (mismatched types string and list):\n    generated.cue:3:24\n    instance.json:1:1\nexplicit error (_|_ literal) in source:\n    generated.cue:3:48\n",
					"v3": "6 errors in empty disjunction:\nconflicting values [null] and bool (mismatched types list and bool):\n    generated.cue:3:8\n    instance.json:1:1\nconflicting values [null] and null (mismatched types list and null):\n    generated.cue:3:1\n    instance.json:1:1\nconflicting values [null] and number (mismatched types list and number):\n    generated.cue:3:15\n    instance.json:1:1\nconflicting values [null] and string (mismatched types list and string):\n    generated.cue:3:24\n    instance.json:1:1\nconflicting values [null] and {...} (mismatched types list and struct):\n    generated.cue:3:55\n    instance.json:1:1\nexplicit error (_|_ literal) in source:\n    generated.cue:3:48\n"
				}
			}
		]
	},
	{
		"description": "items with null instance elements",
		"schema": {
			"$schema": "https://json-schema.org/draft/2020-12/schema",
			"items": {
				"type": "null"
			}
		},
		"tests": [
			{
				"description": "allows null elements",
				"data": [
					null
				],
				"valid": true
			}
		]
	}
]
