[
	{
		"description": "simple enum validation",
		"schema": {
			"$schema": "https://json-schema.org/draft/2019-09/schema",
			"enum": [
				1,
				2,
				3
			]
		},
		"skip": {
			"v3-roundtrip": "generation only supported in version https://json-schema.org/draft/2020-12/schema"
		},
		"tests": [
			{
				"description": "one of the enum is valid",
				"data": 1,
				"valid": true,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			},
			{
				"description": "something else is invalid",
				"data": 4,
				"valid": false,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			}
		]
	},
	{
		"description": "heterogeneous enum validation",
		"schema": {
			"$schema": "https://json-schema.org/draft/2019-09/schema",
			"enum": [
				6,
				"foo",
				[],
				true,
				{
					"foo": 12
				}
			]
		},
		"skip": {
			"v3-roundtrip": "generation only supported in version https://json-schema.org/draft/2020-12/schema"
		},
		"tests": [
			{
				"description": "one of the enum is valid",
				"data": [],
				"valid": true,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			},
			{
				"description": "something else is invalid",
				"data": null,
				"valid": false,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			},
			{
				"description": "objects are deep compared",
				"data": {
					"foo": false
				},
				"valid": false,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			},
			{
				"description": "valid object matches",
				"data": {
					"foo": 12
				},
				"valid": true,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			},
			{
				"description": "extra properties in object is invalid",
				"data": {
					"foo": 12,
					"boo": 42
				},
				"valid": false,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			}
		]
	},
	{
		"description": "heterogeneous enum-with-null validation",
		"schema": {
			"$schema": "https://json-schema.org/draft/2019-09/schema",
			"enum": [
				6,
				null
			]
		},
		"skip": {
			"v3-roundtrip": "generation only supported in version https://json-schema.org/draft/2020-12/schema"
		},
		"tests": [
			{
				"description": "null is valid",
				"data": null,
				"valid": true,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			},
			{
				"description": "number is valid",
				"data": 6,
				"valid": true,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			},
			{
				"description": "something else is invalid",
				"data": "test",
				"valid": false,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			}
		]
	},
	{
		"description": "enums in properties",
		"schema": {
			"$schema": "https://json-schema.org/draft/2019-09/schema",
			"type": "object",
			"properties": {
				"foo": {
					"enum": [
						"foo"
					]
				},
				"bar": {
					"enum": [
						"bar"
					]
				}
			},
			"required": [
				"bar"
			]
		},
		"skip": {
			"v3-roundtrip": "generation only supported in version https://json-schema.org/draft/2020-12/schema"
		},
		"tests": [
			{
				"description": "both properties are valid",
				"data": {
					"foo": "foo",
					"bar": "bar"
				},
				"valid": true,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			},
			{
				"description": "wrong foo value",
				"data": {
					"foo": "foot",
					"bar": "bar"
				},
				"valid": false,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			},
			{
				"description": "wrong bar value",
				"data": {
					"foo": "foo",
					"bar": "bart"
				},
				"valid": false,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			},
			{
				"description": "missing optional property is valid",
				"data": {
					"bar": "bar"
				},
				"valid": true,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			},
			{
				"description": "missing required property is invalid",
				"data": {
					"foo": "foo"
				},
				"valid": false,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			},
			{
				"description": "missing all properties is invalid",
				"data": {},
				"valid": false,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			}
		]
	},
	{
		"description": "enum with escaped characters",
		"schema": {
			"$schema": "https://json-schema.org/draft/2019-09/schema",
			"enum": [
				"foo\nbar",
				"foo\rbar"
			]
		},
		"skip": {
			"v3-roundtrip": "generation only supported in version https://json-schema.org/draft/2020-12/schema"
		},
		"tests": [
			{
				"description": "member 1 is valid",
				"data": "foo\nbar",
				"valid": true,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			},
			{
				"description": "member 2 is valid",
				"data": "foo\rbar",
				"valid": true,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			},
			{
				"description": "another string is invalid",
				"data": "abc",
				"valid": false,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			}
		]
	},
	{
		"description": "enum with false does not match 0",
		"schema": {
			"$schema": "https://json-schema.org/draft/2019-09/schema",
			"enum": [
				false
			]
		},
		"skip": {
			"v3-roundtrip": "generation only supported in version https://json-schema.org/draft/2020-12/schema"
		},
		"tests": [
			{
				"description": "false is valid",
				"data": false,
				"valid": true,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			},
			{
				"description": "integer zero is invalid",
				"data": 0,
				"valid": false,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			},
			{
				"description": "float zero is invalid",
				"data": 0.0,
				"valid": false,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			}
		]
	},
	{
		"description": "enum with [false] does not match [0]",
		"schema": {
			"$schema": "https://json-schema.org/draft/2019-09/schema",
			"enum": [
				[
					false
				]
			]
		},
		"skip": {
			"v3-roundtrip": "generation only supported in version https://json-schema.org/draft/2020-12/schema"
		},
		"tests": [
			{
				"description": "[false] is valid",
				"data": [
					false
				],
				"valid": true,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			},
			{
				"description": "[0] is invalid",
				"data": [
					0
				],
				"valid": false,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			},
			{
				"description": "[0.0] is invalid",
				"data": [
					0.0
				],
				"valid": false,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			}
		]
	},
	{
		"description": "enum with true does not match 1",
		"schema": {
			"$schema": "https://json-schema.org/draft/2019-09/schema",
			"enum": [
				true
			]
		},
		"skip": {
			"v3-roundtrip": "generation only supported in version https://json-schema.org/draft/2020-12/schema"
		},
		"tests": [
			{
				"description": "true is valid",
				"data": true,
				"valid": true,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			},
			{
				"description": "integer one is invalid",
				"data": 1,
				"valid": false,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			},
			{
				"description": "float one is invalid",
				"data": 1.0,
				"valid": false,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			}
		]
	},
	{
		"description": "enum with [true] does not match [1]",
		"schema": {
			"$schema": "https://json-schema.org/draft/2019-09/schema",
			"enum": [
				[
					true
				]
			]
		},
		"skip": {
			"v3-roundtrip": "generation only supported in version https://json-schema.org/draft/2020-12/schema"
		},
		"tests": [
			{
				"description": "[true] is valid",
				"data": [
					true
				],
				"valid": true,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			},
			{
				"description": "[1] is invalid",
				"data": [
					1
				],
				"valid": false,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			},
			{
				"description": "[1.0] is invalid",
				"data": [
					1.0
				],
				"valid": false,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			}
		]
	},
	{
		"description": "enum with 0 does not match false",
		"schema": {
			"$schema": "https://json-schema.org/draft/2019-09/schema",
			"enum": [
				0
			]
		},
		"skip": {
			"v3-roundtrip": "generation only supported in version https://json-schema.org/draft/2020-12/schema"
		},
		"tests": [
			{
				"description": "false is invalid",
				"data": false,
				"valid": false,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			},
			{
				"description": "integer zero is valid",
				"data": 0,
				"valid": true,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			},
			{
				"description": "float zero is valid",
				"data": 0.0,
				"valid": true,
				"skip": {
					"v3": "conflicting values 0.0 and 0 (mismatched types float and int):\n    generated.cue:3:1\n    instance.json:1:1\n",
					"v3-roundtrip": "could not extract schema"
				}
			}
		]
	},
	{
		"description": "enum with [0] does not match [false]",
		"schema": {
			"$schema": "https://json-schema.org/draft/2019-09/schema",
			"enum": [
				[
					0
				]
			]
		},
		"skip": {
			"v3-roundtrip": "generation only supported in version https://json-schema.org/draft/2020-12/schema"
		},
		"tests": [
			{
				"description": "[false] is invalid",
				"data": [
					false
				],
				"valid": false,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			},
			{
				"description": "[0] is valid",
				"data": [
					0
				],
				"valid": true,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			},
			{
				"description": "[0.0] is valid",
				"data": [
					0.0
				],
				"valid": true,
				"skip": {
					"v3": "0: conflicting values 0.0 and 0 (mismatched types float and int):\n    generated.cue:3:1\n    generated.cue:3:2\n    instance.json:1:2\n",
					"v3-roundtrip": "could not extract schema"
				}
			}
		]
	},
	{
		"description": "enum with 1 does not match true",
		"schema": {
			"$schema": "https://json-schema.org/draft/2019-09/schema",
			"enum": [
				1
			]
		},
		"skip": {
			"v3-roundtrip": "generation only supported in version https://json-schema.org/draft/2020-12/schema"
		},
		"tests": [
			{
				"description": "true is invalid",
				"data": true,
				"valid": false,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			},
			{
				"description": "integer one is valid",
				"data": 1,
				"valid": true,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			},
			{
				"description": "float one is valid",
				"data": 1.0,
				"valid": true,
				"skip": {
					"v3": "conflicting values 1.0 and 1 (mismatched types float and int):\n    generated.cue:3:1\n    instance.json:1:1\n",
					"v3-roundtrip": "could not extract schema"
				}
			}
		]
	},
	{
		"description": "enum with [1] does not match [true]",
		"schema": {
			"$schema": "https://json-schema.org/draft/2019-09/schema",
			"enum": [
				[
					1
				]
			]
		},
		"skip": {
			"v3-roundtrip": "generation only supported in version https://json-schema.org/draft/2020-12/schema"
		},
		"tests": [
			{
				"description": "[true] is invalid",
				"data": [
					true
				],
				"valid": false,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			},
			{
				"description": "[1] is valid",
				"data": [
					1
				],
				"valid": true,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			},
			{
				"description": "[1.0] is valid",
				"data": [
					1.0
				],
				"valid": true,
				"skip": {
					"v3": "0: conflicting values 1.0 and 1 (mismatched types float and int):\n    generated.cue:3:1\n    generated.cue:3:2\n    instance.json:1:2\n",
					"v3-roundtrip": "could not extract schema"
				}
			}
		]
	},
	{
		"description": "nul characters in strings",
		"schema": {
			"$schema": "https://json-schema.org/draft/2019-09/schema",
			"enum": [
				"hello\u0000there"
			]
		},
		"skip": {
			"v3-roundtrip": "generation only supported in version https://json-schema.org/draft/2020-12/schema"
		},
		"tests": [
			{
				"description": "match string with nul",
				"data": "hello\u0000there",
				"valid": true,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			},
			{
				"description": "do not match string lacking nul",
				"data": "hellothere",
				"valid": false,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			}
		]
	}
]
