@swagger-api/apidom-ns-openapi-3-0 0.77.0 → 0.78.0
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 +11 -0
- package/README.md +2 -2
- package/cjs/elements/Schema.cjs +64 -0
- package/cjs/refractor/specification.cjs +64 -50
- package/cjs/refractor/visitors/SpecificationVisitor.cjs +5 -1
- package/dist/apidom-ns-openapi-3-0.browser.js +4407 -16851
- package/dist/apidom-ns-openapi-3-0.browser.min.js +1 -1
- package/es/elements/Schema.mjs +65 -0
- package/es/refractor/specification.mjs +64 -50
- package/es/refractor/visitors/SpecificationVisitor.mjs +6 -2
- package/package.json +7 -6
- package/types/dist.d.ts +53 -56
- package/cjs/refractor/visitors/open-api-3-0/schema/DefinitionsVisitor.cjs +0 -24
- package/cjs/refractor/visitors/open-api-3-0/schema/DependenciesVisitor.cjs +0 -24
- package/cjs/refractor/visitors/open-api-3-0/schema/PatternPropertiesVisitor.cjs +0 -24
- package/cjs/refractor/visitors/open-api-3-0/schema/inherited-fixed-fields.cjs +0 -14
- package/es/refractor/visitors/open-api-3-0/schema/DefinitionsVisitor.mjs +0 -19
- package/es/refractor/visitors/open-api-3-0/schema/DependenciesVisitor.mjs +0 -19
- package/es/refractor/visitors/open-api-3-0/schema/PatternPropertiesVisitor.mjs +0 -19
- package/es/refractor/visitors/open-api-3-0/schema/inherited-fixed-fields.mjs +0 -9
package/es/elements/Schema.mjs
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import { UnsupportedOperationError } from '@swagger-api/apidom-error';
|
|
1
2
|
import { JSONSchemaElement } from '@swagger-api/apidom-ns-json-schema-draft-4';
|
|
3
|
+
/* eslint-disable class-methods-use-this */
|
|
2
4
|
class Schema extends JSONSchemaElement {
|
|
3
5
|
constructor(content, meta, attributes) {
|
|
4
6
|
super(content, meta, attributes);
|
|
@@ -6,6 +8,24 @@ class Schema extends JSONSchemaElement {
|
|
|
6
8
|
this.classes.push('json-schema-draft-4');
|
|
7
9
|
}
|
|
8
10
|
|
|
11
|
+
/**
|
|
12
|
+
* Core vocabulary
|
|
13
|
+
*
|
|
14
|
+
* URI: https://tools.ietf.org/html/draft-wright-json-schema-00
|
|
15
|
+
*/
|
|
16
|
+
get idProp() {
|
|
17
|
+
throw new UnsupportedOperationError('idProp getter in Schema class is not not supported.');
|
|
18
|
+
}
|
|
19
|
+
set idProp(idProps) {
|
|
20
|
+
throw new UnsupportedOperationError('idProp setter in Schema class is not not supported.');
|
|
21
|
+
}
|
|
22
|
+
get $schema() {
|
|
23
|
+
throw new UnsupportedOperationError('$schema getter in Schema class is not not supported.');
|
|
24
|
+
}
|
|
25
|
+
set $schema($schema) {
|
|
26
|
+
throw new UnsupportedOperationError('$schema setter in Schema class is not not supported.');
|
|
27
|
+
}
|
|
28
|
+
|
|
9
29
|
/**
|
|
10
30
|
* Validation keywords for arrays
|
|
11
31
|
*/
|
|
@@ -33,6 +53,18 @@ class Schema extends JSONSchemaElement {
|
|
|
33
53
|
set additionalProperties(additionalProperties) {
|
|
34
54
|
this.set('additionalProperties', additionalProperties);
|
|
35
55
|
}
|
|
56
|
+
get patternProperties() {
|
|
57
|
+
throw new UnsupportedOperationError('patternProperties getter in Schema class is not not supported.');
|
|
58
|
+
}
|
|
59
|
+
set patternProperties(patternProperties) {
|
|
60
|
+
throw new UnsupportedOperationError('patternProperties setter in Schema class is not not supported.');
|
|
61
|
+
}
|
|
62
|
+
get dependencies() {
|
|
63
|
+
throw new UnsupportedOperationError('dependencies getter in Schema class is not not supported.');
|
|
64
|
+
}
|
|
65
|
+
set dependencies(dependencies) {
|
|
66
|
+
throw new UnsupportedOperationError('dependencies setter in Schema class is not not supported.');
|
|
67
|
+
}
|
|
36
68
|
|
|
37
69
|
/**
|
|
38
70
|
* Validation keywords for any instance type
|
|
@@ -50,6 +82,37 @@ class Schema extends JSONSchemaElement {
|
|
|
50
82
|
set not(not) {
|
|
51
83
|
this.set('not', not);
|
|
52
84
|
}
|
|
85
|
+
get definitions() {
|
|
86
|
+
throw new UnsupportedOperationError('definitions getter in Schema class is not not supported.');
|
|
87
|
+
}
|
|
88
|
+
set definitions(definitions) {
|
|
89
|
+
throw new UnsupportedOperationError('definitions setter in Schema class is not not supported.');
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* JSON Hyper-Schema
|
|
94
|
+
*
|
|
95
|
+
* URI: https://datatracker.ietf.org/doc/html/draft-wright-json-schema-hyperschema-00
|
|
96
|
+
*/
|
|
97
|
+
|
|
98
|
+
get base() {
|
|
99
|
+
throw new UnsupportedOperationError('base getter in Schema class is not not supported.');
|
|
100
|
+
}
|
|
101
|
+
set base(base) {
|
|
102
|
+
throw new UnsupportedOperationError('base setter in Schema class is not not supported.');
|
|
103
|
+
}
|
|
104
|
+
get links() {
|
|
105
|
+
throw new UnsupportedOperationError('links getter in Schema class is not not supported.');
|
|
106
|
+
}
|
|
107
|
+
set links(links) {
|
|
108
|
+
throw new UnsupportedOperationError('links setter in Schema class is not not supported.');
|
|
109
|
+
}
|
|
110
|
+
get media() {
|
|
111
|
+
throw new UnsupportedOperationError('media getter in Schema class is not not supported.');
|
|
112
|
+
}
|
|
113
|
+
set media(media) {
|
|
114
|
+
throw new UnsupportedOperationError('media setter in Schema class is not not supported.');
|
|
115
|
+
}
|
|
53
116
|
|
|
54
117
|
/**
|
|
55
118
|
* OpenAPI vocabulary
|
|
@@ -98,4 +161,6 @@ class Schema extends JSONSchemaElement {
|
|
|
98
161
|
this.set('deprecated', deprecated);
|
|
99
162
|
}
|
|
100
163
|
}
|
|
164
|
+
/* eslint-disable class-methods-use-this */
|
|
165
|
+
|
|
101
166
|
export default Schema;
|
|
@@ -70,17 +70,14 @@ import SchemaVisitor from "./visitors/open-api-3-0/schema/index.mjs";
|
|
|
70
70
|
import SchemaAllOfVisitor from "./visitors/open-api-3-0/schema/AllOfVisitor.mjs";
|
|
71
71
|
import SchemaAnyOfVisitor from "./visitors/open-api-3-0/schema/AnyOfVisitor.mjs";
|
|
72
72
|
import SchemaOneOfVisitor from "./visitors/open-api-3-0/schema/OneOfVisitor.mjs";
|
|
73
|
-
import SchemaDefinitionsVisitor from "./visitors/open-api-3-0/schema/DefinitionsVisitor.mjs";
|
|
74
|
-
import SchemaDependenciesVisitor from "./visitors/open-api-3-0/schema/DependenciesVisitor.mjs";
|
|
75
73
|
import SchemaItemsVisitor from "./visitors/open-api-3-0/schema/ItemsVisitor.mjs";
|
|
76
74
|
import SchemaPropertiesVisitor from "./visitors/open-api-3-0/schema/PropertiesVisitor.mjs";
|
|
77
|
-
import SchemaPatternPropertiesVisitor from "./visitors/open-api-3-0/schema/PatternPropertiesVisitor.mjs";
|
|
78
75
|
import SchemaTypeVisitor from "./visitors/open-api-3-0/schema/TypeVisitor.mjs";
|
|
79
76
|
import SchemaNullableVisitor from "./visitors/open-api-3-0/schema/NullableVisitor.mjs";
|
|
80
77
|
import SchemaWriteOnlyVisitor from "./visitors/open-api-3-0/schema/WriteOnlyVisitor.mjs";
|
|
81
78
|
import SchemaExampleVisitor from "./visitors/open-api-3-0/schema/ExampleVisitor.mjs";
|
|
82
79
|
import SchemaDeprecatedVisitor from "./visitors/open-api-3-0/schema/DeprecatedVisitor.mjs";
|
|
83
|
-
import
|
|
80
|
+
import SchemaOrReferenceVisitor from "./visitors/open-api-3-0/schema/SchemaOrReferenceVisitor.mjs";
|
|
84
81
|
import DiscriminatorVisitor from "./visitors/open-api-3-0/distriminator/index.mjs";
|
|
85
82
|
import DiscriminatorPropertyNameVisitor from "./visitors/open-api-3-0/distriminator/PropertyNameVisitor.mjs";
|
|
86
83
|
import DiscriminatorMappingVisitor from "./visitors/open-api-3-0/distriminator/MappingVisitor.mjs";
|
|
@@ -169,46 +166,9 @@ import TagsVisitor from "./visitors/open-api-3-0/TagsVisitor.mjs";
|
|
|
169
166
|
*
|
|
170
167
|
* Note: Specification object allows to use absolute internal JSON pointers.
|
|
171
168
|
*/
|
|
172
|
-
const
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
$ref: Reference$RefVisitor
|
|
176
|
-
}
|
|
177
|
-
};
|
|
178
|
-
const SchemaSpecification = {
|
|
179
|
-
$visitor: SchemaVisitor,
|
|
180
|
-
fixedFields: {
|
|
181
|
-
...schemaInheritedFixedFields,
|
|
182
|
-
// validation vocabulary
|
|
183
|
-
// validation keywords for any instance type
|
|
184
|
-
allOf: SchemaAllOfVisitor,
|
|
185
|
-
anyOf: SchemaAnyOfVisitor,
|
|
186
|
-
oneOf: SchemaOneOfVisitor,
|
|
187
|
-
definitions: SchemaDefinitionsVisitor,
|
|
188
|
-
// validation keywords for arrays
|
|
189
|
-
items: SchemaItemsVisitor,
|
|
190
|
-
// Validation keywords for objects
|
|
191
|
-
dependencies: SchemaDependenciesVisitor,
|
|
192
|
-
properties: SchemaPropertiesVisitor,
|
|
193
|
-
patternProperties: SchemaPatternPropertiesVisitor,
|
|
194
|
-
// validation keywords for any instance type
|
|
195
|
-
type: SchemaTypeVisitor,
|
|
196
|
-
// OpenAPI vocabulary
|
|
197
|
-
nullable: SchemaNullableVisitor,
|
|
198
|
-
discriminator: {
|
|
199
|
-
$ref: '#/visitors/document/objects/Discriminator'
|
|
200
|
-
},
|
|
201
|
-
writeOnly: SchemaWriteOnlyVisitor,
|
|
202
|
-
xml: {
|
|
203
|
-
$ref: '#/visitors/document/objects/XML'
|
|
204
|
-
},
|
|
205
|
-
externalDocs: {
|
|
206
|
-
$ref: '#/visitors/document/objects/ExternalDocumentation'
|
|
207
|
-
},
|
|
208
|
-
example: SchemaExampleVisitor,
|
|
209
|
-
deprecated: SchemaDeprecatedVisitor
|
|
210
|
-
}
|
|
211
|
-
};
|
|
169
|
+
const {
|
|
170
|
+
fixedFields: jsonSchemaFixedFields
|
|
171
|
+
} = JSONSchemaDraft4Specification.visitors.document.objects.JSONSchema;
|
|
212
172
|
const specification = {
|
|
213
173
|
visitors: {
|
|
214
174
|
value: FallbackVisitor,
|
|
@@ -471,12 +431,66 @@ const specification = {
|
|
|
471
431
|
}
|
|
472
432
|
}
|
|
473
433
|
},
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
434
|
+
Reference: {
|
|
435
|
+
$visitor: ReferenceVisitor,
|
|
436
|
+
fixedFields: {
|
|
437
|
+
$ref: Reference$RefVisitor
|
|
438
|
+
}
|
|
439
|
+
},
|
|
440
|
+
JSONSchema: {
|
|
441
|
+
$ref: '#/visitors/document/objects/Schema'
|
|
442
|
+
},
|
|
443
|
+
JSONReference: {
|
|
444
|
+
$ref: '#/visitors/document/objects/Reference'
|
|
445
|
+
},
|
|
446
|
+
Schema: {
|
|
447
|
+
$visitor: SchemaVisitor,
|
|
448
|
+
fixedFields: {
|
|
449
|
+
// the following properties are taken directly from the JSON Schema definition and follow the same specifications
|
|
450
|
+
title: jsonSchemaFixedFields.title,
|
|
451
|
+
multipleOf: jsonSchemaFixedFields.multipleOf,
|
|
452
|
+
maximum: jsonSchemaFixedFields.maximum,
|
|
453
|
+
exclusiveMaximum: jsonSchemaFixedFields.exclusiveMaximum,
|
|
454
|
+
minimum: jsonSchemaFixedFields.minimum,
|
|
455
|
+
exclusiveMinimum: jsonSchemaFixedFields.exclusiveMinimum,
|
|
456
|
+
maxLength: jsonSchemaFixedFields.maxLength,
|
|
457
|
+
minLength: jsonSchemaFixedFields.minLength,
|
|
458
|
+
pattern: jsonSchemaFixedFields.pattern,
|
|
459
|
+
maxItems: jsonSchemaFixedFields.maxItems,
|
|
460
|
+
minItems: jsonSchemaFixedFields.minItems,
|
|
461
|
+
uniqueItems: jsonSchemaFixedFields.uniqueItems,
|
|
462
|
+
maxProperties: jsonSchemaFixedFields.maxProperties,
|
|
463
|
+
minProperties: jsonSchemaFixedFields.minProperties,
|
|
464
|
+
required: jsonSchemaFixedFields.required,
|
|
465
|
+
enum: jsonSchemaFixedFields.enum,
|
|
466
|
+
// the following properties are taken from the JSON Schema definition but their definitions were adjusted to the OpenAPI Specification
|
|
467
|
+
type: SchemaTypeVisitor,
|
|
468
|
+
allOf: SchemaAllOfVisitor,
|
|
469
|
+
anyOf: SchemaAnyOfVisitor,
|
|
470
|
+
oneOf: SchemaOneOfVisitor,
|
|
471
|
+
not: SchemaOrReferenceVisitor,
|
|
472
|
+
items: SchemaItemsVisitor,
|
|
473
|
+
properties: SchemaPropertiesVisitor,
|
|
474
|
+
additionalProperties: SchemaOrReferenceVisitor,
|
|
475
|
+
description: jsonSchemaFixedFields.description,
|
|
476
|
+
format: jsonSchemaFixedFields.format,
|
|
477
|
+
default: jsonSchemaFixedFields.default,
|
|
478
|
+
// OpenAPI vocabulary
|
|
479
|
+
nullable: SchemaNullableVisitor,
|
|
480
|
+
discriminator: {
|
|
481
|
+
$ref: '#/visitors/document/objects/Discriminator'
|
|
482
|
+
},
|
|
483
|
+
writeOnly: SchemaWriteOnlyVisitor,
|
|
484
|
+
xml: {
|
|
485
|
+
$ref: '#/visitors/document/objects/XML'
|
|
486
|
+
},
|
|
487
|
+
externalDocs: {
|
|
488
|
+
$ref: '#/visitors/document/objects/ExternalDocumentation'
|
|
489
|
+
},
|
|
490
|
+
example: SchemaExampleVisitor,
|
|
491
|
+
deprecated: SchemaDeprecatedVisitor
|
|
492
|
+
}
|
|
493
|
+
},
|
|
480
494
|
Discriminator: {
|
|
481
495
|
$visitor: DiscriminatorVisitor,
|
|
482
496
|
fixedFields: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import stampit from 'stampit';
|
|
2
|
-
import { pathSatisfies, path, pick
|
|
2
|
+
import { pathSatisfies, path, pick } from 'ramda';
|
|
3
3
|
import { isFunction, isUndefined } from 'ramda-adjunct';
|
|
4
4
|
import { visit, cloneDeep } from '@swagger-api/apidom-core';
|
|
5
5
|
import Visitor from "./Visitor.mjs";
|
|
@@ -32,7 +32,11 @@ const SpecificationVisitor = stampit(Visitor, {
|
|
|
32
32
|
return pick(this.passingOptionsNames, this);
|
|
33
33
|
},
|
|
34
34
|
retrieveFixedFields(specPath) {
|
|
35
|
-
|
|
35
|
+
const fixedFields = path(['visitors', ...specPath, 'fixedFields'], this.specObj);
|
|
36
|
+
if (typeof fixedFields === 'object' && fixedFields !== null) {
|
|
37
|
+
return Object.keys(fixedFields);
|
|
38
|
+
}
|
|
39
|
+
return [];
|
|
36
40
|
},
|
|
37
41
|
retrieveVisitor(specPath) {
|
|
38
42
|
if (pathSatisfies(isFunction, ['visitors', ...specPath], this.specObj)) {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@swagger-api/apidom-ns-openapi-3-0",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.78.0",
|
|
4
|
+
"description": "OpenAPI 3.0.x namespace for ApiDOM.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public",
|
|
7
7
|
"registry": "https://registry.npmjs.org"
|
|
@@ -42,9 +42,10 @@
|
|
|
42
42
|
"license": "Apache-2.0",
|
|
43
43
|
"dependencies": {
|
|
44
44
|
"@babel/runtime-corejs3": "^7.20.7",
|
|
45
|
-
"@swagger-api/apidom-core": "^0.
|
|
46
|
-
"@swagger-api/apidom-
|
|
47
|
-
"@
|
|
45
|
+
"@swagger-api/apidom-core": "^0.78.0",
|
|
46
|
+
"@swagger-api/apidom-error": "^0.78.0",
|
|
47
|
+
"@swagger-api/apidom-ns-json-schema-draft-4": "^0.78.0",
|
|
48
|
+
"@types/ramda": "~0.29.6",
|
|
48
49
|
"ramda": "~0.29.0",
|
|
49
50
|
"ramda-adjunct": "^4.1.1",
|
|
50
51
|
"stampit": "^4.3.2"
|
|
@@ -59,5 +60,5 @@
|
|
|
59
60
|
"README.md",
|
|
60
61
|
"CHANGELOG.md"
|
|
61
62
|
],
|
|
62
|
-
"gitHead": "
|
|
63
|
+
"gitHead": "d6587217f8a7bec5bbc49ca4dabff8d3d66e0913"
|
|
63
64
|
}
|
package/types/dist.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ export { isArrayElement, isBooleanElement, isElement, isLinkElement as isLinkPri
|
|
|
4
4
|
import * as minim from 'minim';
|
|
5
5
|
import * as stampit from 'stampit';
|
|
6
6
|
import stampit__default from 'stampit';
|
|
7
|
-
import { JSONSchemaElement } from '@swagger-api/apidom-ns-json-schema-draft-4';
|
|
7
|
+
import { JSONSchemaElement, MediaElement } from '@swagger-api/apidom-ns-json-schema-draft-4';
|
|
8
8
|
|
|
9
9
|
type Format = 'generic' | 'json' | 'yaml';
|
|
10
10
|
declare class OpenAPIMediaTypes extends MediaTypes<string> {
|
|
@@ -293,12 +293,6 @@ declare const specification: {
|
|
|
293
293
|
};
|
|
294
294
|
};
|
|
295
295
|
};
|
|
296
|
-
JSONReference: {
|
|
297
|
-
$visitor: stampit.default.Stamp<any>;
|
|
298
|
-
fixedFields: {
|
|
299
|
-
$ref: stampit.default.Stamp<any>;
|
|
300
|
-
};
|
|
301
|
-
};
|
|
302
296
|
Reference: {
|
|
303
297
|
$visitor: stampit.default.Stamp<any>;
|
|
304
298
|
fixedFields: {
|
|
@@ -306,44 +300,41 @@ declare const specification: {
|
|
|
306
300
|
};
|
|
307
301
|
};
|
|
308
302
|
JSONSchema: {
|
|
309
|
-
$
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
oneOf: stampit.default.Stamp<any>;
|
|
314
|
-
definitions: stampit.default.Stamp<any>;
|
|
315
|
-
items: stampit.default.Stamp<any>;
|
|
316
|
-
dependencies: stampit.default.Stamp<any>;
|
|
317
|
-
properties: stampit.default.Stamp<any>;
|
|
318
|
-
patternProperties: stampit.default.Stamp<any>;
|
|
319
|
-
type: stampit.default.Stamp<any>;
|
|
320
|
-
nullable: stampit.default.Stamp<any>;
|
|
321
|
-
discriminator: {
|
|
322
|
-
$ref: string;
|
|
323
|
-
};
|
|
324
|
-
writeOnly: stampit.default.Stamp<any>;
|
|
325
|
-
xml: {
|
|
326
|
-
$ref: string;
|
|
327
|
-
};
|
|
328
|
-
externalDocs: {
|
|
329
|
-
$ref: string;
|
|
330
|
-
};
|
|
331
|
-
example: stampit.default.Stamp<any>;
|
|
332
|
-
deprecated: stampit.default.Stamp<any>;
|
|
333
|
-
};
|
|
303
|
+
$ref: string;
|
|
304
|
+
};
|
|
305
|
+
JSONReference: {
|
|
306
|
+
$ref: string;
|
|
334
307
|
};
|
|
335
308
|
Schema: {
|
|
336
309
|
$visitor: stampit.default.Stamp<any>;
|
|
337
310
|
fixedFields: {
|
|
311
|
+
title: stampit.default.Stamp<any>;
|
|
312
|
+
multipleOf: stampit.default.Stamp<any>;
|
|
313
|
+
maximum: stampit.default.Stamp<any>;
|
|
314
|
+
exclusiveMaximum: stampit.default.Stamp<any>;
|
|
315
|
+
minimum: stampit.default.Stamp<any>;
|
|
316
|
+
exclusiveMinimum: stampit.default.Stamp<any>;
|
|
317
|
+
maxLength: stampit.default.Stamp<any>;
|
|
318
|
+
minLength: stampit.default.Stamp<any>;
|
|
319
|
+
pattern: stampit.default.Stamp<any>;
|
|
320
|
+
maxItems: stampit.default.Stamp<any>;
|
|
321
|
+
minItems: stampit.default.Stamp<any>;
|
|
322
|
+
uniqueItems: stampit.default.Stamp<any>;
|
|
323
|
+
maxProperties: stampit.default.Stamp<any>;
|
|
324
|
+
minProperties: stampit.default.Stamp<any>;
|
|
325
|
+
required: stampit.default.Stamp<any>;
|
|
326
|
+
enum: stampit.default.Stamp<any>;
|
|
327
|
+
type: stampit.default.Stamp<any>;
|
|
338
328
|
allOf: stampit.default.Stamp<any>;
|
|
339
329
|
anyOf: stampit.default.Stamp<any>;
|
|
340
330
|
oneOf: stampit.default.Stamp<any>;
|
|
341
|
-
|
|
331
|
+
not: stampit.default.Stamp<any>;
|
|
342
332
|
items: stampit.default.Stamp<any>;
|
|
343
|
-
dependencies: stampit.default.Stamp<any>;
|
|
344
333
|
properties: stampit.default.Stamp<any>;
|
|
345
|
-
|
|
346
|
-
|
|
334
|
+
additionalProperties: stampit.default.Stamp<any>;
|
|
335
|
+
description: stampit.default.Stamp<any>;
|
|
336
|
+
format: stampit.default.Stamp<any>;
|
|
337
|
+
default: stampit.default.Stamp<any>;
|
|
347
338
|
nullable: stampit.default.Stamp<any>;
|
|
348
339
|
discriminator: {
|
|
349
340
|
$ref: string;
|
|
@@ -359,26 +350,6 @@ declare const specification: {
|
|
|
359
350
|
deprecated: stampit.default.Stamp<any>;
|
|
360
351
|
};
|
|
361
352
|
};
|
|
362
|
-
LinkDescription: {
|
|
363
|
-
$visitor: stampit.default.Stamp<any>;
|
|
364
|
-
fixedFields: {
|
|
365
|
-
href: stampit.default.Stamp<any>;
|
|
366
|
-
rel: stampit.default.Stamp<any>;
|
|
367
|
-
title: stampit.default.Stamp<any>;
|
|
368
|
-
targetSchema: stampit.default.Stamp<any>;
|
|
369
|
-
mediaType: stampit.default.Stamp<any>;
|
|
370
|
-
method: stampit.default.Stamp<any>;
|
|
371
|
-
encType: stampit.default.Stamp<any>;
|
|
372
|
-
schema: stampit.default.Stamp<any>;
|
|
373
|
-
};
|
|
374
|
-
};
|
|
375
|
-
Media: {
|
|
376
|
-
$visitor: stampit.default.Stamp<any>;
|
|
377
|
-
fixedFields: {
|
|
378
|
-
binaryEncoding: stampit.default.Stamp<any>;
|
|
379
|
-
type: stampit.default.Stamp<any>;
|
|
380
|
-
};
|
|
381
|
-
};
|
|
382
353
|
Discriminator: {
|
|
383
354
|
$visitor: stampit.default.Stamp<any>;
|
|
384
355
|
fixedFields: {
|
|
@@ -779,6 +750,15 @@ declare class Xml extends ObjectElement {
|
|
|
779
750
|
|
|
780
751
|
declare class Schema extends JSONSchemaElement {
|
|
781
752
|
constructor(content?: Record<string, unknown>, meta?: Meta, attributes?: Attributes);
|
|
753
|
+
/**
|
|
754
|
+
* Core vocabulary
|
|
755
|
+
*
|
|
756
|
+
* URI: https://tools.ietf.org/html/draft-wright-json-schema-00
|
|
757
|
+
*/
|
|
758
|
+
get idProp(): StringElement | undefined;
|
|
759
|
+
set idProp(idProps: StringElement | undefined);
|
|
760
|
+
get $schema(): StringElement | undefined;
|
|
761
|
+
set $schema($schema: StringElement | undefined);
|
|
782
762
|
/**
|
|
783
763
|
* Validation keywords for arrays
|
|
784
764
|
*/
|
|
@@ -791,6 +771,10 @@ declare class Schema extends JSONSchemaElement {
|
|
|
791
771
|
*/
|
|
792
772
|
get additionalProperties(): this | Reference | BooleanElement | undefined;
|
|
793
773
|
set additionalProperties(additionalProperties: this | Reference | BooleanElement | undefined);
|
|
774
|
+
get patternProperties(): ObjectElement | undefined;
|
|
775
|
+
set patternProperties(patternProperties: ObjectElement | undefined);
|
|
776
|
+
get dependencies(): ObjectElement | undefined;
|
|
777
|
+
set dependencies(dependencies: ObjectElement | undefined);
|
|
794
778
|
/**
|
|
795
779
|
* Validation keywords for any instance type
|
|
796
780
|
*/
|
|
@@ -798,6 +782,19 @@ declare class Schema extends JSONSchemaElement {
|
|
|
798
782
|
set type(type: StringElement | undefined);
|
|
799
783
|
get not(): this | Reference | undefined;
|
|
800
784
|
set not(not: this | Reference | undefined);
|
|
785
|
+
get definitions(): ObjectElement | undefined;
|
|
786
|
+
set definitions(definitions: ObjectElement | undefined);
|
|
787
|
+
/**
|
|
788
|
+
* JSON Hyper-Schema
|
|
789
|
+
*
|
|
790
|
+
* URI: https://datatracker.ietf.org/doc/html/draft-wright-json-schema-hyperschema-00
|
|
791
|
+
*/
|
|
792
|
+
get base(): StringElement | undefined;
|
|
793
|
+
set base(base: StringElement | undefined);
|
|
794
|
+
get links(): ArrayElement | undefined;
|
|
795
|
+
set links(links: ArrayElement | undefined);
|
|
796
|
+
get media(): MediaElement | undefined;
|
|
797
|
+
set media(media: MediaElement | undefined);
|
|
801
798
|
/**
|
|
802
799
|
* OpenAPI vocabulary
|
|
803
800
|
*/
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault").default;
|
|
4
|
-
exports.__esModule = true;
|
|
5
|
-
exports.default = void 0;
|
|
6
|
-
var _stampit = _interopRequireDefault(require("stampit"));
|
|
7
|
-
var _apidomNsJsonSchemaDraft = require("@swagger-api/apidom-ns-json-schema-draft-4");
|
|
8
|
-
var _predicates = require("../../../../predicates.cjs");
|
|
9
|
-
const {
|
|
10
|
-
definitions: JSONSchemaDefinitionsVisitor
|
|
11
|
-
} = _apidomNsJsonSchemaDraft.specificationObj.visitors.document.objects.JSONSchema.fixedFields;
|
|
12
|
-
const DefinitionsVisitor = (0, _stampit.default)(JSONSchemaDefinitionsVisitor, {
|
|
13
|
-
methods: {
|
|
14
|
-
ObjectElement(objectElement) {
|
|
15
|
-
// @ts-ignore
|
|
16
|
-
const result = JSONSchemaDefinitionsVisitor.compose.methods.ObjectElement.call(this, objectElement);
|
|
17
|
-
this.element.filter(_predicates.isReferenceElement).forEach(referenceElement => {
|
|
18
|
-
referenceElement.setMetaProperty('referenced-element', 'schema');
|
|
19
|
-
});
|
|
20
|
-
return result;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
var _default = exports.default = DefinitionsVisitor;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault").default;
|
|
4
|
-
exports.__esModule = true;
|
|
5
|
-
exports.default = void 0;
|
|
6
|
-
var _stampit = _interopRequireDefault(require("stampit"));
|
|
7
|
-
var _apidomNsJsonSchemaDraft = require("@swagger-api/apidom-ns-json-schema-draft-4");
|
|
8
|
-
var _predicates = require("../../../../predicates.cjs");
|
|
9
|
-
const {
|
|
10
|
-
dependencies: JSONSchemaDependenciesVisitor
|
|
11
|
-
} = _apidomNsJsonSchemaDraft.specificationObj.visitors.document.objects.JSONSchema.fixedFields;
|
|
12
|
-
const DependenciesVisitor = (0, _stampit.default)(JSONSchemaDependenciesVisitor, {
|
|
13
|
-
methods: {
|
|
14
|
-
ObjectElement(objectElement) {
|
|
15
|
-
// @ts-ignore
|
|
16
|
-
const result = JSONSchemaDependenciesVisitor.compose.methods.ObjectElement.call(this, objectElement);
|
|
17
|
-
this.element.filter(_predicates.isReferenceElement).forEach(referenceElement => {
|
|
18
|
-
referenceElement.setMetaProperty('referenced-element', 'schema');
|
|
19
|
-
});
|
|
20
|
-
return result;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
var _default = exports.default = DependenciesVisitor;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault").default;
|
|
4
|
-
exports.__esModule = true;
|
|
5
|
-
exports.default = void 0;
|
|
6
|
-
var _stampit = _interopRequireDefault(require("stampit"));
|
|
7
|
-
var _apidomNsJsonSchemaDraft = require("@swagger-api/apidom-ns-json-schema-draft-4");
|
|
8
|
-
var _predicates = require("../../../../predicates.cjs");
|
|
9
|
-
const {
|
|
10
|
-
patternProperties: JSONSchemaPatternPropertiesVisitor
|
|
11
|
-
} = _apidomNsJsonSchemaDraft.specificationObj.visitors.document.objects.JSONSchema.fixedFields;
|
|
12
|
-
const PatternPropertiesVisitor = (0, _stampit.default)(JSONSchemaPatternPropertiesVisitor, {
|
|
13
|
-
methods: {
|
|
14
|
-
ObjectElement(objectElement) {
|
|
15
|
-
// @ts-ignore
|
|
16
|
-
const result = JSONSchemaPatternPropertiesVisitor.compose.methods.ObjectElement.call(this, objectElement);
|
|
17
|
-
this.element.filter(_predicates.isReferenceElement).forEach(referenceElement => {
|
|
18
|
-
referenceElement.setMetaProperty('referenced-element', 'schema');
|
|
19
|
-
});
|
|
20
|
-
return result;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
var _default = exports.default = PatternPropertiesVisitor;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault").default;
|
|
4
|
-
exports.__esModule = true;
|
|
5
|
-
exports.default = void 0;
|
|
6
|
-
var _apidomNsJsonSchemaDraft = require("@swagger-api/apidom-ns-json-schema-draft-4");
|
|
7
|
-
var _SchemaOrReferenceVisitor = _interopRequireDefault(require("./SchemaOrReferenceVisitor.cjs"));
|
|
8
|
-
const inheritedFixedFields = Object.fromEntries(Object.entries(_apidomNsJsonSchemaDraft.specificationObj.visitors.document.objects.JSONSchema.fixedFields).map(([fieldName, visitor]) => {
|
|
9
|
-
if (visitor === _apidomNsJsonSchemaDraft.specificationObj.visitors.JSONSchemaOrJSONReferenceVisitor) {
|
|
10
|
-
return [fieldName, _SchemaOrReferenceVisitor.default];
|
|
11
|
-
}
|
|
12
|
-
return [fieldName, visitor];
|
|
13
|
-
}));
|
|
14
|
-
var _default = exports.default = inheritedFixedFields;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import stampit from 'stampit';
|
|
2
|
-
import { specificationObj as JSONSchemaDraft4Specification } from '@swagger-api/apidom-ns-json-schema-draft-4';
|
|
3
|
-
import { isReferenceElement } from "../../../../predicates.mjs";
|
|
4
|
-
const {
|
|
5
|
-
definitions: JSONSchemaDefinitionsVisitor
|
|
6
|
-
} = JSONSchemaDraft4Specification.visitors.document.objects.JSONSchema.fixedFields;
|
|
7
|
-
const DefinitionsVisitor = stampit(JSONSchemaDefinitionsVisitor, {
|
|
8
|
-
methods: {
|
|
9
|
-
ObjectElement(objectElement) {
|
|
10
|
-
// @ts-ignore
|
|
11
|
-
const result = JSONSchemaDefinitionsVisitor.compose.methods.ObjectElement.call(this, objectElement);
|
|
12
|
-
this.element.filter(isReferenceElement).forEach(referenceElement => {
|
|
13
|
-
referenceElement.setMetaProperty('referenced-element', 'schema');
|
|
14
|
-
});
|
|
15
|
-
return result;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
export default DefinitionsVisitor;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import stampit from 'stampit';
|
|
2
|
-
import { specificationObj as JSONSchemaDraft4Specification } from '@swagger-api/apidom-ns-json-schema-draft-4';
|
|
3
|
-
import { isReferenceElement } from "../../../../predicates.mjs";
|
|
4
|
-
const {
|
|
5
|
-
dependencies: JSONSchemaDependenciesVisitor
|
|
6
|
-
} = JSONSchemaDraft4Specification.visitors.document.objects.JSONSchema.fixedFields;
|
|
7
|
-
const DependenciesVisitor = stampit(JSONSchemaDependenciesVisitor, {
|
|
8
|
-
methods: {
|
|
9
|
-
ObjectElement(objectElement) {
|
|
10
|
-
// @ts-ignore
|
|
11
|
-
const result = JSONSchemaDependenciesVisitor.compose.methods.ObjectElement.call(this, objectElement);
|
|
12
|
-
this.element.filter(isReferenceElement).forEach(referenceElement => {
|
|
13
|
-
referenceElement.setMetaProperty('referenced-element', 'schema');
|
|
14
|
-
});
|
|
15
|
-
return result;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
export default DependenciesVisitor;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import stampit from 'stampit';
|
|
2
|
-
import { specificationObj as JSONSchemaDraft4Specification } from '@swagger-api/apidom-ns-json-schema-draft-4';
|
|
3
|
-
import { isReferenceElement } from "../../../../predicates.mjs";
|
|
4
|
-
const {
|
|
5
|
-
patternProperties: JSONSchemaPatternPropertiesVisitor
|
|
6
|
-
} = JSONSchemaDraft4Specification.visitors.document.objects.JSONSchema.fixedFields;
|
|
7
|
-
const PatternPropertiesVisitor = stampit(JSONSchemaPatternPropertiesVisitor, {
|
|
8
|
-
methods: {
|
|
9
|
-
ObjectElement(objectElement) {
|
|
10
|
-
// @ts-ignore
|
|
11
|
-
const result = JSONSchemaPatternPropertiesVisitor.compose.methods.ObjectElement.call(this, objectElement);
|
|
12
|
-
this.element.filter(isReferenceElement).forEach(referenceElement => {
|
|
13
|
-
referenceElement.setMetaProperty('referenced-element', 'schema');
|
|
14
|
-
});
|
|
15
|
-
return result;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
export default PatternPropertiesVisitor;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { specificationObj as JSONSchemaDraft4Specification } from '@swagger-api/apidom-ns-json-schema-draft-4';
|
|
2
|
-
import SchemaOrReferenceVisitor from "./SchemaOrReferenceVisitor.mjs";
|
|
3
|
-
const inheritedFixedFields = Object.fromEntries(Object.entries(JSONSchemaDraft4Specification.visitors.document.objects.JSONSchema.fixedFields).map(([fieldName, visitor]) => {
|
|
4
|
-
if (visitor === JSONSchemaDraft4Specification.visitors.JSONSchemaOrJSONReferenceVisitor) {
|
|
5
|
-
return [fieldName, SchemaOrReferenceVisitor];
|
|
6
|
-
}
|
|
7
|
-
return [fieldName, visitor];
|
|
8
|
-
}));
|
|
9
|
-
export default inheritedFixedFields;
|