cuelang.org/go@v0.13.0/encoding/jsonschema/testdata/external/tests/draft4/refRemote.json (about) 1 [ 2 { 3 "description": "remote ref", 4 "schema": { 5 "$ref": "http://localhost:1234/integer.json" 6 }, 7 "skip": { 8 "v2": "extract error: cannot compile resulting schema: invalid import path: \"localhost:1234/integer.json:integer\":\n generated.cue:1:8\n", 9 "v3": "extract error: cannot compile resulting schema: invalid import path: \"localhost:1234/integer.json:integer\":\n generated.cue:1:8\n" 10 }, 11 "tests": [ 12 { 13 "description": "remote ref valid", 14 "data": 1, 15 "valid": true, 16 "skip": { 17 "v2": "could not compile schema", 18 "v3": "could not compile schema" 19 } 20 }, 21 { 22 "description": "remote ref invalid", 23 "data": "a", 24 "valid": false, 25 "skip": { 26 "v2": "could not compile schema", 27 "v3": "could not compile schema" 28 } 29 } 30 ] 31 }, 32 { 33 "description": "fragment within remote ref", 34 "schema": { 35 "$ref": "http://localhost:1234/subSchemas.json#/definitions/integer" 36 }, 37 "skip": { 38 "v2": "extract error: cannot compile resulting schema: invalid import path: \"localhost:1234/subSchemas.json:subSchemas\":\n generated.cue:1:8\n", 39 "v3": "extract error: cannot compile resulting schema: invalid import path: \"localhost:1234/subSchemas.json:subSchemas\":\n generated.cue:1:8\n" 40 }, 41 "tests": [ 42 { 43 "description": "remote fragment valid", 44 "data": 1, 45 "valid": true, 46 "skip": { 47 "v2": "could not compile schema", 48 "v3": "could not compile schema" 49 } 50 }, 51 { 52 "description": "remote fragment invalid", 53 "data": "a", 54 "valid": false, 55 "skip": { 56 "v2": "could not compile schema", 57 "v3": "could not compile schema" 58 } 59 } 60 ] 61 }, 62 { 63 "description": "ref within remote ref", 64 "schema": { 65 "$ref": "http://localhost:1234/subSchemas.json#/definitions/refToInteger" 66 }, 67 "skip": { 68 "v2": "extract error: cannot compile resulting schema: invalid import path: \"localhost:1234/subSchemas.json:subSchemas\":\n generated.cue:1:8\n", 69 "v3": "extract error: cannot compile resulting schema: invalid import path: \"localhost:1234/subSchemas.json:subSchemas\":\n generated.cue:1:8\n" 70 }, 71 "tests": [ 72 { 73 "description": "ref within ref valid", 74 "data": 1, 75 "valid": true, 76 "skip": { 77 "v2": "could not compile schema", 78 "v3": "could not compile schema" 79 } 80 }, 81 { 82 "description": "ref within ref invalid", 83 "data": "a", 84 "valid": false, 85 "skip": { 86 "v2": "could not compile schema", 87 "v3": "could not compile schema" 88 } 89 } 90 ] 91 }, 92 { 93 "description": "base URI change", 94 "schema": { 95 "id": "http://localhost:1234/", 96 "items": { 97 "id": "baseUriChange/", 98 "items": { 99 "$ref": "folderInteger.json" 100 } 101 } 102 }, 103 "skip": { 104 "v2": "extract error: cannot compile resulting schema: invalid import path: \"localhost:1234/baseUriChange/folderInteger.json:folderInteger\":\n generated.cue:1:8\n", 105 "v3": "extract error: cannot compile resulting schema: invalid import path: \"localhost:1234/baseUriChange/folderInteger.json:folderInteger\":\n generated.cue:1:8\n" 106 }, 107 "tests": [ 108 { 109 "description": "base URI change ref valid", 110 "data": [ 111 [ 112 1 113 ] 114 ], 115 "valid": true, 116 "skip": { 117 "v2": "could not compile schema", 118 "v3": "could not compile schema" 119 } 120 }, 121 { 122 "description": "base URI change ref invalid", 123 "data": [ 124 [ 125 "a" 126 ] 127 ], 128 "valid": false, 129 "skip": { 130 "v2": "could not compile schema", 131 "v3": "could not compile schema" 132 } 133 } 134 ] 135 }, 136 { 137 "description": "base URI change - change folder", 138 "schema": { 139 "id": "http://localhost:1234/scope_change_defs1.json", 140 "type": "object", 141 "properties": { 142 "list": { 143 "$ref": "#/definitions/baz" 144 } 145 }, 146 "definitions": { 147 "baz": { 148 "id": "baseUriChangeFolder/", 149 "type": "array", 150 "items": { 151 "$ref": "folderInteger.json" 152 } 153 } 154 } 155 }, 156 "skip": { 157 "v2": "extract error: cannot compile resulting schema: invalid import path: \"localhost:1234/baseUriChangeFolder/folderInteger.json:folderInteger\":\n generated.cue:1:8\n", 158 "v3": "extract error: cannot compile resulting schema: invalid import path: \"localhost:1234/baseUriChangeFolder/folderInteger.json:folderInteger\":\n generated.cue:1:8\n" 159 }, 160 "tests": [ 161 { 162 "description": "number is valid", 163 "data": { 164 "list": [ 165 1 166 ] 167 }, 168 "valid": true, 169 "skip": { 170 "v2": "could not compile schema", 171 "v3": "could not compile schema" 172 } 173 }, 174 { 175 "description": "string is invalid", 176 "data": { 177 "list": [ 178 "a" 179 ] 180 }, 181 "valid": false, 182 "skip": { 183 "v2": "could not compile schema", 184 "v3": "could not compile schema" 185 } 186 } 187 ] 188 }, 189 { 190 "description": "base URI change - change folder in subschema", 191 "schema": { 192 "id": "http://localhost:1234/scope_change_defs2.json", 193 "type": "object", 194 "properties": { 195 "list": { 196 "$ref": "#/definitions/baz/definitions/bar" 197 } 198 }, 199 "definitions": { 200 "baz": { 201 "id": "baseUriChangeFolderInSubschema/", 202 "definitions": { 203 "bar": { 204 "type": "array", 205 "items": { 206 "$ref": "folderInteger.json" 207 } 208 } 209 } 210 } 211 } 212 }, 213 "skip": { 214 "v2": "extract error: cannot compile resulting schema: invalid import path: \"localhost:1234/baseUriChangeFolderInSubschema/folderInteger.json:folderInteger\":\n generated.cue:1:8\n", 215 "v3": "extract error: cannot compile resulting schema: invalid import path: \"localhost:1234/baseUriChangeFolderInSubschema/folderInteger.json:folderInteger\":\n generated.cue:1:8\n" 216 }, 217 "tests": [ 218 { 219 "description": "number is valid", 220 "data": { 221 "list": [ 222 1 223 ] 224 }, 225 "valid": true, 226 "skip": { 227 "v2": "could not compile schema", 228 "v3": "could not compile schema" 229 } 230 }, 231 { 232 "description": "string is invalid", 233 "data": { 234 "list": [ 235 "a" 236 ] 237 }, 238 "valid": false, 239 "skip": { 240 "v2": "could not compile schema", 241 "v3": "could not compile schema" 242 } 243 } 244 ] 245 }, 246 { 247 "description": "root ref in remote ref", 248 "schema": { 249 "id": "http://localhost:1234/object", 250 "type": "object", 251 "properties": { 252 "name": { 253 "$ref": "name.json#/definitions/orNull" 254 } 255 } 256 }, 257 "skip": { 258 "v2": "extract error: cannot compile resulting schema: invalid import path: \"localhost:1234/name.json:name\":\n generated.cue:1:8\n", 259 "v3": "extract error: cannot compile resulting schema: invalid import path: \"localhost:1234/name.json:name\":\n generated.cue:1:8\n" 260 }, 261 "tests": [ 262 { 263 "description": "string is valid", 264 "data": { 265 "name": "foo" 266 }, 267 "valid": true, 268 "skip": { 269 "v2": "could not compile schema", 270 "v3": "could not compile schema" 271 } 272 }, 273 { 274 "description": "null is valid", 275 "data": { 276 "name": null 277 }, 278 "valid": true, 279 "skip": { 280 "v2": "could not compile schema", 281 "v3": "could not compile schema" 282 } 283 }, 284 { 285 "description": "object is invalid", 286 "data": { 287 "name": { 288 "name": null 289 } 290 }, 291 "valid": false, 292 "skip": { 293 "v2": "could not compile schema", 294 "v3": "could not compile schema" 295 } 296 } 297 ] 298 }, 299 { 300 "description": "Location-independent identifier in remote ref", 301 "schema": { 302 "$ref": "http://localhost:1234/locationIndependentIdentifierDraft4.json#/definitions/refToInteger" 303 }, 304 "skip": { 305 "v2": "extract error: cannot compile resulting schema: invalid import path: \"localhost:1234/locationIndependentIdentifierDraft4.json:locationIndependentIdentifierDraft4\":\n generated.cue:1:8\n", 306 "v3": "extract error: cannot compile resulting schema: invalid import path: \"localhost:1234/locationIndependentIdentifierDraft4.json:locationIndependentIdentifierDraft4\":\n generated.cue:1:8\n" 307 }, 308 "tests": [ 309 { 310 "description": "integer is valid", 311 "data": 1, 312 "valid": true, 313 "skip": { 314 "v2": "could not compile schema", 315 "v3": "could not compile schema" 316 } 317 }, 318 { 319 "description": "string is invalid", 320 "data": "foo", 321 "valid": false, 322 "skip": { 323 "v2": "could not compile schema", 324 "v3": "could not compile schema" 325 } 326 } 327 ] 328 } 329 ]