Skip to content

Commit c98ffc3

Browse files
committed
Remove one wrong testcase and put every $ref in an allOf.
1 parent d4d30f1 commit c98ffc3

File tree

3 files changed

+27
-90
lines changed

3 files changed

+27
-90
lines changed

tests/draft4/ref.json

Lines changed: 9 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,9 @@
300300
{
301301
"description": "Location-independent identifier",
302302
"schema": {
303-
"$ref": "#foo",
303+
"allOf": [{
304+
"$ref": "#foo"
305+
}],
304306
"definitions": {
305307
"A": {
306308
"id": "#foo",
@@ -324,7 +326,9 @@
324326
{
325327
"description": "Canonical location-independent identifier",
326328
"schema": {
327-
"$ref": "http://localhost:1234/bar#foo",
329+
"allOf": [{
330+
"$ref": "http://localhost:1234/bar#foo"
331+
}],
328332
"definitions": {
329333
"A": {
330334
"id": "http://localhost:1234/bar#foo",
@@ -349,7 +353,9 @@
349353
"description": "Location-independent identifier with base URI change in subschema",
350354
"schema": {
351355
"id": "http://localhost:1234/root",
352-
"$ref": "http://localhost:1234/nested.json#foo",
356+
"allOf": [{
357+
"$ref": "http://localhost:1234/nested.json#foo"
358+
}],
353359
"definitions": {
354360
"A": {
355361
"id": "nested.json",
@@ -374,32 +380,5 @@
374380
"valid": false
375381
}
376382
]
377-
},
378-
{
379-
"description": "Location-independent identifiers should take precedent over regular fragments",
380-
"schema": {
381-
"$ref": "#foo",
382-
"definitions": {
383-
"A": {
384-
"id": "#foo",
385-
"type": "integer"
386-
}
387-
},
388-
"foo": {
389-
"type": "string"
390-
}
391-
},
392-
"tests": [
393-
{
394-
"data": 1,
395-
"description": "match",
396-
"valid": true
397-
},
398-
{
399-
"data": "a",
400-
"description": "mismatch",
401-
"valid": false
402-
}
403-
]
404383
}
405384
]

tests/draft6/ref.json

Lines changed: 9 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,9 @@
332332
{
333333
"description": "Location-independent identifier",
334334
"schema": {
335-
"$ref": "#foo",
335+
"allOf": [{
336+
"$ref": "#foo"
337+
}],
336338
"definitions": {
337339
"A": {
338340
"$id": "#foo",
@@ -356,7 +358,9 @@
356358
{
357359
"description": "Canonical location-independent identifier",
358360
"schema": {
359-
"$ref": "http://localhost:1234/bar#foo",
361+
"allOf": [{
362+
"$ref": "http://localhost:1234/bar#foo"
363+
}],
360364
"definitions": {
361365
"A": {
362366
"$id": "http://localhost:1234/bar#foo",
@@ -381,7 +385,9 @@
381385
"description": "Location-independent identifier with base URI change in subschema",
382386
"schema": {
383387
"$id": "http://localhost:1234/root",
384-
"$ref": "http://localhost:1234/nested.json#foo",
388+
"allOf": [{
389+
"$ref": "http://localhost:1234/nested.json#foo"
390+
}],
385391
"definitions": {
386392
"A": {
387393
"$id": "nested.json",
@@ -406,32 +412,5 @@
406412
"valid": false
407413
}
408414
]
409-
},
410-
{
411-
"description": "Location-independent identifiers should take precedent over regular fragments",
412-
"schema": {
413-
"$ref": "#foo",
414-
"definitions": {
415-
"A": {
416-
"$id": "#foo",
417-
"type": "integer"
418-
}
419-
},
420-
"foo": {
421-
"type": "string"
422-
}
423-
},
424-
"tests": [
425-
{
426-
"data": 1,
427-
"description": "match",
428-
"valid": true
429-
},
430-
{
431-
"data": "a",
432-
"description": "mismatch",
433-
"valid": false
434-
}
435-
]
436415
}
437416
]

tests/draft7/ref.json

Lines changed: 9 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,9 @@
332332
{
333333
"description": "Location-independent identifier",
334334
"schema": {
335-
"$ref": "#foo",
335+
"allOf": [{
336+
"$ref": "#foo"
337+
}],
336338
"definitions": {
337339
"A": {
338340
"$id": "#foo",
@@ -356,7 +358,9 @@
356358
{
357359
"description": "Canonical location-independent identifier",
358360
"schema": {
359-
"$ref": "http://localhost:1234/bar#foo",
361+
"allOf": [{
362+
"$ref": "http://localhost:1234/bar#foo"
363+
}],
360364
"definitions": {
361365
"A": {
362366
"$id": "http://localhost:1234/bar#foo",
@@ -381,7 +385,9 @@
381385
"description": "Location-independent identifier with base URI change in subschema",
382386
"schema": {
383387
"$id": "http://localhost:1234/root",
384-
"$ref": "http://localhost:1234/nested.json#foo",
388+
"allOf": [{
389+
"$ref": "http://localhost:1234/nested.json#foo"
390+
}],
385391
"definitions": {
386392
"A": {
387393
"$id": "nested.json",
@@ -406,32 +412,5 @@
406412
"valid": false
407413
}
408414
]
409-
},
410-
{
411-
"description": "Location-independent identifiers should take precedent over regular fragments",
412-
"schema": {
413-
"$ref": "#foo",
414-
"definitions": {
415-
"A": {
416-
"$id": "#foo",
417-
"type": "integer"
418-
}
419-
},
420-
"foo": {
421-
"type": "string"
422-
}
423-
},
424-
"tests": [
425-
{
426-
"data": 1,
427-
"description": "match",
428-
"valid": true
429-
},
430-
{
431-
"data": "a",
432-
"description": "mismatch",
433-
"valid": false
434-
}
435-
]
436415
}
437416
]

0 commit comments

Comments
 (0)