@speclynx/apidom-ns-json-schema-draft-4 4.0.2 → 4.0.3
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/CHANGELOG.md +6 -0
- package/package.json +6 -7
- package/src/elements/JSONReference.cjs +29 -0
- package/src/elements/JSONReference.mjs +25 -0
- package/src/elements/JSONReference.ts +33 -0
- package/src/elements/JSONSchema.cjs +296 -0
- package/src/elements/JSONSchema.mjs +292 -0
- package/src/elements/JSONSchema.ts +391 -0
- package/src/elements/LinkDescription.cjs +65 -0
- package/src/elements/LinkDescription.mjs +61 -0
- package/src/elements/LinkDescription.ts +85 -0
- package/src/elements/Media.cjs +29 -0
- package/src/elements/Media.mjs +25 -0
- package/src/elements/Media.ts +35 -0
- package/src/index.cjs +69 -0
- package/src/index.mjs +23 -0
- package/src/index.ts +142 -0
- package/src/media-types.cjs +34 -0
- package/src/media-types.mjs +30 -0
- package/src/media-types.ts +40 -0
- package/src/namespace.cjs +25 -0
- package/src/namespace.mjs +20 -0
- package/src/namespace.ts +24 -0
- package/src/predicates.cjs +32 -0
- package/src/predicates.mjs +23 -0
- package/src/predicates.ts +28 -0
- package/src/refractor/index.cjs +96 -0
- package/src/refractor/index.mjs +85 -0
- package/src/refractor/index.ts +110 -0
- package/src/refractor/inspect.cjs +55 -0
- package/src/refractor/inspect.mjs +47 -0
- package/src/refractor/inspect.ts +61 -0
- package/src/refractor/plugins/replace-empty-element.cjs +208 -0
- package/src/refractor/plugins/replace-empty-element.mjs +202 -0
- package/src/refractor/plugins/replace-empty-element.ts +233 -0
- package/src/refractor/predicates.cjs +16 -0
- package/src/refractor/predicates.mjs +12 -0
- package/src/refractor/predicates.ts +17 -0
- package/src/refractor/specification.cjs +193 -0
- package/src/refractor/specification.mjs +188 -0
- package/src/refractor/specification.ts +134 -0
- package/src/refractor/toolbox.cjs +28 -0
- package/src/refractor/toolbox.mjs +21 -0
- package/src/refractor/toolbox.ts +24 -0
- package/src/refractor/visitors/FallbackVisitor.cjs +25 -0
- package/src/refractor/visitors/FallbackVisitor.mjs +19 -0
- package/src/refractor/visitors/FallbackVisitor.ts +25 -0
- package/src/refractor/visitors/SpecificationVisitor.cjs +75 -0
- package/src/refractor/visitors/SpecificationVisitor.mjs +69 -0
- package/src/refractor/visitors/SpecificationVisitor.ts +82 -0
- package/src/refractor/visitors/Visitor.cjs +36 -0
- package/src/refractor/visitors/Visitor.mjs +33 -0
- package/src/refractor/visitors/Visitor.ts +49 -0
- package/src/refractor/visitors/generics/AlternatingVisitor.cjs +42 -0
- package/src/refractor/visitors/generics/AlternatingVisitor.mjs +35 -0
- package/src/refractor/visitors/generics/AlternatingVisitor.ts +45 -0
- package/src/refractor/visitors/generics/FixedFieldsVisitor.cjs +57 -0
- package/src/refractor/visitors/generics/FixedFieldsVisitor.mjs +50 -0
- package/src/refractor/visitors/generics/FixedFieldsVisitor.ts +79 -0
- package/src/refractor/visitors/generics/MapVisitor.cjs +21 -0
- package/src/refractor/visitors/generics/MapVisitor.mjs +15 -0
- package/src/refractor/visitors/generics/MapVisitor.ts +25 -0
- package/src/refractor/visitors/generics/PatternedFieldsVisitor.cjs +58 -0
- package/src/refractor/visitors/generics/PatternedFieldsVisitor.mjs +52 -0
- package/src/refractor/visitors/generics/PatternedFieldsVisitor.ts +76 -0
- package/src/refractor/visitors/json-schema/AllOfVisitor.cjs +32 -0
- package/src/refractor/visitors/json-schema/AllOfVisitor.mjs +27 -0
- package/src/refractor/visitors/json-schema/AllOfVisitor.ts +44 -0
- package/src/refractor/visitors/json-schema/AnyOfVisitor.cjs +32 -0
- package/src/refractor/visitors/json-schema/AnyOfVisitor.mjs +27 -0
- package/src/refractor/visitors/json-schema/AnyOfVisitor.ts +44 -0
- package/src/refractor/visitors/json-schema/DefinitionsVisitor.cjs +23 -0
- package/src/refractor/visitors/json-schema/DefinitionsVisitor.mjs +18 -0
- package/src/refractor/visitors/json-schema/DefinitionsVisitor.ts +36 -0
- package/src/refractor/visitors/json-schema/DependenciesVisitor.cjs +23 -0
- package/src/refractor/visitors/json-schema/DependenciesVisitor.mjs +18 -0
- package/src/refractor/visitors/json-schema/DependenciesVisitor.ts +36 -0
- package/src/refractor/visitors/json-schema/EnumVisitor.cjs +16 -0
- package/src/refractor/visitors/json-schema/EnumVisitor.mjs +11 -0
- package/src/refractor/visitors/json-schema/EnumVisitor.ts +20 -0
- package/src/refractor/visitors/json-schema/ItemsVisitor.cjs +35 -0
- package/src/refractor/visitors/json-schema/ItemsVisitor.mjs +30 -0
- package/src/refractor/visitors/json-schema/ItemsVisitor.ts +52 -0
- package/src/refractor/visitors/json-schema/JSONSchemaOrJSONReferenceVisitor.cjs +24 -0
- package/src/refractor/visitors/json-schema/JSONSchemaOrJSONReferenceVisitor.mjs +19 -0
- package/src/refractor/visitors/json-schema/JSONSchemaOrJSONReferenceVisitor.ts +21 -0
- package/src/refractor/visitors/json-schema/LinksVisitor.cjs +30 -0
- package/src/refractor/visitors/json-schema/LinksVisitor.mjs +25 -0
- package/src/refractor/visitors/json-schema/LinksVisitor.ts +43 -0
- package/src/refractor/visitors/json-schema/OneOfVisitor.cjs +32 -0
- package/src/refractor/visitors/json-schema/OneOfVisitor.mjs +27 -0
- package/src/refractor/visitors/json-schema/OneOfVisitor.ts +44 -0
- package/src/refractor/visitors/json-schema/ParentSchemaAwareVisitor.cjs +20 -0
- package/src/refractor/visitors/json-schema/ParentSchemaAwareVisitor.mjs +16 -0
- package/src/refractor/visitors/json-schema/ParentSchemaAwareVisitor.ts +21 -0
- package/src/refractor/visitors/json-schema/PatternPropertiesVisitor.cjs +23 -0
- package/src/refractor/visitors/json-schema/PatternPropertiesVisitor.mjs +18 -0
- package/src/refractor/visitors/json-schema/PatternPropertiesVisitor.ts +36 -0
- package/src/refractor/visitors/json-schema/PropertiesVisitor.cjs +23 -0
- package/src/refractor/visitors/json-schema/PropertiesVisitor.mjs +18 -0
- package/src/refractor/visitors/json-schema/PropertiesVisitor.ts +36 -0
- package/src/refractor/visitors/json-schema/RequiredVisitor.cjs +16 -0
- package/src/refractor/visitors/json-schema/RequiredVisitor.mjs +11 -0
- package/src/refractor/visitors/json-schema/RequiredVisitor.ts +20 -0
- package/src/refractor/visitors/json-schema/TypeVisitor.cjs +20 -0
- package/src/refractor/visitors/json-schema/TypeVisitor.mjs +15 -0
- package/src/refractor/visitors/json-schema/TypeVisitor.ts +25 -0
- package/src/refractor/visitors/json-schema/bases.cjs +45 -0
- package/src/refractor/visitors/json-schema/bases.mjs +39 -0
- package/src/refractor/visitors/json-schema/bases.ts +70 -0
- package/src/refractor/visitors/json-schema/index.cjs +65 -0
- package/src/refractor/visitors/json-schema/index.mjs +59 -0
- package/src/refractor/visitors/json-schema/index.ts +85 -0
- package/src/refractor/visitors/json-schema/json-reference/$RefVisitor.cjs +16 -0
- package/src/refractor/visitors/json-schema/json-reference/$RefVisitor.mjs +11 -0
- package/src/refractor/visitors/json-schema/json-reference/$RefVisitor.ts +20 -0
- package/src/refractor/visitors/json-schema/json-reference/index.cjs +33 -0
- package/src/refractor/visitors/json-schema/json-reference/index.mjs +27 -0
- package/src/refractor/visitors/json-schema/json-reference/index.ts +41 -0
- package/src/refractor/visitors/json-schema/link-description/index.cjs +23 -0
- package/src/refractor/visitors/json-schema/link-description/index.mjs +17 -0
- package/src/refractor/visitors/json-schema/link-description/index.ts +30 -0
- package/src/refractor/visitors/json-schema/media/index.cjs +23 -0
- package/src/refractor/visitors/json-schema/media/index.mjs +17 -0
- package/src/refractor/visitors/json-schema/media/index.ts +29 -0
|
@@ -0,0 +1,292 @@
|
|
|
1
|
+
import { ObjectElement } from '@speclynx/apidom-datamodel';
|
|
2
|
+
/**
|
|
3
|
+
* @public
|
|
4
|
+
*/
|
|
5
|
+
class JSONSchema extends ObjectElement {
|
|
6
|
+
constructor(content, meta, attributes) {
|
|
7
|
+
super(content, meta, attributes);
|
|
8
|
+
this.element = 'JSONSchemaDraft4';
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Core vocabulary
|
|
13
|
+
*
|
|
14
|
+
* URI: https://tools.ietf.org/html/draft-wright-json-schema-00
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
get idField() {
|
|
18
|
+
return this.get('id');
|
|
19
|
+
}
|
|
20
|
+
set idField(idField) {
|
|
21
|
+
this.set('id', idField);
|
|
22
|
+
}
|
|
23
|
+
get $schema() {
|
|
24
|
+
return this.get('$schema');
|
|
25
|
+
}
|
|
26
|
+
set $schema($schema) {
|
|
27
|
+
this.set('$schema', $schema);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Validation vocabulary
|
|
32
|
+
*
|
|
33
|
+
* URI: https://tools.ietf.org/html/draft-wright-json-schema-validation-00
|
|
34
|
+
*/
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Validation keywords for numeric instances (number and integer)
|
|
38
|
+
*/
|
|
39
|
+
|
|
40
|
+
get multipleOf() {
|
|
41
|
+
return this.get('multipleOf');
|
|
42
|
+
}
|
|
43
|
+
set multipleOf(multipleOf) {
|
|
44
|
+
this.set('multipleOf', multipleOf);
|
|
45
|
+
}
|
|
46
|
+
get maximum() {
|
|
47
|
+
return this.get('maximum');
|
|
48
|
+
}
|
|
49
|
+
set maximum(maximum) {
|
|
50
|
+
this.set('maximum', maximum);
|
|
51
|
+
}
|
|
52
|
+
get exclusiveMaximum() {
|
|
53
|
+
return this.get('exclusiveMaximum');
|
|
54
|
+
}
|
|
55
|
+
set exclusiveMaximum(exclusiveMaximum) {
|
|
56
|
+
this.set('exclusiveMaximum', exclusiveMaximum);
|
|
57
|
+
}
|
|
58
|
+
get minimum() {
|
|
59
|
+
return this.get('minimum');
|
|
60
|
+
}
|
|
61
|
+
set minimum(minimum) {
|
|
62
|
+
this.set('minimum', minimum);
|
|
63
|
+
}
|
|
64
|
+
get exclusiveMinimum() {
|
|
65
|
+
return this.get('exclusiveMinimum');
|
|
66
|
+
}
|
|
67
|
+
set exclusiveMinimum(exclusiveMinimum) {
|
|
68
|
+
this.set('exclusiveMinimum', exclusiveMinimum);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Validation keywords for strings
|
|
73
|
+
*/
|
|
74
|
+
|
|
75
|
+
get maxLength() {
|
|
76
|
+
return this.get('maxLength');
|
|
77
|
+
}
|
|
78
|
+
set maxLength(maxLength) {
|
|
79
|
+
this.set('maxLength', maxLength);
|
|
80
|
+
}
|
|
81
|
+
get minLength() {
|
|
82
|
+
return this.get('minLength');
|
|
83
|
+
}
|
|
84
|
+
set minLength(minLength) {
|
|
85
|
+
this.set('minLength', minLength);
|
|
86
|
+
}
|
|
87
|
+
get pattern() {
|
|
88
|
+
return this.get('pattern');
|
|
89
|
+
}
|
|
90
|
+
set pattern(pattern) {
|
|
91
|
+
this.set('pattern', pattern);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Validation keywords for arrays
|
|
96
|
+
*/
|
|
97
|
+
|
|
98
|
+
get additionalItems() {
|
|
99
|
+
return this.get('additionalItems');
|
|
100
|
+
}
|
|
101
|
+
set additionalItems(additionalItems) {
|
|
102
|
+
this.set('additionalItems', additionalItems);
|
|
103
|
+
}
|
|
104
|
+
get itemsField() {
|
|
105
|
+
return this.get('items');
|
|
106
|
+
}
|
|
107
|
+
set itemsField(items) {
|
|
108
|
+
this.set('items', items);
|
|
109
|
+
}
|
|
110
|
+
get maxItems() {
|
|
111
|
+
return this.get('maxItems');
|
|
112
|
+
}
|
|
113
|
+
set maxItems(maxItems) {
|
|
114
|
+
this.set('maxItems', maxItems);
|
|
115
|
+
}
|
|
116
|
+
get minItems() {
|
|
117
|
+
return this.get('minItems');
|
|
118
|
+
}
|
|
119
|
+
set minItems(minItems) {
|
|
120
|
+
this.set('minItems', minItems);
|
|
121
|
+
}
|
|
122
|
+
get uniqueItems() {
|
|
123
|
+
return this.get('uniqueItems');
|
|
124
|
+
}
|
|
125
|
+
set uniqueItems(uniqueItems) {
|
|
126
|
+
this.set('uniqueItems', uniqueItems);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* Validation keywords for objects
|
|
131
|
+
*/
|
|
132
|
+
|
|
133
|
+
get maxProperties() {
|
|
134
|
+
return this.get('maxProperties');
|
|
135
|
+
}
|
|
136
|
+
set maxProperties(maxProperties) {
|
|
137
|
+
this.set('maxProperties', maxProperties);
|
|
138
|
+
}
|
|
139
|
+
get minProperties() {
|
|
140
|
+
return this.get('minProperties');
|
|
141
|
+
}
|
|
142
|
+
set minProperties(minProperties) {
|
|
143
|
+
this.set('minProperties', minProperties);
|
|
144
|
+
}
|
|
145
|
+
get required() {
|
|
146
|
+
return this.get('required');
|
|
147
|
+
}
|
|
148
|
+
set required(required) {
|
|
149
|
+
this.set('required', required);
|
|
150
|
+
}
|
|
151
|
+
get properties() {
|
|
152
|
+
return this.get('properties');
|
|
153
|
+
}
|
|
154
|
+
set properties(properties) {
|
|
155
|
+
this.set('properties', properties);
|
|
156
|
+
}
|
|
157
|
+
get additionalProperties() {
|
|
158
|
+
return this.get('additionalProperties');
|
|
159
|
+
}
|
|
160
|
+
set additionalProperties(additionalProperties) {
|
|
161
|
+
this.set('additionalProperties', additionalProperties);
|
|
162
|
+
}
|
|
163
|
+
get patternProperties() {
|
|
164
|
+
return this.get('patternProperties');
|
|
165
|
+
}
|
|
166
|
+
set patternProperties(patternProperties) {
|
|
167
|
+
this.set('patternProperties', patternProperties);
|
|
168
|
+
}
|
|
169
|
+
get dependencies() {
|
|
170
|
+
return this.get('dependencies');
|
|
171
|
+
}
|
|
172
|
+
set dependencies(dependencies) {
|
|
173
|
+
this.set('dependencies', dependencies);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* Validation keywords for any instance type
|
|
178
|
+
*/
|
|
179
|
+
|
|
180
|
+
get enum() {
|
|
181
|
+
return this.get('enum');
|
|
182
|
+
}
|
|
183
|
+
set enum(enumValue) {
|
|
184
|
+
this.set('enum', enumValue);
|
|
185
|
+
}
|
|
186
|
+
get type() {
|
|
187
|
+
return this.get('type');
|
|
188
|
+
}
|
|
189
|
+
set type(type) {
|
|
190
|
+
this.set('type', type);
|
|
191
|
+
}
|
|
192
|
+
get allOf() {
|
|
193
|
+
return this.get('allOf');
|
|
194
|
+
}
|
|
195
|
+
set allOf(allOf) {
|
|
196
|
+
this.set('allOf', allOf);
|
|
197
|
+
}
|
|
198
|
+
get anyOf() {
|
|
199
|
+
return this.get('anyOf');
|
|
200
|
+
}
|
|
201
|
+
set anyOf(anyOf) {
|
|
202
|
+
this.set('anyOf', anyOf);
|
|
203
|
+
}
|
|
204
|
+
get oneOf() {
|
|
205
|
+
return this.get('oneOf');
|
|
206
|
+
}
|
|
207
|
+
set oneOf(oneOf) {
|
|
208
|
+
this.set('oneOf', oneOf);
|
|
209
|
+
}
|
|
210
|
+
get not() {
|
|
211
|
+
return this.get('not');
|
|
212
|
+
}
|
|
213
|
+
set not(not) {
|
|
214
|
+
this.set('not', not);
|
|
215
|
+
}
|
|
216
|
+
get definitions() {
|
|
217
|
+
return this.get('definitions');
|
|
218
|
+
}
|
|
219
|
+
set definitions(definitions) {
|
|
220
|
+
this.set('definitions', definitions);
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
/**
|
|
224
|
+
* Metadata keywords
|
|
225
|
+
*
|
|
226
|
+
* URI: https://datatracker.ietf.org/doc/html/draft-wright-json-schema-validation-00#section-6
|
|
227
|
+
*/
|
|
228
|
+
|
|
229
|
+
get title() {
|
|
230
|
+
return this.get('title');
|
|
231
|
+
}
|
|
232
|
+
set title(title) {
|
|
233
|
+
this.set('title', title);
|
|
234
|
+
}
|
|
235
|
+
get description() {
|
|
236
|
+
return this.get('description');
|
|
237
|
+
}
|
|
238
|
+
set description(description) {
|
|
239
|
+
this.set('description', description);
|
|
240
|
+
}
|
|
241
|
+
get default() {
|
|
242
|
+
return this.get('default');
|
|
243
|
+
}
|
|
244
|
+
set default(defaultValue) {
|
|
245
|
+
this.set('default', defaultValue);
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
/**
|
|
249
|
+
* Semantic validation with "format"
|
|
250
|
+
*
|
|
251
|
+
* URI: https://datatracker.ietf.org/doc/html/draft-wright-json-schema-validation-00#section-7
|
|
252
|
+
*/
|
|
253
|
+
|
|
254
|
+
get format() {
|
|
255
|
+
return this.get('format');
|
|
256
|
+
}
|
|
257
|
+
set format(format) {
|
|
258
|
+
this.set('format', format);
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
/**
|
|
262
|
+
* JSON Hyper-Schema
|
|
263
|
+
*
|
|
264
|
+
* URI: https://datatracker.ietf.org/doc/html/draft-wright-json-schema-hyperschema-00
|
|
265
|
+
*/
|
|
266
|
+
|
|
267
|
+
get base() {
|
|
268
|
+
return this.get('base');
|
|
269
|
+
}
|
|
270
|
+
set base(base) {
|
|
271
|
+
this.set('base', base);
|
|
272
|
+
}
|
|
273
|
+
get linksField() {
|
|
274
|
+
return this.get('links');
|
|
275
|
+
}
|
|
276
|
+
set linksField(links) {
|
|
277
|
+
this.set('links', links);
|
|
278
|
+
}
|
|
279
|
+
get media() {
|
|
280
|
+
return this.get('media');
|
|
281
|
+
}
|
|
282
|
+
set media(media) {
|
|
283
|
+
this.set('media', media);
|
|
284
|
+
}
|
|
285
|
+
get readOnly() {
|
|
286
|
+
return this.get('readOnly');
|
|
287
|
+
}
|
|
288
|
+
set readOnly(readOnly) {
|
|
289
|
+
this.set('readOnly', readOnly);
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
export default JSONSchema;
|
|
@@ -0,0 +1,391 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Element,
|
|
3
|
+
ArrayElement,
|
|
4
|
+
NumberElement,
|
|
5
|
+
ObjectElement,
|
|
6
|
+
StringElement,
|
|
7
|
+
BooleanElement,
|
|
8
|
+
Attributes,
|
|
9
|
+
Meta,
|
|
10
|
+
} from '@speclynx/apidom-datamodel';
|
|
11
|
+
|
|
12
|
+
import JSONReferenceElement from './JSONReference.ts';
|
|
13
|
+
import MediaElement from './Media.ts';
|
|
14
|
+
import LinkDescriptionElement from './LinkDescription.ts';
|
|
15
|
+
import type { FixedField } from '../refractor/inspect.ts';
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* @public
|
|
19
|
+
*/
|
|
20
|
+
class JSONSchema extends ObjectElement {
|
|
21
|
+
declare static fixedFields: FixedField[];
|
|
22
|
+
|
|
23
|
+
constructor(content?: Record<string, unknown>, meta?: Meta, attributes?: Attributes) {
|
|
24
|
+
super(content, meta, attributes);
|
|
25
|
+
this.element = 'JSONSchemaDraft4';
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Core vocabulary
|
|
30
|
+
*
|
|
31
|
+
* URI: https://tools.ietf.org/html/draft-wright-json-schema-00
|
|
32
|
+
*/
|
|
33
|
+
|
|
34
|
+
get idField(): StringElement | undefined {
|
|
35
|
+
return this.get('id') as StringElement | undefined;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
set idField(idField: StringElement | undefined) {
|
|
39
|
+
this.set('id', idField);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
get $schema(): StringElement | undefined {
|
|
43
|
+
return this.get('$schema') as StringElement | undefined;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
set $schema($schema: StringElement | undefined) {
|
|
47
|
+
this.set('$schema', $schema);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Validation vocabulary
|
|
52
|
+
*
|
|
53
|
+
* URI: https://tools.ietf.org/html/draft-wright-json-schema-validation-00
|
|
54
|
+
*/
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Validation keywords for numeric instances (number and integer)
|
|
58
|
+
*/
|
|
59
|
+
|
|
60
|
+
get multipleOf(): NumberElement | undefined {
|
|
61
|
+
return this.get('multipleOf') as NumberElement | undefined;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
set multipleOf(multipleOf: NumberElement | undefined) {
|
|
65
|
+
this.set('multipleOf', multipleOf);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
get maximum(): NumberElement | undefined {
|
|
69
|
+
return this.get('maximum') as NumberElement | undefined;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
set maximum(maximum: NumberElement | undefined) {
|
|
73
|
+
this.set('maximum', maximum);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
get exclusiveMaximum(): BooleanElement | undefined {
|
|
77
|
+
return this.get('exclusiveMaximum') as BooleanElement | undefined;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
set exclusiveMaximum(exclusiveMaximum: BooleanElement | undefined) {
|
|
81
|
+
this.set('exclusiveMaximum', exclusiveMaximum);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
get minimum(): NumberElement | undefined {
|
|
85
|
+
return this.get('minimum') as NumberElement | undefined;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
set minimum(minimum: NumberElement | undefined) {
|
|
89
|
+
this.set('minimum', minimum);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
get exclusiveMinimum(): BooleanElement | undefined {
|
|
93
|
+
return this.get('exclusiveMinimum') as BooleanElement | undefined;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
set exclusiveMinimum(exclusiveMinimum: BooleanElement | undefined) {
|
|
97
|
+
this.set('exclusiveMinimum', exclusiveMinimum);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Validation keywords for strings
|
|
102
|
+
*/
|
|
103
|
+
|
|
104
|
+
get maxLength(): NumberElement | undefined {
|
|
105
|
+
return this.get('maxLength') as NumberElement | undefined;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
set maxLength(maxLength: NumberElement | undefined) {
|
|
109
|
+
this.set('maxLength', maxLength);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
get minLength(): NumberElement | undefined {
|
|
113
|
+
return this.get('minLength') as NumberElement | undefined;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
set minLength(minLength: NumberElement | undefined) {
|
|
117
|
+
this.set('minLength', minLength);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
get pattern(): StringElement | undefined {
|
|
121
|
+
return this.get('pattern') as StringElement | undefined;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
set pattern(pattern: StringElement | undefined) {
|
|
125
|
+
this.set('pattern', pattern);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* Validation keywords for arrays
|
|
130
|
+
*/
|
|
131
|
+
|
|
132
|
+
get additionalItems(): this | JSONReferenceElement | BooleanElement | undefined {
|
|
133
|
+
return this.get('additionalItems') as this | JSONReferenceElement | BooleanElement | undefined;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
set additionalItems(additionalItems: this | JSONReferenceElement | BooleanElement | undefined) {
|
|
137
|
+
this.set('additionalItems', additionalItems);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
get itemsField():
|
|
141
|
+
| this
|
|
142
|
+
| JSONReferenceElement
|
|
143
|
+
| ArrayElement<this | JSONReferenceElement>
|
|
144
|
+
| undefined {
|
|
145
|
+
return this.get('items') as
|
|
146
|
+
| this
|
|
147
|
+
| JSONReferenceElement
|
|
148
|
+
| ArrayElement<this | JSONReferenceElement>
|
|
149
|
+
| undefined;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
set itemsField(
|
|
153
|
+
items: this | JSONReferenceElement | ArrayElement<this | JSONReferenceElement> | undefined,
|
|
154
|
+
) {
|
|
155
|
+
this.set('items', items);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
get maxItems(): NumberElement | undefined {
|
|
159
|
+
return this.get('maxItems') as NumberElement | undefined;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
set maxItems(maxItems: NumberElement | undefined) {
|
|
163
|
+
this.set('maxItems', maxItems);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
get minItems(): NumberElement | undefined {
|
|
167
|
+
return this.get('minItems') as NumberElement | undefined;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
set minItems(minItems: NumberElement | undefined) {
|
|
171
|
+
this.set('minItems', minItems);
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
get uniqueItems(): BooleanElement | undefined {
|
|
175
|
+
return this.get('uniqueItems') as BooleanElement | undefined;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
set uniqueItems(uniqueItems: BooleanElement | undefined) {
|
|
179
|
+
this.set('uniqueItems', uniqueItems);
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
/**
|
|
183
|
+
* Validation keywords for objects
|
|
184
|
+
*/
|
|
185
|
+
|
|
186
|
+
get maxProperties(): NumberElement | undefined {
|
|
187
|
+
return this.get('maxProperties') as NumberElement | undefined;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
set maxProperties(maxProperties: NumberElement | undefined) {
|
|
191
|
+
this.set('maxProperties', maxProperties);
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
get minProperties(): NumberElement | undefined {
|
|
195
|
+
return this.get('minProperties') as NumberElement | undefined;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
set minProperties(minProperties: NumberElement | undefined) {
|
|
199
|
+
this.set('minProperties', minProperties);
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
get required(): ArrayElement<StringElement> | undefined {
|
|
203
|
+
return this.get('required') as ArrayElement<StringElement> | undefined;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
set required(required: ArrayElement<StringElement> | undefined) {
|
|
207
|
+
this.set('required', required);
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
get properties(): ObjectElement | undefined {
|
|
211
|
+
return this.get('properties') as ObjectElement | undefined;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
set properties(properties: ObjectElement | undefined) {
|
|
215
|
+
this.set('properties', properties);
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
get additionalProperties(): this | JSONReferenceElement | BooleanElement | undefined {
|
|
219
|
+
return this.get('additionalProperties') as
|
|
220
|
+
| this
|
|
221
|
+
| JSONReferenceElement
|
|
222
|
+
| BooleanElement
|
|
223
|
+
| undefined;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
set additionalProperties(
|
|
227
|
+
additionalProperties: this | JSONReferenceElement | BooleanElement | undefined,
|
|
228
|
+
) {
|
|
229
|
+
this.set('additionalProperties', additionalProperties);
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
get patternProperties(): ObjectElement | undefined {
|
|
233
|
+
return this.get('patternProperties') as ObjectElement | undefined;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
set patternProperties(patternProperties: ObjectElement | undefined) {
|
|
237
|
+
this.set('patternProperties', patternProperties);
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
get dependencies(): ObjectElement | undefined {
|
|
241
|
+
return this.get('dependencies') as ObjectElement | undefined;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
set dependencies(dependencies: ObjectElement | undefined) {
|
|
245
|
+
this.set('dependencies', dependencies);
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
/**
|
|
249
|
+
* Validation keywords for any instance type
|
|
250
|
+
*/
|
|
251
|
+
|
|
252
|
+
get enum(): ArrayElement<Element> | undefined {
|
|
253
|
+
return this.get('enum') as ArrayElement<Element> | undefined;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
set enum(enumValue: ArrayElement<Element> | undefined) {
|
|
257
|
+
this.set('enum', enumValue);
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
get type(): ArrayElement<StringElement> | StringElement | undefined {
|
|
261
|
+
return this.get('type') as ArrayElement<StringElement> | StringElement | undefined;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
set type(type: ArrayElement<StringElement> | StringElement | undefined) {
|
|
265
|
+
this.set('type', type);
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
get allOf(): ArrayElement<this | JSONReferenceElement> | undefined {
|
|
269
|
+
return this.get('allOf') as ArrayElement<this | JSONReferenceElement> | undefined;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
set allOf(allOf: ArrayElement<this | JSONReferenceElement> | undefined) {
|
|
273
|
+
this.set('allOf', allOf);
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
get anyOf(): ArrayElement<this | JSONReferenceElement> | undefined {
|
|
277
|
+
return this.get('anyOf') as ArrayElement<this | JSONReferenceElement> | undefined;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
set anyOf(anyOf: ArrayElement<this | JSONReferenceElement> | undefined) {
|
|
281
|
+
this.set('anyOf', anyOf);
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
get oneOf(): ArrayElement<this | JSONReferenceElement> | undefined {
|
|
285
|
+
return this.get('oneOf') as ArrayElement<this | JSONReferenceElement> | undefined;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
set oneOf(oneOf: ArrayElement<this | JSONReferenceElement> | undefined) {
|
|
289
|
+
this.set('oneOf', oneOf);
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
get not(): this | JSONReferenceElement | undefined {
|
|
293
|
+
return this.get('not') as this | JSONReferenceElement | undefined;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
set not(not: this | JSONReferenceElement | undefined) {
|
|
297
|
+
this.set('not', not);
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
get definitions(): ObjectElement | undefined {
|
|
301
|
+
return this.get('definitions') as ObjectElement | undefined;
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
set definitions(definitions: ObjectElement | undefined) {
|
|
305
|
+
this.set('definitions', definitions);
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
/**
|
|
309
|
+
* Metadata keywords
|
|
310
|
+
*
|
|
311
|
+
* URI: https://datatracker.ietf.org/doc/html/draft-wright-json-schema-validation-00#section-6
|
|
312
|
+
*/
|
|
313
|
+
|
|
314
|
+
get title(): StringElement | undefined {
|
|
315
|
+
return this.get('title') as StringElement | undefined;
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
set title(title: StringElement | undefined) {
|
|
319
|
+
this.set('title', title);
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
get description(): StringElement | undefined {
|
|
323
|
+
return this.get('description') as StringElement | undefined;
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
set description(description: StringElement | undefined) {
|
|
327
|
+
this.set('description', description);
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
get default(): Element | undefined {
|
|
331
|
+
return this.get('default') as Element | undefined;
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
set default(defaultValue: Element | undefined) {
|
|
335
|
+
this.set('default', defaultValue);
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
/**
|
|
339
|
+
* Semantic validation with "format"
|
|
340
|
+
*
|
|
341
|
+
* URI: https://datatracker.ietf.org/doc/html/draft-wright-json-schema-validation-00#section-7
|
|
342
|
+
*/
|
|
343
|
+
|
|
344
|
+
get format(): StringElement | undefined {
|
|
345
|
+
return this.get('format') as StringElement | undefined;
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
set format(format: StringElement | undefined) {
|
|
349
|
+
this.set('format', format);
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
/**
|
|
353
|
+
* JSON Hyper-Schema
|
|
354
|
+
*
|
|
355
|
+
* URI: https://datatracker.ietf.org/doc/html/draft-wright-json-schema-hyperschema-00
|
|
356
|
+
*/
|
|
357
|
+
|
|
358
|
+
get base(): StringElement | undefined {
|
|
359
|
+
return this.get('base') as StringElement | undefined;
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
set base(base: StringElement | undefined) {
|
|
363
|
+
this.set('base', base);
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
get linksField(): ArrayElement<LinkDescriptionElement> | undefined {
|
|
367
|
+
return this.get('links') as ArrayElement<LinkDescriptionElement> | undefined;
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
set linksField(links: ArrayElement<LinkDescriptionElement> | undefined) {
|
|
371
|
+
this.set('links', links);
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
get media(): MediaElement | undefined {
|
|
375
|
+
return this.get('media') as MediaElement | undefined;
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
set media(media: MediaElement | undefined) {
|
|
379
|
+
this.set('media', media);
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
get readOnly(): BooleanElement | undefined {
|
|
383
|
+
return this.get('readOnly') as BooleanElement | undefined;
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
set readOnly(readOnly: BooleanElement | undefined) {
|
|
387
|
+
this.set('readOnly', readOnly);
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
export default JSONSchema;
|