Skip to content

Commit acf7a6b

Browse files
committed
Squashed 'json/' changes from 6afa9b38d..b069ac352
b069ac352 Add tests for non-relative URI anchor referencing 7950d9e05 Merge pull request #674 from jmigual/feature/alah e6a089ae9 Changed description about `main` branch b3c074773 Add comment about live at head philosophy ab4bd012f Merge pull request #671 from marksparkza/schemaloc-fragment e7aba0972 Include fragment in schemaLocation git-subtree-dir: json git-subtree-split: b069ac352c3dc1fae71f6f177dafe97001c97920
1 parent b695cd7 commit acf7a6b

File tree

6 files changed

+59
-3
lines changed

6 files changed

+59
-3
lines changed

README.md

+2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ This repository contains a set of JSON objects that implementers of JSON Schema
1212
It is meant to be language agnostic and should require only a JSON parser.
1313
The conversion of the JSON objects into tests within a specific language and test framework of choice is left to be done by the validator implementer.
1414

15+
The recommended workflow of this test suite is to clone the `main` branch of this repository as a `git submodule` or `git subtree`. The `main` branch is always stable.
16+
1517
## Coverage
1618

1719
All JSON Schema specification releases should be well covered by this suite, including drafts 2020-12, 2019-09, 07, 06, 04 and 03.

output-tests/draft-next/content/general.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"contains": {
2121
"properties": {
2222
"evaluationPath": {"const": ""},
23-
"schemaLocation": {"const": "https://json-schema.org/tests/content/draft-next/general/0"},
23+
"schemaLocation": {"const": "https://json-schema.org/tests/content/draft-next/general/0#"},
2424
"instanceLocation": {"const": ""},
2525
"annotations": false,
2626
"droppedAnnotations": {

output-tests/draft-next/content/readOnly.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"contains": {
2020
"properties": {
2121
"evaluationPath": {"const": ""},
22-
"schemaLocation": {"const": "https://json-schema.org/tests/content/draft-next/readOnly/0"},
22+
"schemaLocation": {"const": "https://json-schema.org/tests/content/draft-next/readOnly/0#"},
2323
"instanceLocation": {"const": ""},
2424
"annotations": {
2525
"properties": {

output-tests/draft-next/content/type.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"contains": {
2020
"properties": {
2121
"evaluationPath": {"const": ""},
22-
"schemaLocation": {"const": "https://json-schema.org/tests/content/draft-next/type/0"},
22+
"schemaLocation": {"const": "https://json-schema.org/tests/content/draft-next/type/0#"},
2323
"instanceLocation": {"const": ""},
2424
"annotations": false,
2525
"errors": {

tests/draft6/ref.json

+27
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,33 @@
445445
}
446446
]
447447
},
448+
{
449+
"description": "Reference an anchor with a non-relative URI",
450+
"schema": {
451+
"$id": "https://example.com/schema-with-anchor",
452+
"allOf": [{
453+
"$ref": "https://example.com/schema-with-anchor#foo"
454+
}],
455+
"definitions": {
456+
"A": {
457+
"$id": "#foo",
458+
"type": "integer"
459+
}
460+
}
461+
},
462+
"tests": [
463+
{
464+
"data": 1,
465+
"description": "match",
466+
"valid": true
467+
},
468+
{
469+
"data": "a",
470+
"description": "mismatch",
471+
"valid": false
472+
}
473+
]
474+
},
448475
{
449476
"description": "Location-independent identifier with base URI change in subschema",
450477
"schema": {

tests/draft7/ref.json

+27
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,33 @@
445445
}
446446
]
447447
},
448+
{
449+
"description": "Reference an anchor with a non-relative URI",
450+
"schema": {
451+
"$id": "https://example.com/schema-with-anchor",
452+
"allOf": [{
453+
"$ref": "https://example.com/schema-with-anchor#foo"
454+
}],
455+
"definitions": {
456+
"A": {
457+
"$id": "#foo",
458+
"type": "integer"
459+
}
460+
}
461+
},
462+
"tests": [
463+
{
464+
"data": 1,
465+
"description": "match",
466+
"valid": true
467+
},
468+
{
469+
"data": "a",
470+
"description": "mismatch",
471+
"valid": false
472+
}
473+
]
474+
},
448475
{
449476
"description": "Location-independent identifier with base URI change in subschema",
450477
"schema": {

0 commit comments

Comments
 (0)