[
	{
		"description": "remote ref",
		"schema": {
			"$ref": "http://localhost:1234/integer.json"
		},
		"skip": {
			"v2": "extract error: cannot compile resulting schema: invalid import path: \"localhost:1234/integer.json:integer\":\n    generated.cue:1:8\n",
			"v3": "extract error: cannot compile resulting schema: invalid import path: \"localhost:1234/integer.json:integer\":\n    generated.cue:1:8\n"
		},
		"tests": [
			{
				"description": "remote ref valid",
				"data": 1,
				"valid": true,
				"skip": {
					"v2": "could not compile schema",
					"v3": "could not compile schema"
				}
			},
			{
				"description": "remote ref invalid",
				"data": "a",
				"valid": false,
				"skip": {
					"v2": "could not compile schema",
					"v3": "could not compile schema"
				}
			}
		]
	},
	{
		"description": "fragment within remote ref",
		"schema": {
			"$ref": "http://localhost:1234/subSchemas.json#/definitions/integer"
		},
		"skip": {
			"v2": "extract error: cannot compile resulting schema: invalid import path: \"localhost:1234/subSchemas.json:subSchemas\":\n    generated.cue:1:8\n",
			"v3": "extract error: cannot compile resulting schema: invalid import path: \"localhost:1234/subSchemas.json:subSchemas\":\n    generated.cue:1:8\n"
		},
		"tests": [
			{
				"description": "remote fragment valid",
				"data": 1,
				"valid": true,
				"skip": {
					"v2": "could not compile schema",
					"v3": "could not compile schema"
				}
			},
			{
				"description": "remote fragment invalid",
				"data": "a",
				"valid": false,
				"skip": {
					"v2": "could not compile schema",
					"v3": "could not compile schema"
				}
			}
		]
	},
	{
		"description": "ref within remote ref",
		"schema": {
			"$ref": "http://localhost:1234/subSchemas.json#/definitions/refToInteger"
		},
		"skip": {
			"v2": "extract error: cannot compile resulting schema: invalid import path: \"localhost:1234/subSchemas.json:subSchemas\":\n    generated.cue:1:8\n",
			"v3": "extract error: cannot compile resulting schema: invalid import path: \"localhost:1234/subSchemas.json:subSchemas\":\n    generated.cue:1:8\n"
		},
		"tests": [
			{
				"description": "ref within ref valid",
				"data": 1,
				"valid": true,
				"skip": {
					"v2": "could not compile schema",
					"v3": "could not compile schema"
				}
			},
			{
				"description": "ref within ref invalid",
				"data": "a",
				"valid": false,
				"skip": {
					"v2": "could not compile schema",
					"v3": "could not compile schema"
				}
			}
		]
	},
	{
		"description": "base URI change",
		"schema": {
			"$id": "http://localhost:1234/",
			"items": {
				"$id": "baseUriChange/",
				"items": {
					"$ref": "folderInteger.json"
				}
			}
		},
		"skip": {
			"v2": "extract error: cannot compile resulting schema: invalid import path: \"localhost:1234/baseUriChange/folderInteger.json:folderInteger\":\n    generated.cue:1:8\n",
			"v3": "extract error: cannot compile resulting schema: invalid import path: \"localhost:1234/baseUriChange/folderInteger.json:folderInteger\":\n    generated.cue:1:8\n"
		},
		"tests": [
			{
				"description": "base URI change ref valid",
				"data": [
					[
						1
					]
				],
				"valid": true,
				"skip": {
					"v2": "could not compile schema",
					"v3": "could not compile schema"
				}
			},
			{
				"description": "base URI change ref invalid",
				"data": [
					[
						"a"
					]
				],
				"valid": false,
				"skip": {
					"v2": "could not compile schema",
					"v3": "could not compile schema"
				}
			}
		]
	},
	{
		"description": "base URI change - change folder",
		"schema": {
			"$id": "http://localhost:1234/scope_change_defs1.json",
			"type": "object",
			"properties": {
				"list": {
					"$ref": "#/definitions/baz"
				}
			},
			"definitions": {
				"baz": {
					"$id": "baseUriChangeFolder/",
					"type": "array",
					"items": {
						"$ref": "folderInteger.json"
					}
				}
			}
		},
		"skip": {
			"v2": "extract error: cannot compile resulting schema: invalid import path: \"localhost:1234/baseUriChangeFolder/folderInteger.json:folderInteger\":\n    generated.cue:1:8\n",
			"v3": "extract error: cannot compile resulting schema: invalid import path: \"localhost:1234/baseUriChangeFolder/folderInteger.json:folderInteger\":\n    generated.cue:1:8\n"
		},
		"tests": [
			{
				"description": "number is valid",
				"data": {
					"list": [
						1
					]
				},
				"valid": true,
				"skip": {
					"v2": "could not compile schema",
					"v3": "could not compile schema"
				}
			},
			{
				"description": "string is invalid",
				"data": {
					"list": [
						"a"
					]
				},
				"valid": false,
				"skip": {
					"v2": "could not compile schema",
					"v3": "could not compile schema"
				}
			}
		]
	},
	{
		"description": "base URI change - change folder in subschema",
		"schema": {
			"$id": "http://localhost:1234/scope_change_defs2.json",
			"type": "object",
			"properties": {
				"list": {
					"$ref": "#/definitions/baz/definitions/bar"
				}
			},
			"definitions": {
				"baz": {
					"$id": "baseUriChangeFolderInSubschema/",
					"definitions": {
						"bar": {
							"type": "array",
							"items": {
								"$ref": "folderInteger.json"
							}
						}
					}
				}
			}
		},
		"skip": {
			"v2": "extract error: cannot compile resulting schema: invalid import path: \"localhost:1234/baseUriChangeFolderInSubschema/folderInteger.json:folderInteger\":\n    generated.cue:1:8\n",
			"v3": "extract error: cannot compile resulting schema: invalid import path: \"localhost:1234/baseUriChangeFolderInSubschema/folderInteger.json:folderInteger\":\n    generated.cue:1:8\n"
		},
		"tests": [
			{
				"description": "number is valid",
				"data": {
					"list": [
						1
					]
				},
				"valid": true,
				"skip": {
					"v2": "could not compile schema",
					"v3": "could not compile schema"
				}
			},
			{
				"description": "string is invalid",
				"data": {
					"list": [
						"a"
					]
				},
				"valid": false,
				"skip": {
					"v2": "could not compile schema",
					"v3": "could not compile schema"
				}
			}
		]
	},
	{
		"description": "root ref in remote ref",
		"schema": {
			"$id": "http://localhost:1234/object",
			"type": "object",
			"properties": {
				"name": {
					"$ref": "name.json#/definitions/orNull"
				}
			}
		},
		"skip": {
			"v2": "extract error: cannot compile resulting schema: invalid import path: \"localhost:1234/name.json:name\":\n    generated.cue:1:8\n",
			"v3": "extract error: cannot compile resulting schema: invalid import path: \"localhost:1234/name.json:name\":\n    generated.cue:1:8\n"
		},
		"tests": [
			{
				"description": "string is valid",
				"data": {
					"name": "foo"
				},
				"valid": true,
				"skip": {
					"v2": "could not compile schema",
					"v3": "could not compile schema"
				}
			},
			{
				"description": "null is valid",
				"data": {
					"name": null
				},
				"valid": true,
				"skip": {
					"v2": "could not compile schema",
					"v3": "could not compile schema"
				}
			},
			{
				"description": "object is invalid",
				"data": {
					"name": {
						"name": null
					}
				},
				"valid": false,
				"skip": {
					"v2": "could not compile schema",
					"v3": "could not compile schema"
				}
			}
		]
	},
	{
		"description": "remote ref with ref to definitions",
		"schema": {
			"$id": "http://localhost:1234/schema-remote-ref-ref-defs1.json",
			"allOf": [
				{
					"$ref": "ref-and-definitions.json"
				}
			]
		},
		"skip": {
			"v2": "extract error: cannot compile resulting schema: invalid import path: \"localhost:1234/ref-and-definitions.json:schema\":\n    generated.cue:1:8\n",
			"v3": "extract error: cannot compile resulting schema: invalid import path: \"localhost:1234/ref-and-definitions.json:schema\":\n    generated.cue:1:8\n"
		},
		"tests": [
			{
				"description": "invalid",
				"data": {
					"bar": 1
				},
				"valid": false,
				"skip": {
					"v2": "could not compile schema",
					"v3": "could not compile schema"
				}
			},
			{
				"description": "valid",
				"data": {
					"bar": "a"
				},
				"valid": true,
				"skip": {
					"v2": "could not compile schema",
					"v3": "could not compile schema"
				}
			}
		]
	},
	{
		"description": "Location-independent identifier in remote ref",
		"schema": {
			"$ref": "http://localhost:1234/locationIndependentIdentifierPre2019.json#/definitions/refToInteger"
		},
		"skip": {
			"v2": "extract error: cannot compile resulting schema: invalid import path: \"localhost:1234/locationIndependentIdentifierPre2019.json:locationIndependentIdentifierPre2019\":\n    generated.cue:1:8\n",
			"v3": "extract error: cannot compile resulting schema: invalid import path: \"localhost:1234/locationIndependentIdentifierPre2019.json:locationIndependentIdentifierPre2019\":\n    generated.cue:1:8\n"
		},
		"tests": [
			{
				"description": "integer is valid",
				"data": 1,
				"valid": true,
				"skip": {
					"v2": "could not compile schema",
					"v3": "could not compile schema"
				}
			},
			{
				"description": "string is invalid",
				"data": "foo",
				"valid": false,
				"skip": {
					"v2": "could not compile schema",
					"v3": "could not compile schema"
				}
			}
		]
	},
	{
		"description": "retrieved nested refs resolve relative to their URI not $id",
		"schema": {
			"$id": "http://localhost:1234/some-id",
			"properties": {
				"name": {
					"$ref": "nested/foo-ref-string.json"
				}
			}
		},
		"skip": {
			"v2": "extract error: cannot compile resulting schema: invalid import path: \"localhost:1234/nested/foo-ref-string.json:schema\":\n    generated.cue:1:8\n",
			"v3": "extract error: cannot compile resulting schema: invalid import path: \"localhost:1234/nested/foo-ref-string.json:schema\":\n    generated.cue:1:8\n"
		},
		"tests": [
			{
				"description": "number is invalid",
				"data": {
					"name": {
						"foo": 1
					}
				},
				"valid": false,
				"skip": {
					"v2": "could not compile schema",
					"v3": "could not compile schema"
				}
			},
			{
				"description": "string is valid",
				"data": {
					"name": {
						"foo": "a"
					}
				},
				"valid": true,
				"skip": {
					"v2": "could not compile schema",
					"v3": "could not compile schema"
				}
			}
		]
	},
	{
		"description": "$ref to $ref finds location-independent $id",
		"schema": {
			"$ref": "http://localhost:1234/draft7/detached-ref.json#/definitions/foo"
		},
		"skip": {
			"v2": "extract error: cannot compile resulting schema: invalid import path: \"localhost:1234/draft7/detached-ref.json:schema\":\n    generated.cue:1:8\n",
			"v3": "extract error: cannot compile resulting schema: invalid import path: \"localhost:1234/draft7/detached-ref.json:schema\":\n    generated.cue:1:8\n"
		},
		"tests": [
			{
				"description": "number is valid",
				"data": 1,
				"valid": true,
				"skip": {
					"v2": "could not compile schema",
					"v3": "could not compile schema"
				}
			},
			{
				"description": "non-number is invalid",
				"data": "a",
				"valid": false,
				"skip": {
					"v2": "could not compile schema",
					"v3": "could not compile schema"
				}
			}
		]
	}
]
