[
	{
		"description": "additionalItems as schema",
		"schema": {
			"$schema": "https://json-schema.org/draft/2019-09/schema",
			"items": [
				{}
			],
			"additionalItems": {
				"type": "integer"
			}
		},
		"skip": {
			"v3-roundtrip": "generation only supported in version https://json-schema.org/draft/2020-12/schema"
		},
		"tests": [
			{
				"description": "additional items match schema",
				"data": [
					null,
					2,
					3,
					4
				],
				"valid": true,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			},
			{
				"description": "additional items do not match schema",
				"data": [
					null,
					2,
					3,
					"foo"
				],
				"valid": false,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			}
		]
	},
	{
		"description": "when items is schema, additionalItems does nothing",
		"schema": {
			"$schema": "https://json-schema.org/draft/2019-09/schema",
			"items": {
				"type": "integer"
			},
			"additionalItems": {
				"type": "string"
			}
		},
		"skip": {
			"v3-roundtrip": "generation only supported in version https://json-schema.org/draft/2020-12/schema"
		},
		"tests": [
			{
				"description": "valid with a array of type integers",
				"data": [
					1,
					2,
					3
				],
				"valid": true,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			},
			{
				"description": "invalid with a array of mixed types",
				"data": [
					1,
					"2",
					"3"
				],
				"valid": false,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			}
		]
	},
	{
		"description": "when items is schema, boolean additionalItems does nothing",
		"schema": {
			"$schema": "https://json-schema.org/draft/2019-09/schema",
			"items": {},
			"additionalItems": false
		},
		"skip": {
			"v3-roundtrip": "generation only supported in version https://json-schema.org/draft/2020-12/schema"
		},
		"tests": [
			{
				"description": "all items match schema",
				"data": [
					1,
					2,
					3,
					4,
					5
				],
				"valid": true,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			}
		]
	},
	{
		"description": "array of items with no additionalItems permitted",
		"schema": {
			"$schema": "https://json-schema.org/draft/2019-09/schema",
			"items": [
				{},
				{},
				{}
			],
			"additionalItems": false
		},
		"skip": {
			"v3-roundtrip": "generation only supported in version https://json-schema.org/draft/2020-12/schema"
		},
		"tests": [
			{
				"description": "empty array",
				"data": [],
				"valid": true,
				"skip": {
					"v3": "6 errors in empty disjunction:\nconflicting values [] and bool (mismatched types list and bool):\n    generated.cue:3:1\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:1\n    generated.cue:3:15\n    instance.json:1:1\nconflicting values [] and string (mismatched types list and string):\n    generated.cue:3:1\n    generated.cue:3:24\n    instance.json:1:1\nconflicting values [] and {...} (mismatched types list and struct):\n    generated.cue:3:1\n    generated.cue:3:45\n    instance.json:1:1\nincompatible list lengths (0 and 3):\n    generated.cue:3:33\n",
					"v3-roundtrip": "could not extract schema"
				}
			},
			{
				"description": "fewer number of items present (1)",
				"data": [
					1
				],
				"valid": true,
				"skip": {
					"v3": "6 errors in empty disjunction:\nconflicting values [1] and bool (mismatched types list and bool):\n    generated.cue:3:1\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:1\n    generated.cue:3:15\n    instance.json:1:1\nconflicting values [1] and string (mismatched types list and string):\n    generated.cue:3:1\n    generated.cue:3:24\n    instance.json:1:1\nconflicting values [1] and {...} (mismatched types list and struct):\n    generated.cue:3:1\n    generated.cue:3:45\n    instance.json:1:1\nincompatible list lengths (1 and 3):\n    generated.cue:3:33\n",
					"v3-roundtrip": "could not extract schema"
				}
			},
			{
				"description": "fewer number of items present (2)",
				"data": [
					1,
					2
				],
				"valid": true,
				"skip": {
					"v3": "6 errors in empty disjunction:\nconflicting values [1,2] and bool (mismatched types list and bool):\n    generated.cue:3:1\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:1\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:1\n    generated.cue:3:24\n    instance.json:1:1\nconflicting values [1,2] and {...} (mismatched types list and struct):\n    generated.cue:3:1\n    generated.cue:3:45\n    instance.json:1:1\nincompatible list lengths (2 and 3):\n    generated.cue:3:33\n",
					"v3-roundtrip": "could not extract schema"
				}
			},
			{
				"description": "equal number of items present",
				"data": [
					1,
					2,
					3
				],
				"valid": true,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			},
			{
				"description": "additional items are not permitted",
				"data": [
					1,
					2,
					3,
					4
				],
				"valid": false,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			}
		]
	},
	{
		"description": "additionalItems as false without items",
		"schema": {
			"$schema": "https://json-schema.org/draft/2019-09/schema",
			"additionalItems": false
		},
		"skip": {
			"v3-roundtrip": "generation only supported in version https://json-schema.org/draft/2020-12/schema"
		},
		"tests": [
			{
				"description": "items defaults to empty schema so everything is valid",
				"data": [
					1,
					2,
					3,
					4,
					5
				],
				"valid": true,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			},
			{
				"description": "ignores non-arrays",
				"data": {
					"foo": "bar"
				},
				"valid": true,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			}
		]
	},
	{
		"description": "additionalItems are allowed by default",
		"schema": {
			"$schema": "https://json-schema.org/draft/2019-09/schema",
			"items": [
				{
					"type": "integer"
				}
			]
		},
		"skip": {
			"v3-roundtrip": "generation only supported in version https://json-schema.org/draft/2020-12/schema"
		},
		"tests": [
			{
				"description": "only the first item is validated",
				"data": [
					1,
					"foo",
					false
				],
				"valid": true,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			}
		]
	},
	{
		"description": "additionalItems does not look in applicators, valid case",
		"schema": {
			"$schema": "https://json-schema.org/draft/2019-09/schema",
			"allOf": [
				{
					"items": [
						{
							"type": "integer"
						}
					]
				}
			],
			"additionalItems": {
				"type": "boolean"
			}
		},
		"skip": {
			"v3-roundtrip": "generation only supported in version https://json-schema.org/draft/2020-12/schema"
		},
		"tests": [
			{
				"description": "items defined in allOf are not examined",
				"data": [
					1,
					null
				],
				"valid": true,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			}
		]
	},
	{
		"description": "additionalItems does not look in applicators, invalid case",
		"schema": {
			"$schema": "https://json-schema.org/draft/2019-09/schema",
			"allOf": [
				{
					"items": [
						{
							"type": "integer"
						},
						{
							"type": "string"
						}
					]
				}
			],
			"items": [
				{
					"type": "integer"
				}
			],
			"additionalItems": {
				"type": "boolean"
			}
		},
		"skip": {
			"v3-roundtrip": "generation only supported in version https://json-schema.org/draft/2020-12/schema"
		},
		"tests": [
			{
				"description": "items defined in allOf are not examined",
				"data": [
					1,
					"hello"
				],
				"valid": false,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			}
		]
	},
	{
		"description": "items validation adjusts the starting index for additionalItems",
		"schema": {
			"$schema": "https://json-schema.org/draft/2019-09/schema",
			"items": [
				{
					"type": "string"
				}
			],
			"additionalItems": {
				"type": "integer"
			}
		},
		"skip": {
			"v3-roundtrip": "generation only supported in version https://json-schema.org/draft/2020-12/schema"
		},
		"tests": [
			{
				"description": "valid items",
				"data": [
					"x",
					2,
					3
				],
				"valid": true,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			},
			{
				"description": "wrong type of second item",
				"data": [
					"x",
					"y"
				],
				"valid": false,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			}
		]
	},
	{
		"description": "additionalItems with heterogeneous array",
		"schema": {
			"$schema": "https://json-schema.org/draft/2019-09/schema",
			"items": [
				{}
			],
			"additionalItems": false
		},
		"skip": {
			"v3-roundtrip": "generation only supported in version https://json-schema.org/draft/2020-12/schema"
		},
		"tests": [
			{
				"description": "heterogeneous invalid instance",
				"data": [
					"foo",
					"bar",
					37
				],
				"valid": false,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			},
			{
				"description": "valid instance",
				"data": [
					null
				],
				"valid": true,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			}
		]
	},
	{
		"description": "additionalItems with null instance elements",
		"schema": {
			"$schema": "https://json-schema.org/draft/2019-09/schema",
			"additionalItems": {
				"type": "null"
			}
		},
		"skip": {
			"v3-roundtrip": "generation only supported in version https://json-schema.org/draft/2020-12/schema"
		},
		"tests": [
			{
				"description": "allows null elements",
				"data": [
					null
				],
				"valid": true,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			}
		]
	}
]
