Skip to content

Commit 9b169be

Browse files
committed
specification takes array of objects having section and quote
1 parent 1362a8c commit 9b169be

File tree

2 files changed

+26
-61
lines changed

2 files changed

+26
-61
lines changed

test-schema.json

+18-24
Original file line numberDiff line numberDiff line change
@@ -29,18 +29,24 @@
2929
"minItems": 1
3030
},
3131
"specification":{
32-
"description": "Location of the test case in the specification",
33-
"type": "object",
34-
"minProperties": 1,
35-
"properties": {
36-
"jsonschema-core": { "$ref": "#/$defs/spec"},
37-
"jsonschema-validation": {"$ref": "#/$defs/spec"},
38-
"ecma262": { "$ref": "#/$defs/spec"}
39-
},
40-
"patternProperties": {
41-
"^rfc[0-9]{4}$": {"$ref": "#/$defs/spec"}
42-
},
43-
"additionalProperties": false
32+
"description": "A reference to a specification document which defines the behavior tested by this test case. Typically this should be a JSON Schema specification document, though in cases where the JSON Schema specification points to another RFC it should contain *both* the portion of the JSON Schema specification which indicates what RFC (and section) to follow as *well* as information on where in that specification the behavior is specified.",
33+
34+
"type": "array",
35+
"minItems": 1,
36+
"items":{
37+
"properties": {
38+
"core": { "pattern": "^[0-9a-zA-Z]+(\\.[0-9a-zA-Z]+)*$", "type":"string" },
39+
"validation": { "pattern": "^[0-9a-zA-Z]+(\\.[0-9a-zA-Z]+)*$", "type":"string" },
40+
"ecma262": { "pattern": "^[0-9a-zA-Z]+(\\.[0-9a-zA-Z]+)*$", "type":"string" },
41+
"perl5": { "type":"string" },
42+
"quote": { "type":"string" }
43+
},
44+
"patternProperties": {
45+
"^rfc\\d+$": { "pattern": "^[0-9a-zA-Z]+.([0-9a-zA-Z]+)*$", "type":"string" }
46+
},
47+
"additionalProperties": false,
48+
"minProperties": 1
49+
}
4450
}
4551
},
4652
"additionalProperties": false
@@ -70,18 +76,6 @@
7076
}
7177
},
7278
"additionalProperties": false
73-
},
74-
"spec": {
75-
"properties": {
76-
"section": {
77-
"type": "string",
78-
"pattern": "^\\d+(\\.\\d+)*\\.$"
79-
},
80-
"para": {
81-
"type": "string",
82-
"pattern": "^\\d+(\\.\\d+)*$"
83-
}
84-
}
8579
}
8680
}
8781
}

tests/draft2020-12/additionalProperties.json

+8-37
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,7 @@
22
{
33
"description":
44
"additionalProperties being false does not allow other properties",
5-
"specification":{
6-
"jsonschema-core": {
7-
"section": "10.3.2.3.",
8-
"para": "1"
9-
}
10-
},
5+
"specification": [ { "core":"10.3.2.3", "quote": "The value of \"additionalProperties\" MUST be a valid JSON Schema. Boolean \"false\" forbids everything." } ],
116
"schema": {
127
"$schema": "https://json-schema.org/draft/2020-12/schema",
138
"properties": {"foo": {}, "bar": {}},
@@ -49,11 +44,7 @@
4944
},
5045
{
5146
"description": "non-ASCII pattern with additionalProperties",
52-
"specification":{
53-
"rfc8259":{
54-
"section": "4."
55-
}
56-
},
47+
"specification": [ { "core":"10.3.2.3"} ],
5748
"schema": {
5849
"$schema": "https://json-schema.org/draft/2020-12/schema",
5950
"patternProperties": {"^á": {}},
@@ -74,12 +65,7 @@
7465
},
7566
{
7667
"description": "additionalProperties with schema",
77-
"specification":{
78-
"jsonschema-core": {
79-
"section": "10.3.2.3.",
80-
"para": "1"
81-
}
82-
},
68+
"specification": [ { "core":"10.3.2.3", "quote": "The value of \"additionalProperties\" MUST be a valid JSON Schema." } ],
8369
"schema": {
8470
"$schema": "https://json-schema.org/draft/2020-12/schema",
8571
"properties": {"foo": {}, "bar": {}},
@@ -104,8 +90,8 @@
10490
]
10591
},
10692
{
107-
"description":
108-
"additionalProperties can exist by itself",
93+
"description": "additionalProperties can exist by itself",
94+
"specification": [ { "core":"10.3.2.3", "quote": "With no other applicator applying to object instances. This validates all the instance values irrespective of their property names" } ],
10995
"schema": {
11096
"$schema": "https://json-schema.org/draft/2020-12/schema",
11197
"additionalProperties": {"type": "boolean"}
@@ -125,12 +111,7 @@
125111
},
126112
{
127113
"description": "additionalProperties are allowed by default",
128-
"specification":{
129-
"jsonschema-core": {
130-
"section": "10.3.2.3.",
131-
"para": "5"
132-
}
133-
},
114+
"specification": [ { "core":"10.3.2.3", "quote": "Omitting this keyword has the same assertion behavior as an empty schema." } ],
134115
"schema": {
135116
"$schema": "https://json-schema.org/draft/2020-12/schema",
136117
"properties": {"foo": {}, "bar": {}}
@@ -145,12 +126,7 @@
145126
},
146127
{
147128
"description": "additionalProperties does not look in applicators",
148-
"specification":{
149-
"jsonschema-core": {
150-
"section": "10.2.",
151-
"para": "2"
152-
}
153-
},
129+
"specification":[ { "core": "10.2", "quote": "Subschemas of applicator keywords evaluate the instance completely independently such that the results of one such subschema MUST NOT impact the results of sibling subschemas." } ],
154130
"schema": {
155131
"$schema": "https://json-schema.org/draft/2020-12/schema",
156132
"allOf": [
@@ -168,12 +144,7 @@
168144
},
169145
{
170146
"description": "additionalProperties with null valued instance properties",
171-
"specification":{
172-
"jsonschema-core": {
173-
"section": "10.3.2.3.",
174-
"para": "1"
175-
}
176-
},
147+
"specification": [ { "core":"10.3.2.3" } ],
177148
"schema": {
178149
"$schema": "https://json-schema.org/draft/2020-12/schema",
179150
"additionalProperties": {

0 commit comments

Comments
 (0)