@hyperjump/json-schema 1.6.6 → 1.6.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundle/index.js +50 -2
- package/lib/keywords.js +15 -2
- package/lib/schema.js +1 -8
- package/openapi-3-0/index.js +1 -1
- package/openapi-3-1/index.d.ts +1 -1
- package/package.json +5 -7
- package/annotations/tests/applicators.json +0 -375
- package/annotations/tests/content.json +0 -57
- package/annotations/tests/core.json +0 -33
- package/annotations/tests/format.json +0 -20
- package/annotations/tests/meta-data.json +0 -128
- package/annotations/tests/unevaluated.json +0 -557
- package/annotations/tests/unknown.json +0 -87
- package/annotations/tests/validation.json +0 -328
- package/bundle/file.json +0 -57
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
[
|
|
2
|
-
{
|
|
3
|
-
"title": "Unknown keywords are not annotations in draft-04",
|
|
4
|
-
"schema": {
|
|
5
|
-
"$schema": "http://json-schema.org/draft-04/schema#",
|
|
6
|
-
"unknown": "Foo"
|
|
7
|
-
},
|
|
8
|
-
"subjects": [
|
|
9
|
-
{
|
|
10
|
-
"instance": 42,
|
|
11
|
-
"assertions": [
|
|
12
|
-
{
|
|
13
|
-
"location": "#",
|
|
14
|
-
"keyword": "unknown",
|
|
15
|
-
"expected": []
|
|
16
|
-
}
|
|
17
|
-
]
|
|
18
|
-
}
|
|
19
|
-
]
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
"title": "Unknown keywords are not annotations in draft-06",
|
|
23
|
-
"schema": {
|
|
24
|
-
"$schema": "http://json-schema.org/draft-06/schema#",
|
|
25
|
-
"unknown": "Foo"
|
|
26
|
-
},
|
|
27
|
-
"subjects": [
|
|
28
|
-
{
|
|
29
|
-
"instance": 42,
|
|
30
|
-
"assertions": [
|
|
31
|
-
{
|
|
32
|
-
"location": "#",
|
|
33
|
-
"keyword": "unknown",
|
|
34
|
-
"expected": []
|
|
35
|
-
}
|
|
36
|
-
]
|
|
37
|
-
}
|
|
38
|
-
]
|
|
39
|
-
},
|
|
40
|
-
{
|
|
41
|
-
"title": "Unknown keywords are not annotations in draft-07",
|
|
42
|
-
"schema": {
|
|
43
|
-
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
44
|
-
"unknown": "Foo"
|
|
45
|
-
},
|
|
46
|
-
"subjects": [
|
|
47
|
-
{
|
|
48
|
-
"instance": 42,
|
|
49
|
-
"assertions": [
|
|
50
|
-
{
|
|
51
|
-
"location": "#",
|
|
52
|
-
"keyword": "unknown",
|
|
53
|
-
"expected": []
|
|
54
|
-
}
|
|
55
|
-
]
|
|
56
|
-
}
|
|
57
|
-
]
|
|
58
|
-
},
|
|
59
|
-
{
|
|
60
|
-
"title": "Unknown keywords may or may not be annotations in 2019-09",
|
|
61
|
-
"schema": {
|
|
62
|
-
"$schema": "https://json-schema.org/draft/2019-09/schema",
|
|
63
|
-
"unknown": "Foo"
|
|
64
|
-
},
|
|
65
|
-
"$comment": "'subjects' is intentionally left empty",
|
|
66
|
-
"subjects": []
|
|
67
|
-
},
|
|
68
|
-
{
|
|
69
|
-
"title": "Unknown keywords are annotations in 2020-12",
|
|
70
|
-
"schema": {
|
|
71
|
-
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
72
|
-
"unknown": "Foo"
|
|
73
|
-
},
|
|
74
|
-
"subjects": [
|
|
75
|
-
{
|
|
76
|
-
"instance": 42,
|
|
77
|
-
"assertions": [
|
|
78
|
-
{
|
|
79
|
-
"location": "#",
|
|
80
|
-
"keyword": "unknown",
|
|
81
|
-
"expected": ["Foo"]
|
|
82
|
-
}
|
|
83
|
-
]
|
|
84
|
-
}
|
|
85
|
-
]
|
|
86
|
-
}
|
|
87
|
-
]
|
|
@@ -1,328 +0,0 @@
|
|
|
1
|
-
[
|
|
2
|
-
{
|
|
3
|
-
"title": "`const` doesn't produce annotations",
|
|
4
|
-
"schema": {
|
|
5
|
-
"const": "foo"
|
|
6
|
-
},
|
|
7
|
-
"subjects": [
|
|
8
|
-
{
|
|
9
|
-
"instance": "foo",
|
|
10
|
-
"assertions": [
|
|
11
|
-
{
|
|
12
|
-
"location": "#",
|
|
13
|
-
"keyword": "const",
|
|
14
|
-
"expected": []
|
|
15
|
-
}
|
|
16
|
-
]
|
|
17
|
-
}
|
|
18
|
-
]
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
"title": "`dependentRequired` doesn't produce annotations",
|
|
22
|
-
"schema": {
|
|
23
|
-
"dependentRequired": {
|
|
24
|
-
"foo": ["bar"]
|
|
25
|
-
}
|
|
26
|
-
},
|
|
27
|
-
"subjects": [
|
|
28
|
-
{
|
|
29
|
-
"instance": { "foo": 1, "bar": 2 },
|
|
30
|
-
"assertions": [
|
|
31
|
-
{
|
|
32
|
-
"location": "#",
|
|
33
|
-
"keyword": "dependentRequired",
|
|
34
|
-
"expected": []
|
|
35
|
-
}
|
|
36
|
-
]
|
|
37
|
-
}
|
|
38
|
-
]
|
|
39
|
-
},
|
|
40
|
-
{
|
|
41
|
-
"title": "`enum` doesn't produce annotations",
|
|
42
|
-
"schema": {
|
|
43
|
-
"enum": ["foo"]
|
|
44
|
-
},
|
|
45
|
-
"subjects": [
|
|
46
|
-
{
|
|
47
|
-
"instance": "foo",
|
|
48
|
-
"assertions": [
|
|
49
|
-
{
|
|
50
|
-
"location": "#",
|
|
51
|
-
"keyword": "enum",
|
|
52
|
-
"expected": []
|
|
53
|
-
}
|
|
54
|
-
]
|
|
55
|
-
}
|
|
56
|
-
]
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
"title": "`exclusiveMaximum` doesn't produce annotations",
|
|
60
|
-
"schema": {
|
|
61
|
-
"exclusiveMaximum": 50
|
|
62
|
-
},
|
|
63
|
-
"subjects": [
|
|
64
|
-
{
|
|
65
|
-
"instance": 42,
|
|
66
|
-
"assertions": [
|
|
67
|
-
{
|
|
68
|
-
"location": "#",
|
|
69
|
-
"keyword": "exclusiveMaximum",
|
|
70
|
-
"expected": []
|
|
71
|
-
}
|
|
72
|
-
]
|
|
73
|
-
}
|
|
74
|
-
]
|
|
75
|
-
},
|
|
76
|
-
{
|
|
77
|
-
"title": "`exclusiveMinimum` doesn't produce annotations",
|
|
78
|
-
"schema": {
|
|
79
|
-
"exclusiveMinimum": 5
|
|
80
|
-
},
|
|
81
|
-
"subjects": [
|
|
82
|
-
{
|
|
83
|
-
"instance": 42,
|
|
84
|
-
"assertions": [
|
|
85
|
-
{
|
|
86
|
-
"location": "#",
|
|
87
|
-
"keyword": "exclusiveMinimum",
|
|
88
|
-
"expected": []
|
|
89
|
-
}
|
|
90
|
-
]
|
|
91
|
-
}
|
|
92
|
-
]
|
|
93
|
-
},
|
|
94
|
-
{
|
|
95
|
-
"title": "`maxItems` doesn't produce annotations",
|
|
96
|
-
"schema": {
|
|
97
|
-
"maxItems": 42
|
|
98
|
-
},
|
|
99
|
-
"subjects": [
|
|
100
|
-
{
|
|
101
|
-
"instance": ["foo"],
|
|
102
|
-
"assertions": [
|
|
103
|
-
{
|
|
104
|
-
"location": "#",
|
|
105
|
-
"keyword": "maxItems",
|
|
106
|
-
"expected": []
|
|
107
|
-
}
|
|
108
|
-
]
|
|
109
|
-
}
|
|
110
|
-
]
|
|
111
|
-
},
|
|
112
|
-
{
|
|
113
|
-
"title": "`maxLength` doesn't produce annotations",
|
|
114
|
-
"schema": {
|
|
115
|
-
"maxLength": 42
|
|
116
|
-
},
|
|
117
|
-
"subjects": [
|
|
118
|
-
{
|
|
119
|
-
"instance": "foo",
|
|
120
|
-
"assertions": [
|
|
121
|
-
{
|
|
122
|
-
"location": "#",
|
|
123
|
-
"keyword": "maxLength",
|
|
124
|
-
"expected": []
|
|
125
|
-
}
|
|
126
|
-
]
|
|
127
|
-
}
|
|
128
|
-
]
|
|
129
|
-
},
|
|
130
|
-
{
|
|
131
|
-
"title": "`maxProperties` doesn't produce annotations",
|
|
132
|
-
"schema": {
|
|
133
|
-
"maxProperties": 42
|
|
134
|
-
},
|
|
135
|
-
"subjects": [
|
|
136
|
-
{
|
|
137
|
-
"instance": { "foo": 42 },
|
|
138
|
-
"assertions": [
|
|
139
|
-
{
|
|
140
|
-
"location": "#",
|
|
141
|
-
"keyword": "maxProperties",
|
|
142
|
-
"expected": []
|
|
143
|
-
}
|
|
144
|
-
]
|
|
145
|
-
}
|
|
146
|
-
]
|
|
147
|
-
},
|
|
148
|
-
{
|
|
149
|
-
"title": "`maximum` doesn't produce annotations",
|
|
150
|
-
"schema": {
|
|
151
|
-
"maximum": 50
|
|
152
|
-
},
|
|
153
|
-
"subjects": [
|
|
154
|
-
{
|
|
155
|
-
"instance": 42,
|
|
156
|
-
"assertions": [
|
|
157
|
-
{
|
|
158
|
-
"location": "#",
|
|
159
|
-
"keyword": "maximum",
|
|
160
|
-
"expected": []
|
|
161
|
-
}
|
|
162
|
-
]
|
|
163
|
-
}
|
|
164
|
-
]
|
|
165
|
-
},
|
|
166
|
-
{
|
|
167
|
-
"title": "`minItems` doesn't produce annotations",
|
|
168
|
-
"schema": {
|
|
169
|
-
"minItems": 2
|
|
170
|
-
},
|
|
171
|
-
"subjects": [
|
|
172
|
-
{
|
|
173
|
-
"instance": ["a", "b"],
|
|
174
|
-
"assertions": [
|
|
175
|
-
{
|
|
176
|
-
"location": "#",
|
|
177
|
-
"keyword": "minItems",
|
|
178
|
-
"expected": []
|
|
179
|
-
}
|
|
180
|
-
]
|
|
181
|
-
}
|
|
182
|
-
]
|
|
183
|
-
},
|
|
184
|
-
{
|
|
185
|
-
"title": "`minLength` doesn't produce annotations",
|
|
186
|
-
"schema": {
|
|
187
|
-
"minLength": 2
|
|
188
|
-
},
|
|
189
|
-
"subjects": [
|
|
190
|
-
{
|
|
191
|
-
"instance": "foo",
|
|
192
|
-
"assertions": [
|
|
193
|
-
{
|
|
194
|
-
"location": "#",
|
|
195
|
-
"keyword": "minLength",
|
|
196
|
-
"expected": []
|
|
197
|
-
}
|
|
198
|
-
]
|
|
199
|
-
}
|
|
200
|
-
]
|
|
201
|
-
},
|
|
202
|
-
{
|
|
203
|
-
"title": "`minProperties` doesn't produce annotations",
|
|
204
|
-
"schema": {
|
|
205
|
-
"minProperties": 2
|
|
206
|
-
},
|
|
207
|
-
"subjects": [
|
|
208
|
-
{
|
|
209
|
-
"instance": { "foo": 42, "bar": 24 },
|
|
210
|
-
"assertions": [
|
|
211
|
-
{
|
|
212
|
-
"location": "#",
|
|
213
|
-
"keyword": "minProperties",
|
|
214
|
-
"expected": []
|
|
215
|
-
}
|
|
216
|
-
]
|
|
217
|
-
}
|
|
218
|
-
]
|
|
219
|
-
},
|
|
220
|
-
{
|
|
221
|
-
"title": "`minimum` doesn't produce annotations",
|
|
222
|
-
"schema": {
|
|
223
|
-
"minimum": 42
|
|
224
|
-
},
|
|
225
|
-
"subjects": [
|
|
226
|
-
{
|
|
227
|
-
"instance": 50,
|
|
228
|
-
"assertions": [
|
|
229
|
-
{
|
|
230
|
-
"location": "#",
|
|
231
|
-
"keyword": "minimum",
|
|
232
|
-
"expected": []
|
|
233
|
-
}
|
|
234
|
-
]
|
|
235
|
-
}
|
|
236
|
-
]
|
|
237
|
-
},
|
|
238
|
-
{
|
|
239
|
-
"title": "`multipleOf` doesn't produce annotations",
|
|
240
|
-
"schema": {
|
|
241
|
-
"multipleOf": 2
|
|
242
|
-
},
|
|
243
|
-
"subjects": [
|
|
244
|
-
{
|
|
245
|
-
"instance": 42,
|
|
246
|
-
"assertions": [
|
|
247
|
-
{
|
|
248
|
-
"location": "#",
|
|
249
|
-
"keyword": "multipleOf",
|
|
250
|
-
"expected": []
|
|
251
|
-
}
|
|
252
|
-
]
|
|
253
|
-
}
|
|
254
|
-
]
|
|
255
|
-
},
|
|
256
|
-
{
|
|
257
|
-
"title": "`pattern` doesn't produce annotations",
|
|
258
|
-
"schema": {
|
|
259
|
-
"pattern": ".*"
|
|
260
|
-
},
|
|
261
|
-
"subjects": [
|
|
262
|
-
{
|
|
263
|
-
"instance": "foo",
|
|
264
|
-
"assertions": [
|
|
265
|
-
{
|
|
266
|
-
"location": "#",
|
|
267
|
-
"keyword": "pattern",
|
|
268
|
-
"expected": []
|
|
269
|
-
}
|
|
270
|
-
]
|
|
271
|
-
}
|
|
272
|
-
]
|
|
273
|
-
},
|
|
274
|
-
{
|
|
275
|
-
"title": "`required` doesn't produce annotations",
|
|
276
|
-
"schema": {
|
|
277
|
-
"required": ["foo"]
|
|
278
|
-
},
|
|
279
|
-
"subjects": [
|
|
280
|
-
{
|
|
281
|
-
"instance": { "foo": 42 },
|
|
282
|
-
"assertions": [
|
|
283
|
-
{
|
|
284
|
-
"location": "#",
|
|
285
|
-
"keyword": "required",
|
|
286
|
-
"expected": []
|
|
287
|
-
}
|
|
288
|
-
]
|
|
289
|
-
}
|
|
290
|
-
]
|
|
291
|
-
},
|
|
292
|
-
{
|
|
293
|
-
"title": "`type` doesn't produce annotations",
|
|
294
|
-
"schema": {
|
|
295
|
-
"type": "string"
|
|
296
|
-
},
|
|
297
|
-
"subjects": [
|
|
298
|
-
{
|
|
299
|
-
"instance": "foo",
|
|
300
|
-
"assertions": [
|
|
301
|
-
{
|
|
302
|
-
"location": "#",
|
|
303
|
-
"keyword": "type",
|
|
304
|
-
"expected": []
|
|
305
|
-
}
|
|
306
|
-
]
|
|
307
|
-
}
|
|
308
|
-
]
|
|
309
|
-
},
|
|
310
|
-
{
|
|
311
|
-
"title": "`uniqueItems` doesn't produce annotations",
|
|
312
|
-
"schema": {
|
|
313
|
-
"uniqueItems": true
|
|
314
|
-
},
|
|
315
|
-
"subjects": [
|
|
316
|
-
{
|
|
317
|
-
"instance": ["foo", "bar"],
|
|
318
|
-
"assertions": [
|
|
319
|
-
{
|
|
320
|
-
"location": "#",
|
|
321
|
-
"keyword": "uniqueItems",
|
|
322
|
-
"expected": []
|
|
323
|
-
}
|
|
324
|
-
]
|
|
325
|
-
}
|
|
326
|
-
]
|
|
327
|
-
}
|
|
328
|
-
]
|
package/bundle/file.json
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
[
|
|
2
|
-
{
|
|
3
|
-
"description": "Use relative paths for files",
|
|
4
|
-
"schema": "main.schema.json",
|
|
5
|
-
"externalSchemas": [],
|
|
6
|
-
"bundledSchema": {
|
|
7
|
-
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
8
|
-
|
|
9
|
-
"type": "object",
|
|
10
|
-
"properties": {
|
|
11
|
-
"foo": { "$ref": "string.schema.json" }
|
|
12
|
-
},
|
|
13
|
-
|
|
14
|
-
"$defs": {
|
|
15
|
-
"string.schema.json": {
|
|
16
|
-
"$id": "string.schema.json",
|
|
17
|
-
|
|
18
|
-
"type": "string"
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
"description": "Allow mix of http and file if main is file",
|
|
25
|
-
"schema": "mixed-schemes.schema.json",
|
|
26
|
-
"externalSchemas": [
|
|
27
|
-
{
|
|
28
|
-
"$id": "https://bundler.hyperjump.io/number",
|
|
29
|
-
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
30
|
-
|
|
31
|
-
"type": "number"
|
|
32
|
-
}
|
|
33
|
-
],
|
|
34
|
-
"bundledSchema": {
|
|
35
|
-
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
36
|
-
|
|
37
|
-
"type": "object",
|
|
38
|
-
"properties": {
|
|
39
|
-
"foo": { "$ref": "string.schema.json" },
|
|
40
|
-
"bar": { "$ref": "https://bundler.hyperjump.io/number" }
|
|
41
|
-
},
|
|
42
|
-
|
|
43
|
-
"$defs": {
|
|
44
|
-
"string.schema.json": {
|
|
45
|
-
"$id": "string.schema.json",
|
|
46
|
-
|
|
47
|
-
"type": "string"
|
|
48
|
-
},
|
|
49
|
-
"https://bundler.hyperjump.io/number": {
|
|
50
|
-
"$id": "https://bundler.hyperjump.io/number",
|
|
51
|
-
|
|
52
|
-
"type": "number"
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
]
|