[
	{
		"description": "ignore if without then or else",
		"schema": {
			"$schema": "https://json-schema.org/draft/2019-09/schema",
			"if": {
				"const": 0
			}
		},
		"skip": {
			"v3-roundtrip": "generation only supported in version https://json-schema.org/draft/2020-12/schema"
		},
		"tests": [
			{
				"description": "valid when valid against lone if",
				"data": 0,
				"valid": true,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			},
			{
				"description": "valid when invalid against lone if",
				"data": "hello",
				"valid": true,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			}
		]
	},
	{
		"description": "ignore then without if",
		"schema": {
			"$schema": "https://json-schema.org/draft/2019-09/schema",
			"then": {
				"const": 0
			}
		},
		"skip": {
			"v3-roundtrip": "generation only supported in version https://json-schema.org/draft/2020-12/schema"
		},
		"tests": [
			{
				"description": "valid when valid against lone then",
				"data": 0,
				"valid": true,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			},
			{
				"description": "valid when invalid against lone then",
				"data": "hello",
				"valid": true,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			}
		]
	},
	{
		"description": "ignore else without if",
		"schema": {
			"$schema": "https://json-schema.org/draft/2019-09/schema",
			"else": {
				"const": 0
			}
		},
		"skip": {
			"v3-roundtrip": "generation only supported in version https://json-schema.org/draft/2020-12/schema"
		},
		"tests": [
			{
				"description": "valid when valid against lone else",
				"data": 0,
				"valid": true,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			},
			{
				"description": "valid when invalid against lone else",
				"data": "hello",
				"valid": true,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			}
		]
	},
	{
		"description": "if and then without else",
		"schema": {
			"$schema": "https://json-schema.org/draft/2019-09/schema",
			"if": {
				"exclusiveMaximum": 0
			},
			"then": {
				"minimum": -10
			}
		},
		"skip": {
			"v3-roundtrip": "generation only supported in version https://json-schema.org/draft/2020-12/schema"
		},
		"tests": [
			{
				"description": "valid through then",
				"data": -1,
				"valid": true,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			},
			{
				"description": "invalid through then",
				"data": -100,
				"valid": false,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			},
			{
				"description": "valid when if test fails",
				"data": 3,
				"valid": true,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			}
		]
	},
	{
		"description": "if and else without then",
		"schema": {
			"$schema": "https://json-schema.org/draft/2019-09/schema",
			"if": {
				"exclusiveMaximum": 0
			},
			"else": {
				"multipleOf": 2
			}
		},
		"skip": {
			"v3-roundtrip": "generation only supported in version https://json-schema.org/draft/2020-12/schema"
		},
		"tests": [
			{
				"description": "valid when if test passes",
				"data": -1,
				"valid": true,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			},
			{
				"description": "valid through else",
				"data": 4,
				"valid": true,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			},
			{
				"description": "invalid through else",
				"data": 3,
				"valid": false,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			}
		]
	},
	{
		"description": "validate against correct branch, then vs else",
		"schema": {
			"$schema": "https://json-schema.org/draft/2019-09/schema",
			"if": {
				"exclusiveMaximum": 0
			},
			"then": {
				"minimum": -10
			},
			"else": {
				"multipleOf": 2
			}
		},
		"skip": {
			"v3-roundtrip": "generation only supported in version https://json-schema.org/draft/2020-12/schema"
		},
		"tests": [
			{
				"description": "valid through then",
				"data": -1,
				"valid": true,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			},
			{
				"description": "invalid through then",
				"data": -100,
				"valid": false,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			},
			{
				"description": "valid through else",
				"data": 4,
				"valid": true,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			},
			{
				"description": "invalid through else",
				"data": 3,
				"valid": false,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			}
		]
	},
	{
		"description": "non-interference across combined schemas",
		"schema": {
			"$schema": "https://json-schema.org/draft/2019-09/schema",
			"allOf": [
				{
					"if": {
						"exclusiveMaximum": 0
					}
				},
				{
					"then": {
						"minimum": -10
					}
				},
				{
					"else": {
						"multipleOf": 2
					}
				}
			]
		},
		"skip": {
			"v3-roundtrip": "generation only supported in version https://json-schema.org/draft/2020-12/schema"
		},
		"tests": [
			{
				"description": "valid, but would have been invalid through then",
				"data": -100,
				"valid": true,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			},
			{
				"description": "valid, but would have been invalid through else",
				"data": 3,
				"valid": true,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			}
		]
	},
	{
		"description": "if with boolean schema true",
		"schema": {
			"$schema": "https://json-schema.org/draft/2019-09/schema",
			"if": true,
			"then": {
				"const": "then"
			},
			"else": {
				"const": "else"
			}
		},
		"skip": {
			"v3-roundtrip": "generation only supported in version https://json-schema.org/draft/2020-12/schema"
		},
		"tests": [
			{
				"description": "boolean schema true in if always chooses the then path (valid)",
				"data": "then",
				"valid": true,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			},
			{
				"description": "boolean schema true in if always chooses the then path (invalid)",
				"data": "else",
				"valid": false,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			}
		]
	},
	{
		"description": "if with boolean schema false",
		"schema": {
			"$schema": "https://json-schema.org/draft/2019-09/schema",
			"if": false,
			"then": {
				"const": "then"
			},
			"else": {
				"const": "else"
			}
		},
		"skip": {
			"v3": "extract error: cannot compile resulting schema: disallowed:\n    generated.cue:3:9\n",
			"v3-roundtrip": "inital extract failed"
		},
		"tests": [
			{
				"description": "boolean schema false in if always chooses the else path (invalid)",
				"data": "then",
				"valid": false,
				"skip": {
					"v3": "could not extract schema",
					"v3-roundtrip": "could not extract schema"
				}
			},
			{
				"description": "boolean schema false in if always chooses the else path (valid)",
				"data": "else",
				"valid": true,
				"skip": {
					"v3": "could not extract schema",
					"v3-roundtrip": "could not extract schema"
				}
			}
		]
	},
	{
		"description": "if appears at the end when serialized (keyword processing sequence)",
		"schema": {
			"$schema": "https://json-schema.org/draft/2019-09/schema",
			"then": {
				"const": "yes"
			},
			"else": {
				"const": "other"
			},
			"if": {
				"maxLength": 4
			}
		},
		"skip": {
			"v3-roundtrip": "generation only supported in version https://json-schema.org/draft/2020-12/schema"
		},
		"tests": [
			{
				"description": "yes redirects to then and passes",
				"data": "yes",
				"valid": true,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			},
			{
				"description": "other redirects to else and passes",
				"data": "other",
				"valid": true,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			},
			{
				"description": "no redirects to then and fails",
				"data": "no",
				"valid": false,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			},
			{
				"description": "invalid redirects to else and fails",
				"data": "invalid",
				"valid": false,
				"skip": {
					"v3-roundtrip": "could not extract schema"
				}
			}
		]
	}
]
