@jarenjs/refs 0.8.2 → 0.9.2
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/LICENSE +21 -0
- package/README.md +20 -2
- package/dist/types/index.d.ts +44 -0
- package/dist/types/index.import.no-lint.d.ts +417 -0
- package/dist/types/json-schema-2019-09/index.d.ts +370 -0
- package/dist/types/json-schema-2019-09/index.import.no-lint.d.ts +378 -0
- package/dist/types/json-schema-2020-12/index.d.ts +411 -0
- package/dist/types/json-schema-2020-12/index.import.no-lint.d.ts +421 -0
- package/package.json +32 -10
- package/src/data.json +13 -0
- package/src/index.import.no-lint.js +5 -0
- package/src/index.js +86 -0
- package/src/json-schema-2019-09/index.import.no-lint.js +17 -0
- package/src/json-schema-2019-09/index.js +12 -0
- package/src/json-schema-2019-09/meta/applicator.json +53 -0
- package/src/json-schema-2019-09/meta/content.json +17 -0
- package/src/json-schema-2019-09/meta/core.json +57 -0
- package/src/json-schema-2019-09/meta/format.json +14 -0
- package/src/json-schema-2019-09/meta/meta-data.json +37 -0
- package/src/json-schema-2019-09/meta/validation.json +90 -0
- package/src/json-schema-2019-09/schema.json +39 -0
- package/src/json-schema-2020-12/index.import.no-lint.js +21 -0
- package/src/json-schema-2020-12/index.js +16 -0
- package/src/json-schema-2020-12/meta/applicator.json +48 -0
- package/src/json-schema-2020-12/meta/content.json +17 -0
- package/src/json-schema-2020-12/meta/core.json +51 -0
- package/src/json-schema-2020-12/meta/format-annotation.json +14 -0
- package/src/json-schema-2020-12/meta/format-assertion.json +13 -0
- package/src/json-schema-2020-12/meta/meta-data.json +37 -0
- package/src/json-schema-2020-12/meta/unevaluated.json +15 -0
- package/src/json-schema-2020-12/meta/validation.json +90 -0
- package/src/json-schema-2020-12/schema.json +55 -0
- package/src/json-schema-draft-06.json +137 -0
- package/src/json-schema-draft-07.json +152 -0
- package/src/json-schema-secure.json +88 -0
- package/dist/index.js +0 -1054
- package/dist/index.js.map +0 -7
- package/dist/index.min.js +0 -2
- package/dist/index.min.js.map +0 -7
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-06/schema#",
|
|
3
|
+
"$id": "http://json-schema.org/draft-06/schema#",
|
|
4
|
+
"title": "Core schema meta-schema",
|
|
5
|
+
"definitions": {
|
|
6
|
+
"schemaArray": {
|
|
7
|
+
"type": "array",
|
|
8
|
+
"minItems": 1,
|
|
9
|
+
"items": {"$ref": "#"}
|
|
10
|
+
},
|
|
11
|
+
"nonNegativeInteger": {
|
|
12
|
+
"type": "integer",
|
|
13
|
+
"minimum": 0
|
|
14
|
+
},
|
|
15
|
+
"nonNegativeIntegerDefault0": {
|
|
16
|
+
"allOf": [{"$ref": "#/definitions/nonNegativeInteger"}, {"default": 0}]
|
|
17
|
+
},
|
|
18
|
+
"simpleTypes": {
|
|
19
|
+
"enum": ["array", "boolean", "integer", "null", "number", "object", "string"]
|
|
20
|
+
},
|
|
21
|
+
"stringArray": {
|
|
22
|
+
"type": "array",
|
|
23
|
+
"items": {"type": "string"},
|
|
24
|
+
"uniqueItems": true,
|
|
25
|
+
"default": []
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
"type": ["object", "boolean"],
|
|
29
|
+
"properties": {
|
|
30
|
+
"$id": {
|
|
31
|
+
"type": "string",
|
|
32
|
+
"format": "uri-reference"
|
|
33
|
+
},
|
|
34
|
+
"$schema": {
|
|
35
|
+
"type": "string",
|
|
36
|
+
"format": "uri"
|
|
37
|
+
},
|
|
38
|
+
"$ref": {
|
|
39
|
+
"type": "string",
|
|
40
|
+
"format": "uri-reference"
|
|
41
|
+
},
|
|
42
|
+
"title": {
|
|
43
|
+
"type": "string"
|
|
44
|
+
},
|
|
45
|
+
"description": {
|
|
46
|
+
"type": "string"
|
|
47
|
+
},
|
|
48
|
+
"default": {},
|
|
49
|
+
"examples": {
|
|
50
|
+
"type": "array",
|
|
51
|
+
"items": {}
|
|
52
|
+
},
|
|
53
|
+
"multipleOf": {
|
|
54
|
+
"type": "number",
|
|
55
|
+
"exclusiveMinimum": 0
|
|
56
|
+
},
|
|
57
|
+
"maximum": {
|
|
58
|
+
"type": "number"
|
|
59
|
+
},
|
|
60
|
+
"exclusiveMaximum": {
|
|
61
|
+
"type": "number"
|
|
62
|
+
},
|
|
63
|
+
"minimum": {
|
|
64
|
+
"type": "number"
|
|
65
|
+
},
|
|
66
|
+
"exclusiveMinimum": {
|
|
67
|
+
"type": "number"
|
|
68
|
+
},
|
|
69
|
+
"maxLength": {"$ref": "#/definitions/nonNegativeInteger"},
|
|
70
|
+
"minLength": {"$ref": "#/definitions/nonNegativeIntegerDefault0"},
|
|
71
|
+
"pattern": {
|
|
72
|
+
"type": "string",
|
|
73
|
+
"format": "regex"
|
|
74
|
+
},
|
|
75
|
+
"additionalItems": {"$ref": "#"},
|
|
76
|
+
"items": {
|
|
77
|
+
"anyOf": [{"$ref": "#"}, {"$ref": "#/definitions/schemaArray"}],
|
|
78
|
+
"default": {}
|
|
79
|
+
},
|
|
80
|
+
"maxItems": {"$ref": "#/definitions/nonNegativeInteger"},
|
|
81
|
+
"minItems": {"$ref": "#/definitions/nonNegativeIntegerDefault0"},
|
|
82
|
+
"uniqueItems": {
|
|
83
|
+
"type": "boolean",
|
|
84
|
+
"default": false
|
|
85
|
+
},
|
|
86
|
+
"contains": {"$ref": "#"},
|
|
87
|
+
"maxProperties": {"$ref": "#/definitions/nonNegativeInteger"},
|
|
88
|
+
"minProperties": {"$ref": "#/definitions/nonNegativeIntegerDefault0"},
|
|
89
|
+
"required": {"$ref": "#/definitions/stringArray"},
|
|
90
|
+
"additionalProperties": {"$ref": "#"},
|
|
91
|
+
"definitions": {
|
|
92
|
+
"type": "object",
|
|
93
|
+
"additionalProperties": {"$ref": "#"},
|
|
94
|
+
"default": {}
|
|
95
|
+
},
|
|
96
|
+
"properties": {
|
|
97
|
+
"type": "object",
|
|
98
|
+
"additionalProperties": {"$ref": "#"},
|
|
99
|
+
"default": {}
|
|
100
|
+
},
|
|
101
|
+
"patternProperties": {
|
|
102
|
+
"type": "object",
|
|
103
|
+
"additionalProperties": {"$ref": "#"},
|
|
104
|
+
"default": {}
|
|
105
|
+
},
|
|
106
|
+
"dependencies": {
|
|
107
|
+
"type": "object",
|
|
108
|
+
"additionalProperties": {
|
|
109
|
+
"anyOf": [{"$ref": "#"}, {"$ref": "#/definitions/stringArray"}]
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
"propertyNames": {"$ref": "#"},
|
|
113
|
+
"const": {},
|
|
114
|
+
"enum": {
|
|
115
|
+
"type": "array",
|
|
116
|
+
"minItems": 1,
|
|
117
|
+
"uniqueItems": true
|
|
118
|
+
},
|
|
119
|
+
"type": {
|
|
120
|
+
"anyOf": [
|
|
121
|
+
{"$ref": "#/definitions/simpleTypes"},
|
|
122
|
+
{
|
|
123
|
+
"type": "array",
|
|
124
|
+
"items": {"$ref": "#/definitions/simpleTypes"},
|
|
125
|
+
"minItems": 1,
|
|
126
|
+
"uniqueItems": true
|
|
127
|
+
}
|
|
128
|
+
]
|
|
129
|
+
},
|
|
130
|
+
"format": {"type": "string"},
|
|
131
|
+
"allOf": {"$ref": "#/definitions/schemaArray"},
|
|
132
|
+
"anyOf": {"$ref": "#/definitions/schemaArray"},
|
|
133
|
+
"oneOf": {"$ref": "#/definitions/schemaArray"},
|
|
134
|
+
"not": {"$ref": "#"}
|
|
135
|
+
},
|
|
136
|
+
"default": {}
|
|
137
|
+
}
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"$id": "http://json-schema.org/draft-07/schema#",
|
|
4
|
+
"title": "Core schema meta-schema",
|
|
5
|
+
"definitions": {
|
|
6
|
+
"schemaArray": {
|
|
7
|
+
"type": "array",
|
|
8
|
+
"minItems": 1,
|
|
9
|
+
"items": {"$ref": "#"}
|
|
10
|
+
},
|
|
11
|
+
"nonNegativeInteger": {
|
|
12
|
+
"type": "integer",
|
|
13
|
+
"minimum": 0
|
|
14
|
+
},
|
|
15
|
+
"nonNegativeIntegerDefault0": {
|
|
16
|
+
"allOf": [{"$ref": "#/definitions/nonNegativeInteger"}, {"default": 0}]
|
|
17
|
+
},
|
|
18
|
+
"simpleTypes": {
|
|
19
|
+
"enum": ["array", "boolean", "integer", "null", "number", "object", "string"]
|
|
20
|
+
},
|
|
21
|
+
"stringArray": {
|
|
22
|
+
"type": "array",
|
|
23
|
+
"items": {"type": "string"},
|
|
24
|
+
"uniqueItems": true,
|
|
25
|
+
"default": []
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
"type": ["object", "boolean"],
|
|
29
|
+
"properties": {
|
|
30
|
+
"$id": {
|
|
31
|
+
"type": "string",
|
|
32
|
+
"format": "uri-reference",
|
|
33
|
+
"pattern": "^[^#]*#?$"
|
|
34
|
+
},
|
|
35
|
+
"$schema": {
|
|
36
|
+
"type": "string",
|
|
37
|
+
"format": "uri"
|
|
38
|
+
},
|
|
39
|
+
"$ref": {
|
|
40
|
+
"type": "string",
|
|
41
|
+
"format": "uri-reference"
|
|
42
|
+
},
|
|
43
|
+
"$comment": {
|
|
44
|
+
"type": "string"
|
|
45
|
+
},
|
|
46
|
+
"title": {
|
|
47
|
+
"type": "string"
|
|
48
|
+
},
|
|
49
|
+
"description": {
|
|
50
|
+
"type": "string"
|
|
51
|
+
},
|
|
52
|
+
"default": true,
|
|
53
|
+
"readOnly": {
|
|
54
|
+
"type": "boolean",
|
|
55
|
+
"default": false
|
|
56
|
+
},
|
|
57
|
+
"examples": {
|
|
58
|
+
"type": "array",
|
|
59
|
+
"items": true
|
|
60
|
+
},
|
|
61
|
+
"multipleOf": {
|
|
62
|
+
"type": "number",
|
|
63
|
+
"exclusiveMinimum": 0
|
|
64
|
+
},
|
|
65
|
+
"maximum": {
|
|
66
|
+
"type": "number"
|
|
67
|
+
},
|
|
68
|
+
"exclusiveMaximum": {
|
|
69
|
+
"type": "number"
|
|
70
|
+
},
|
|
71
|
+
"minimum": {
|
|
72
|
+
"type": "number"
|
|
73
|
+
},
|
|
74
|
+
"exclusiveMinimum": {
|
|
75
|
+
"type": "number"
|
|
76
|
+
},
|
|
77
|
+
"maxLength": {"$ref": "#/definitions/nonNegativeInteger"},
|
|
78
|
+
"minLength": {"$ref": "#/definitions/nonNegativeIntegerDefault0"},
|
|
79
|
+
"pattern": {
|
|
80
|
+
"type": "string",
|
|
81
|
+
"format": "regex"
|
|
82
|
+
},
|
|
83
|
+
"additionalItems": {"$ref": "#"},
|
|
84
|
+
"items": {
|
|
85
|
+
"anyOf": [{"$ref": "#"}, {"$ref": "#/definitions/schemaArray"}],
|
|
86
|
+
"default": true
|
|
87
|
+
},
|
|
88
|
+
"maxItems": {"$ref": "#/definitions/nonNegativeInteger"},
|
|
89
|
+
"minItems": {"$ref": "#/definitions/nonNegativeIntegerDefault0"},
|
|
90
|
+
"uniqueItems": {
|
|
91
|
+
"type": "boolean",
|
|
92
|
+
"default": false
|
|
93
|
+
},
|
|
94
|
+
"contains": {"$ref": "#"},
|
|
95
|
+
"maxProperties": {"$ref": "#/definitions/nonNegativeInteger"},
|
|
96
|
+
"minProperties": {"$ref": "#/definitions/nonNegativeIntegerDefault0"},
|
|
97
|
+
"required": {"$ref": "#/definitions/stringArray"},
|
|
98
|
+
"additionalProperties": {"$ref": "#"},
|
|
99
|
+
"definitions": {
|
|
100
|
+
"type": "object",
|
|
101
|
+
"additionalProperties": {"$ref": "#"},
|
|
102
|
+
"default": {}
|
|
103
|
+
},
|
|
104
|
+
"properties": {
|
|
105
|
+
"type": "object",
|
|
106
|
+
"additionalProperties": {"$ref": "#"},
|
|
107
|
+
"default": {}
|
|
108
|
+
},
|
|
109
|
+
"patternProperties": {
|
|
110
|
+
"type": "object",
|
|
111
|
+
"additionalProperties": {"$ref": "#"},
|
|
112
|
+
"propertyNames": {"format": "regex"},
|
|
113
|
+
"default": {}
|
|
114
|
+
},
|
|
115
|
+
"dependencies": {
|
|
116
|
+
"type": "object",
|
|
117
|
+
"additionalProperties": {
|
|
118
|
+
"anyOf": [{"$ref": "#"}, {"$ref": "#/definitions/stringArray"}]
|
|
119
|
+
}
|
|
120
|
+
},
|
|
121
|
+
"propertyNames": {"$ref": "#"},
|
|
122
|
+
"const": true,
|
|
123
|
+
"enum": {
|
|
124
|
+
"type": "array",
|
|
125
|
+
"items": true,
|
|
126
|
+
"minItems": 1,
|
|
127
|
+
"uniqueItems": true
|
|
128
|
+
},
|
|
129
|
+
"type": {
|
|
130
|
+
"anyOf": [
|
|
131
|
+
{"$ref": "#/definitions/simpleTypes"},
|
|
132
|
+
{
|
|
133
|
+
"type": "array",
|
|
134
|
+
"items": {"$ref": "#/definitions/simpleTypes"},
|
|
135
|
+
"minItems": 1,
|
|
136
|
+
"uniqueItems": true
|
|
137
|
+
}
|
|
138
|
+
]
|
|
139
|
+
},
|
|
140
|
+
"format": {"type": "string"},
|
|
141
|
+
"contentMediaType": {"type": "string"},
|
|
142
|
+
"contentEncoding": {"type": "string"},
|
|
143
|
+
"if": {"$ref": "#"},
|
|
144
|
+
"then": {"$ref": "#"},
|
|
145
|
+
"else": {"$ref": "#"},
|
|
146
|
+
"allOf": {"$ref": "#/definitions/schemaArray"},
|
|
147
|
+
"anyOf": {"$ref": "#/definitions/schemaArray"},
|
|
148
|
+
"oneOf": {"$ref": "#/definitions/schemaArray"},
|
|
149
|
+
"not": {"$ref": "#"}
|
|
150
|
+
},
|
|
151
|
+
"default": true
|
|
152
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"$id": "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/json-schema-secure.json#",
|
|
4
|
+
"title": "Meta-schema for the security assessment of JSON Schemas",
|
|
5
|
+
"description": "If a JSON AnySchema fails validation against this meta-schema, it may be unsafe to validate untrusted data",
|
|
6
|
+
"definitions": {
|
|
7
|
+
"schemaArray": {
|
|
8
|
+
"type": "array",
|
|
9
|
+
"minItems": 1,
|
|
10
|
+
"items": {"$ref": "#"}
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
"dependencies": {
|
|
14
|
+
"patternProperties": {
|
|
15
|
+
"description": "prevent slow validation of large property names",
|
|
16
|
+
"required": ["propertyNames"],
|
|
17
|
+
"properties": {
|
|
18
|
+
"propertyNames": {
|
|
19
|
+
"required": ["maxLength"]
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"uniqueItems": {
|
|
24
|
+
"description": "prevent slow validation of large non-scalar arrays",
|
|
25
|
+
"if": {
|
|
26
|
+
"properties": {
|
|
27
|
+
"uniqueItems": {"const": true},
|
|
28
|
+
"items": {
|
|
29
|
+
"properties": {
|
|
30
|
+
"type": {
|
|
31
|
+
"anyOf": [
|
|
32
|
+
{
|
|
33
|
+
"enum": ["object", "array"]
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"type": "array",
|
|
37
|
+
"contains": {"enum": ["object", "array"]}
|
|
38
|
+
}
|
|
39
|
+
]
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
"then": {
|
|
46
|
+
"required": ["maxItems"]
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
"pattern": {
|
|
50
|
+
"description": "prevent slow pattern matching of large strings",
|
|
51
|
+
"required": ["maxLength"]
|
|
52
|
+
},
|
|
53
|
+
"format": {
|
|
54
|
+
"description": "prevent slow format validation of large strings",
|
|
55
|
+
"required": ["maxLength"]
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
"properties": {
|
|
59
|
+
"additionalItems": {"$ref": "#"},
|
|
60
|
+
"additionalProperties": {"$ref": "#"},
|
|
61
|
+
"dependencies": {
|
|
62
|
+
"additionalProperties": {
|
|
63
|
+
"anyOf": [{"type": "array"}, {"$ref": "#"}]
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
"items": {
|
|
67
|
+
"anyOf": [{"$ref": "#"}, {"$ref": "#/definitions/schemaArray"}]
|
|
68
|
+
},
|
|
69
|
+
"definitions": {
|
|
70
|
+
"additionalProperties": {"$ref": "#"}
|
|
71
|
+
},
|
|
72
|
+
"patternProperties": {
|
|
73
|
+
"additionalProperties": {"$ref": "#"}
|
|
74
|
+
},
|
|
75
|
+
"properties": {
|
|
76
|
+
"additionalProperties": {"$ref": "#"}
|
|
77
|
+
},
|
|
78
|
+
"if": {"$ref": "#"},
|
|
79
|
+
"then": {"$ref": "#"},
|
|
80
|
+
"else": {"$ref": "#"},
|
|
81
|
+
"allOf": {"$ref": "#/definitions/schemaArray"},
|
|
82
|
+
"anyOf": {"$ref": "#/definitions/schemaArray"},
|
|
83
|
+
"oneOf": {"$ref": "#/definitions/schemaArray"},
|
|
84
|
+
"not": {"$ref": "#"},
|
|
85
|
+
"contains": {"$ref": "#"},
|
|
86
|
+
"propertyNames": {"$ref": "#"}
|
|
87
|
+
}
|
|
88
|
+
}
|