Skip to content

Commit

Permalink
Merge commit '4ecbea58e0828696f7714abba624e2160518fddd'
Browse files Browse the repository at this point in the history
* commit '4ecbea58e0828696f7714abba624e2160518fddd':
  Squashed 'json/' changes from 54440eab4..ba3a90534
  • Loading branch information
Julian committed Oct 19, 2021
2 parents 53864d2 + 4ecbea5 commit d837e97
Show file tree
Hide file tree
Showing 85 changed files with 680 additions and 22 deletions.
11 changes: 11 additions & 0 deletions json/remotes/draft2019-09/metaschema-no-validation.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$id": "http://localhost:1234/draft2019-09/metaschema-no-validation.json",
"$vocabulary": {
"https://json-schema.org/draft/2019-09/vocab/applicator": true,
"https://json-schema.org/draft/2019-09/vocab/core": true
},
"allOf": [
{ "$ref": "https://json-schema.org/draft/2019-09/meta/applicator" },
{ "$ref": "https://json-schema.org/draft/2019-09/meta/core" }
]
}
11 changes: 11 additions & 0 deletions json/remotes/draft2020-12/metaschema-no-validation.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$id": "http://localhost:1234/draft2020-12/metaschema-no-validation.json",
"$vocabulary": {
"https://json-schema.org/draft/2020-12/vocab/applicator": true,
"https://json-schema.org/draft/2020-12/vocab/core": true
},
"allOf": [
{ "$ref": "https://json-schema.org/draft/2020-12/meta/applicator" },
{ "$ref": "https://json-schema.org/draft/2020-12/meta/core" }
]
}
20 changes: 20 additions & 0 deletions json/remotes/extendible-dynamic-ref.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"description": "extendible array",
"$id": "http://localhost:1234/extendible-dynamic-ref.json",
"type": "object",
"properties": {
"elements": {
"type": "array",
"items": {
"$dynamicRef": "#elements"
}
}
},
"required": ["elements"],
"additionalProperties": false,
"$defs": {
"elements": {
"$dynamicAnchor": "elements"
}
}
}
16 changes: 16 additions & 0 deletions json/remotes/tree.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"description": "tree schema, extensible",
"$id": "http://localhost:1234/tree.json",
"$dynamicAnchor": "node",

"type": "object",
"properties": {
"data": true,
"children": {
"type": "array",
"items": {
"$dynamicRef": "#node"
}
}
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -441,5 +441,179 @@
"valid": true
}
]
},
{
"description": "strict-tree schema, guards against misspelled properties",
"schema": {
"$id": "http://localhost:1234/strict-tree.json",
"$dynamicAnchor": "node",

"$ref": "tree.json",
"unevaluatedProperties": false
},
"tests": [
{
"description": "instance with misspelled field",
"data": {
"children": [{
"daat": 1
}]
},
"valid": false
},
{
"description": "instance with correct field",
"data": {
"children": [{
"data": 1
}]
},
"valid": true
}
]
},
{
"description": "tests for implementation dynamic anchor and reference link",
"schema": {
"$id": "http://localhost:1234/strict-extendible.json",
"$ref": "extendible-dynamic-ref.json",
"$defs": {
"elements": {
"$dynamicAnchor": "elements",
"properties": {
"a": true
},
"required": ["a"],
"additionalProperties": false
}
}
},
"tests": [
{
"description": "incorrect parent schema",
"data": {
"a": true
},
"valid": false
},
{
"description": "incorrect extended schema",
"data": {
"elements": [
{ "b": 1 }
]
},
"valid": false
},
{
"description": "correct extended schema",
"data": {
"elements": [
{ "a": 1 }
]
},
"valid": true
}
]
},
{
"description": "Tests for implementation dynamic anchor and reference link. Reference should be independent of any possible ordering.",
"schema": {
"$id": "http://localhost:1234/strict-extendible-allof-defs-first.json",
"allOf": [
{
"$ref": "extendible-dynamic-ref.json"
},
{
"$defs": {
"elements": {
"$dynamicAnchor": "elements",
"properties": {
"a": true
},
"required": ["a"],
"additionalProperties": false
}
}
}
]
},
"tests": [
{
"description": "incorrect parent schema",
"data": {
"a": true
},
"valid": false
},
{
"description": "incorrect extended schema",
"data": {
"elements": [
{ "b": 1 }
]
},
"valid": false
},
{
"description": "correct extended schema",
"data": {
"elements": [
{ "a": 1 }
]
},
"valid": true
}
]
},
{
"description": "Tests for implementation dynamic anchor and reference link. Reference should be independent of any possible ordering.",
"schema": {
"$id": "http://localhost:1234/strict-extendible-allof-ref-first.json",
"allOf": [
{
"$defs": {
"elements": {
"$dynamicAnchor": "elements",
"properties": {
"a": true
},
"required": ["a"],
"additionalProperties": false
}
}
},
{
"$ref": "extendible-dynamic-ref.json"
}
]
},
"tests": [
{
"description": "incorrect parent schema",
"data": {
"a": true
},
"valid": false
},
{
"description": "incorrect extended schema",
"data": {
"elements": [
{ "b": 1 }
]
},
"valid": false
},
{
"description": "correct extended schema",
"data": {
"elements": [
{ "a": 1 }
]
},
"valid": true
}
]
}
]
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{
"description": "Invalid use of fragments in location-independent $id",
"schema": {
"$ref": "https://json-schema.org/draft/future/schema"
"$ref": "https://json-schema.org/draft/next/schema"
},
"tests": [
{
Expand Down Expand Up @@ -110,7 +110,7 @@
"description": "Valid use of empty fragments in location-independent $id",
"comment": "These are allowed but discouraged",
"schema": {
"$ref": "https://json-schema.org/draft/future/schema"
"$ref": "https://json-schema.org/draft/next/schema"
},
"tests": [
{
Expand Down Expand Up @@ -150,7 +150,7 @@
{
"description": "Unnormalized $ids are allowed but discouraged",
"schema": {
"$ref": "https://json-schema.org/draft/future/schema"
"$ref": "https://json-schema.org/draft/next/schema"
},
"tests": [
{
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,38 @@
"valid": true
},
{
"description": "a invalid day in date-time string",
"data": "1990-02-31T15:59:60.123-08:00",
"description": "a valid date-time with a leap second, UTC",
"data": "1998-12-31T23:59:60Z",
"valid": true
},
{
"description": "a valid date-time with a leap second, with minus offset",
"data": "1998-12-31T15:59:60.123-08:00",
"valid": true
},
{
"description": "an invalid date-time past leap second, UTC",
"data": "1998-12-31T23:59:61Z",
"valid": false
},
{
"description": "an invalid date-time with leap second on a wrong minute, UTC",
"data": "1998-12-31T23:58:60Z",
"valid": false
},
{
"description": "an invalid date-time with leap second on a wrong hour, UTC",
"data": "1998-12-31T22:59:60Z",
"valid": false
},
{
"description": "an invalid day in date-time string",
"data": "1990-02-31T15:59:59.123-08:00",
"valid": false
},
{
"description": "an invalid offset in date-time string",
"data": "1990-12-31T15:59:60-24:00",
"data": "1990-12-31T15:59:59-24:00",
"valid": false
},
{
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@
{
"description": "remote ref, containing refs itself",
"schema": {
"$ref": "https://json-schema.org/draft/future/schema"
"$ref": "https://json-schema.org/draft/next/schema"
},
"tests": [
{
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
34 changes: 34 additions & 0 deletions json/tests/draft-next/vocabulary.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[
{
"description": "schema that uses custom metaschema with with no validation vocabulary",
"schema": {
"$id": "https://schema/using/no/validation",
"$schema": "http://localhost:1234/draft2020-12/metaschema-no-validation.json",
"properties": {
"badProperty": false,
"numberProperty": {
"minimum": 10
}
}
},
"tests": [
{
"description": "applicator vocabulary still works",
"data": {
"badProperty": "this property should not exist"
},
"valid": false
},
{
"description": "no validation: valid number",
"data": 20,
"valid": true
},
{
"description": "no validation: invalid number, but it still validates",
"data": 1,
"valid": true
}
]
}
]
31 changes: 28 additions & 3 deletions json/tests/draft2019-09/optional/format/date-time.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,38 @@
"valid": true
},
{
"description": "a invalid day in date-time string",
"data": "1990-02-31T15:59:60.123-08:00",
"description": "a valid date-time with a leap second, UTC",
"data": "1998-12-31T23:59:60Z",
"valid": true
},
{
"description": "a valid date-time with a leap second, with minus offset",
"data": "1998-12-31T15:59:60.123-08:00",
"valid": true
},
{
"description": "an invalid date-time past leap second, UTC",
"data": "1998-12-31T23:59:61Z",
"valid": false
},
{
"description": "an invalid date-time with leap second on a wrong minute, UTC",
"data": "1998-12-31T23:58:60Z",
"valid": false
},
{
"description": "an invalid date-time with leap second on a wrong hour, UTC",
"data": "1998-12-31T22:59:60Z",
"valid": false
},
{
"description": "an invalid day in date-time string",
"data": "1990-02-31T15:59:59.123-08:00",
"valid": false
},
{
"description": "an invalid offset in date-time string",
"data": "1990-12-31T15:59:60-24:00",
"data": "1990-12-31T15:59:59-24:00",
"valid": false
},
{
Expand Down
Loading

0 comments on commit d837e97

Please sign in to comment.