| •1 |
[ |
| 2 |
{ |
| 3 |
"description": "remote ref", |
| 4 |
"schema": {"$ref": "http://localhost:1234/integer.json"}, |
| 5 |
"tests": [ |
| 6 |
{ |
| 7 |
"description": "remote ref valid", |
| 8 |
"data": 1, |
| 9 |
"valid": true |
| 10 |
}, |
| 11 |
{ |
| 12 |
"description": "remote ref invalid", |
| 13 |
"data": "a", |
| 14 |
"valid": false |
| 15 |
} |
| 16 |
] |
| 17 |
}, |
| 18 |
{ |
| 19 |
"description": "fragment within remote ref", |
| 20 |
"schema": {"$ref": "http://localhost:1234/subSchemas-defs.json#/$defs/integer"}, |
| 21 |
"tests": [ |
| 22 |
{ |
| 23 |
"description": "remote fragment valid", |
| 24 |
"data": 1, |
| 25 |
"valid": true |
| 26 |
}, |
| 27 |
{ |
| 28 |
"description": "remote fragment invalid", |
| 29 |
"data": "a", |
| 30 |
"valid": false |
| 31 |
} |
| 32 |
] |
| 33 |
}, |
| 34 |
{ |
| 35 |
"description": "ref within remote ref", |
| 36 |
"schema": { |
| 37 |
"$ref": "http://localhost:1234/subSchemas-defs.json#/$defs/refToInteger" |
| 38 |
}, |
| 39 |
"tests": [ |
| 40 |
{ |
| 41 |
"description": "ref within ref valid", |
| 42 |
"data": 1, |
| 43 |
"valid": true |
| 44 |
}, |
| 45 |
{ |
| 46 |
"description": "ref within ref invalid", |
| 47 |
"data": "a", |
| 48 |
"valid": false |
| 49 |
} |
| 50 |
] |
| 51 |
}, |
| 52 |
{ |
| 53 |
"description": "base URI change", |
| 54 |
"schema": { |
| 55 |
"$id": "http://localhost:1234/", |
| 56 |
"items": { |
| 57 |
"$id": "baseUriChange/", |
| 58 |
"items": {"$ref": "folderInteger.json"} |
| 59 |
} |
| 60 |
}, |
| 61 |
"tests": [ |
| 62 |
{ |
| 63 |
"description": "base URI change ref valid", |
| 64 |
"data": [[1]], |
| 65 |
"valid": true |
| 66 |
}, |
| 67 |
{ |
| 68 |
"description": "base URI change ref invalid", |
| 69 |
"data": [["a"]], |
| 70 |
"valid": false |
| 71 |
} |
| 72 |
] |
| 73 |
}, |
| 74 |
{ |
| 75 |
"description": "base URI change - change folder", |
| 76 |
"schema": { |
| 77 |
"$id": "http://localhost:1234/scope_change_defs1.json", |
| 78 |
"type" : "object", |
| 79 |
"properties": {"list": {"$ref": "baseUriChangeFolder/"}}, |
| 80 |
"$defs": { |
| 81 |
"baz": { |
| 82 |
"$id": "baseUriChangeFolder/", |
| 83 |
"type": "array", |
| 84 |
"items": {"$ref": "folderInteger.json"} |
| 85 |
} |
| 86 |
} |
| 87 |
}, |
| 88 |
"tests": [ |
| 89 |
{ |
| 90 |
"description": "number is valid", |
| 91 |
"data": {"list": [1]}, |
| 92 |
"valid": true |
| 93 |
}, |
| 94 |
{ |
| 95 |
"description": "string is invalid", |
| 96 |
"data": {"list": ["a"]}, |
| 97 |
"valid": false |
| 98 |
} |
| 99 |
] |
| 100 |
}, |
| 101 |
{ |
| 102 |
"description": "base URI change - change folder in subschema", |
| 103 |
"schema": { |
| 104 |
"$id": "http://localhost:1234/scope_change_defs2.json", |
| 105 |
"type" : "object", |
| 106 |
"properties": {"list": {"$ref": "baseUriChangeFolderInSubschema/#/$defs/bar"}}, |
| 107 |
"$defs": { |
| 108 |
"baz": { |
| 109 |
"$id": "baseUriChangeFolderInSubschema/", |
| 110 |
"$defs": { |
| 111 |
"bar": { |
| 112 |
"type": "array", |
| 113 |
"items": {"$ref": "folderInteger.json"} |
| 114 |
} |
| 115 |
} |
| 116 |
} |
| 117 |
} |
| 118 |
}, |
| 119 |
"tests": [ |
| 120 |
{ |
| 121 |
"description": "number is valid", |
| 122 |
"data": {"list": [1]}, |
| 123 |
"valid": true |
| 124 |
}, |
| 125 |
{ |
| 126 |
"description": "string is invalid", |
| 127 |
"data": {"list": ["a"]}, |
| 128 |
"valid": false |
| 129 |
} |
| 130 |
] |
| 131 |
}, |
| 132 |
{ |
| 133 |
"description": "root ref in remote ref", |
| 134 |
"schema": { |
| 135 |
"$id": "http://localhost:1234/object", |
| 136 |
"type": "object", |
| 137 |
"properties": { |
| 138 |
"name": {"$ref": "name-defs.json#/$defs/orNull"} |
| 139 |
} |
| 140 |
}, |
| 141 |
"tests": [ |
| 142 |
{ |
| 143 |
"description": "string is valid", |
| 144 |
"data": { |
| 145 |
"name": "foo" |
| 146 |
}, |
| 147 |
"valid": true |
| 148 |
}, |
| 149 |
{ |
| 150 |
"description": "null is valid", |
| 151 |
"data": { |
| 152 |
"name": null |
| 153 |
}, |
| 154 |
"valid": true |
| 155 |
}, |
| 156 |
{ |
| 157 |
"description": "object is invalid", |
| 158 |
"data": { |
| 159 |
"name": { |
| 160 |
"name": null |
| 161 |
} |
| 162 |
}, |
| 163 |
"valid": false |
| 164 |
} |
| 165 |
] |
| 166 |
}, |
| 167 |
{ |
| 168 |
"description": "remote ref with ref to defs", |
| 169 |
"schema": { |
| 170 |
"$id": "http://localhost:1234/schema-remote-ref-ref-defs1.json", |
| 171 |
"$ref": "ref-and-defs.json" |
| 172 |
}, |
| 173 |
"tests": [ |
| 174 |
{ |
| 175 |
"description": "invalid", |
| 176 |
"data": { |
| 177 |
"bar": 1 |
| 178 |
}, |
| 179 |
"valid": false |
| 180 |
}, |
| 181 |
{ |
| 182 |
"description": "valid", |
| 183 |
"data": { |
| 184 |
"bar": "a" |
| 185 |
}, |
| 186 |
"valid": true |
| 187 |
} |
| 188 |
] |
| 189 |
} |
| 190 |
] |