Skip to content

Commit 1a4ea00

Browse files
committed
Squashed 'json/' changes from fce9e9b3..21555a85
21555a85 Merge pull request #431 from ChALkeR/chalker/enum 87550ad6 Merge pull request #433 from notEthan/escaped_ref_in_def 57e31b49 refactor tests of escaped pointer refs to put ref'd schemas in definitions a21e4258 Add tests for objects in enum 8a129948 Remove invalid format:regex test; the spec doesn't mandate parsing correctness git-subtree-dir: json git-subtree-split: 21555a8540584447a9f8ea659accd0ce79bd36e5
1 parent b3ebd20 commit 1a4ea00

File tree

12 files changed

+72
-68
lines changed

12 files changed

+72
-68
lines changed

tests/draft2019-09/enum.json

+10
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,16 @@
3333
"description": "objects are deep compared",
3434
"data": {"foo": false},
3535
"valid": false
36+
},
37+
{
38+
"description": "valid object matches",
39+
"data": {"foo": 12},
40+
"valid": true
41+
},
42+
{
43+
"description": "extra properties in object is invalid",
44+
"data": {"foo": 12, "boo": 42},
45+
"valid": false
3646
}
3747
]
3848
},

tests/draft2019-09/optional/ecmascript-regex.json

-11
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,4 @@
11
[
2-
{
3-
"description": "ECMA 262 regex non-compliance",
4-
"schema": { "format": "regex" },
5-
"tests": [
6-
{
7-
"description": "ECMA 262 has no support for \\Z anchor from .NET",
8-
"data": "^\\S(|(.|\\n)*\\S)\\Z",
9-
"valid": false
10-
}
11-
]
12-
},
132
{
143
"description": "ECMA 262 regex $ does not match trailing newline",
154
"schema": {

tests/draft3/ref.json

+8-6
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,15 @@
7575
{
7676
"description": "escaped pointer ref",
7777
"schema": {
78-
"tilde~field": {"type": "integer"},
79-
"slash/field": {"type": "integer"},
80-
"percent%field": {"type": "integer"},
78+
"definitions": {
79+
"tilde~field": {"type": "integer"},
80+
"slash/field": {"type": "integer"},
81+
"percent%field": {"type": "integer"}
82+
},
8183
"properties": {
82-
"tilde": {"$ref": "#/tilde~0field"},
83-
"slash": {"$ref": "#/slash~1field"},
84-
"percent": {"$ref": "#/percent%25field"}
84+
"tilde": {"$ref": "#/definitions/tilde~0field"},
85+
"slash": {"$ref": "#/definitions/slash~1field"},
86+
"percent": {"$ref": "#/definitions/percent%25field"}
8587
}
8688
},
8789
"tests": [

tests/draft4/enum.json

+10
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,16 @@
3333
"description": "objects are deep compared",
3434
"data": {"foo": false},
3535
"valid": false
36+
},
37+
{
38+
"description": "valid object matches",
39+
"data": {"foo": 12},
40+
"valid": true
41+
},
42+
{
43+
"description": "extra properties in object is invalid",
44+
"data": {"foo": 12, "boo": 42},
45+
"valid": false
3646
}
3747
]
3848
},

tests/draft4/optional/ecmascript-regex.json

-11
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,4 @@
11
[
2-
{
3-
"description": "ECMA 262 regex non-compliance",
4-
"schema": { "format": "regex" },
5-
"tests": [
6-
{
7-
"description": "ECMA 262 has no support for \\Z anchor from .NET",
8-
"data": "^\\S(|(.|\\n)*\\S)\\Z",
9-
"valid": false
10-
}
11-
]
12-
},
132
{
143
"description": "ECMA 262 regex $ does not match trailing newline",
154
"schema": {

tests/draft4/ref.json

+8-6
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,15 @@
7575
{
7676
"description": "escaped pointer ref",
7777
"schema": {
78-
"tilde~field": {"type": "integer"},
79-
"slash/field": {"type": "integer"},
80-
"percent%field": {"type": "integer"},
78+
"definitions": {
79+
"tilde~field": {"type": "integer"},
80+
"slash/field": {"type": "integer"},
81+
"percent%field": {"type": "integer"}
82+
},
8183
"properties": {
82-
"tilde": {"$ref": "#/tilde~0field"},
83-
"slash": {"$ref": "#/slash~1field"},
84-
"percent": {"$ref": "#/percent%25field"}
84+
"tilde": {"$ref": "#/definitions/tilde~0field"},
85+
"slash": {"$ref": "#/definitions/slash~1field"},
86+
"percent": {"$ref": "#/definitions/percent%25field"}
8587
}
8688
},
8789
"tests": [

tests/draft6/enum.json

+10
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,16 @@
3333
"description": "objects are deep compared",
3434
"data": {"foo": false},
3535
"valid": false
36+
},
37+
{
38+
"description": "valid object matches",
39+
"data": {"foo": 12},
40+
"valid": true
41+
},
42+
{
43+
"description": "extra properties in object is invalid",
44+
"data": {"foo": 12, "boo": 42},
45+
"valid": false
3646
}
3747
]
3848
},

tests/draft6/optional/ecmascript-regex.json

-11
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,4 @@
11
[
2-
{
3-
"description": "ECMA 262 regex non-compliance",
4-
"schema": { "format": "regex" },
5-
"tests": [
6-
{
7-
"description": "ECMA 262 has no support for \\Z anchor from .NET",
8-
"data": "^\\S(|(.|\\n)*\\S)\\Z",
9-
"valid": false
10-
}
11-
]
12-
},
132
{
143
"description": "ECMA 262 regex $ does not match trailing newline",
154
"schema": {

tests/draft6/ref.json

+8-6
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,15 @@
7575
{
7676
"description": "escaped pointer ref",
7777
"schema": {
78-
"tilde~field": {"type": "integer"},
79-
"slash/field": {"type": "integer"},
80-
"percent%field": {"type": "integer"},
78+
"definitions": {
79+
"tilde~field": {"type": "integer"},
80+
"slash/field": {"type": "integer"},
81+
"percent%field": {"type": "integer"}
82+
},
8183
"properties": {
82-
"tilde": {"$ref": "#/tilde~0field"},
83-
"slash": {"$ref": "#/slash~1field"},
84-
"percent": {"$ref": "#/percent%25field"}
84+
"tilde": {"$ref": "#/definitions/tilde~0field"},
85+
"slash": {"$ref": "#/definitions/slash~1field"},
86+
"percent": {"$ref": "#/definitions/percent%25field"}
8587
}
8688
},
8789
"tests": [

tests/draft7/enum.json

+10
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,16 @@
3333
"description": "objects are deep compared",
3434
"data": {"foo": false},
3535
"valid": false
36+
},
37+
{
38+
"description": "valid object matches",
39+
"data": {"foo": 12},
40+
"valid": true
41+
},
42+
{
43+
"description": "extra properties in object is invalid",
44+
"data": {"foo": 12, "boo": 42},
45+
"valid": false
3646
}
3747
]
3848
},

tests/draft7/optional/ecmascript-regex.json

-11
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,4 @@
11
[
2-
{
3-
"description": "ECMA 262 regex non-compliance",
4-
"schema": { "format": "regex" },
5-
"tests": [
6-
{
7-
"description": "ECMA 262 has no support for \\Z anchor from .NET",
8-
"data": "^\\S(|(.|\\n)*\\S)\\Z",
9-
"valid": false
10-
}
11-
]
12-
},
132
{
143
"description": "ECMA 262 regex $ does not match trailing newline",
154
"schema": {

tests/draft7/ref.json

+8-6
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,15 @@
7575
{
7676
"description": "escaped pointer ref",
7777
"schema": {
78-
"tilde~field": {"type": "integer"},
79-
"slash/field": {"type": "integer"},
80-
"percent%field": {"type": "integer"},
78+
"definitions": {
79+
"tilde~field": {"type": "integer"},
80+
"slash/field": {"type": "integer"},
81+
"percent%field": {"type": "integer"}
82+
},
8183
"properties": {
82-
"tilde": {"$ref": "#/tilde~0field"},
83-
"slash": {"$ref": "#/slash~1field"},
84-
"percent": {"$ref": "#/percent%25field"}
84+
"tilde": {"$ref": "#/definitions/tilde~0field"},
85+
"slash": {"$ref": "#/definitions/slash~1field"},
86+
"percent": {"$ref": "#/definitions/percent%25field"}
8587
}
8688
},
8789
"tests": [

0 commit comments

Comments
 (0)