@swagger-api/apidom-ns-openapi-3-1 1.0.0-beta.9 → 1.0.0-rc.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 +187 -0
- package/README.md +371 -1
- package/dist/apidom-ns-openapi-3-1.browser.js +29414 -24750
- package/dist/apidom-ns-openapi-3-1.browser.min.js +1 -1
- package/package.json +10 -9
- package/src/elements/Schema.cjs +2 -427
- package/src/elements/Schema.mjs +2 -427
- package/src/index.cjs +3 -1
- package/src/index.mjs +1 -0
- package/src/refractor/plugins/normalize-discriminator-mapping.cjs +173 -0
- package/src/refractor/plugins/normalize-discriminator-mapping.mjs +167 -0
- package/src/refractor/plugins/replace-empty-element.cjs +2 -1
- package/src/refractor/plugins/replace-empty-element.mjs +3 -2
- package/src/refractor/specification.cjs +55 -157
- package/src/refractor/specification.mjs +13 -115
- package/src/refractor/toolbox.cjs +2 -2
- package/src/refractor/toolbox.mjs +1 -1
- package/src/refractor/visitors/open-api-3-1/components/SchemasVisitor.cjs +13 -0
- package/src/refractor/visitors/open-api-3-1/components/SchemasVisitor.mjs +13 -2
- package/src/refractor/visitors/open-api-3-1/schema/$defsVisitor.cjs +2 -10
- package/src/refractor/visitors/open-api-3-1/schema/$defsVisitor.mjs +4 -9
- package/src/refractor/visitors/open-api-3-1/schema/AllOfVisitor.cjs +2 -25
- package/src/refractor/visitors/open-api-3-1/schema/AllOfVisitor.mjs +2 -23
- package/src/refractor/visitors/open-api-3-1/schema/AnyOfVisitor.cjs +2 -25
- package/src/refractor/visitors/open-api-3-1/schema/AnyOfVisitor.mjs +2 -23
- package/src/refractor/visitors/open-api-3-1/schema/DependentSchemasVisitor.cjs +2 -14
- package/src/refractor/visitors/open-api-3-1/schema/DependentSchemasVisitor.mjs +2 -12
- package/src/refractor/visitors/open-api-3-1/schema/OneOfVisitor.cjs +2 -25
- package/src/refractor/visitors/open-api-3-1/schema/OneOfVisitor.mjs +2 -23
- package/src/refractor/visitors/open-api-3-1/schema/PatternPropertiesVisitor.cjs +2 -14
- package/src/refractor/visitors/open-api-3-1/schema/PatternPropertiesVisitor.mjs +2 -12
- package/src/refractor/visitors/open-api-3-1/schema/PrefixItemsVisitor.cjs +2 -25
- package/src/refractor/visitors/open-api-3-1/schema/PrefixItemsVisitor.mjs +2 -23
- package/src/refractor/visitors/open-api-3-1/schema/PropertiesVisitor.cjs +2 -14
- package/src/refractor/visitors/open-api-3-1/schema/PropertiesVisitor.mjs +2 -12
- package/src/refractor/visitors/open-api-3-1/schema/index.cjs +10 -31
- package/src/refractor/visitors/open-api-3-1/schema/index.mjs +12 -33
- package/types/apidom-ns-openapi-3-1.d.ts +183 -408
- package/src/refractor/visitors/open-api-3-1/schema/$refVisitor.cjs +0 -16
- package/src/refractor/visitors/open-api-3-1/schema/$refVisitor.mjs +0 -12
- package/src/refractor/visitors/open-api-3-1/schema/$vocabularyVisitor.cjs +0 -16
- package/src/refractor/visitors/open-api-3-1/schema/$vocabularyVisitor.mjs +0 -12
- package/src/refractor/visitors/open-api-3-1/schema/DependentRequiredVisitor.cjs +0 -16
- package/src/refractor/visitors/open-api-3-1/schema/DependentRequiredVisitor.mjs +0 -12
- package/src/refractor/visitors/open-api-3-1/schema/EnumVisitor.cjs +0 -16
- package/src/refractor/visitors/open-api-3-1/schema/EnumVisitor.mjs +0 -12
- package/src/refractor/visitors/open-api-3-1/schema/ExamplesVisitor.cjs +0 -16
- package/src/refractor/visitors/open-api-3-1/schema/ExamplesVisitor.mjs +0 -12
- package/src/refractor/visitors/open-api-3-1/schema/ParentSchemaAwareVisitor.cjs +0 -17
- package/src/refractor/visitors/open-api-3-1/schema/ParentSchemaAwareVisitor.mjs +0 -13
- package/src/refractor/visitors/open-api-3-1/schema/RequiredVisitor.cjs +0 -16
- package/src/refractor/visitors/open-api-3-1/schema/RequiredVisitor.mjs +0 -12
- package/src/refractor/visitors/open-api-3-1/schema/TypeVisitor.cjs +0 -21
- package/src/refractor/visitors/open-api-3-1/schema/TypeVisitor.mjs +0 -17
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { specificationObj as OpenApi3_0Specification } from '@swagger-api/apidom-ns-openapi-3-0';
|
|
2
|
+
import { specificationObj as JSONSchema202012Specification } from '@swagger-api/apidom-ns-json-schema-2020-12';
|
|
2
3
|
import OpenApi3_1Visitor from "./visitors/open-api-3-1/index.mjs";
|
|
3
4
|
import InfoVisitor from "./visitors/open-api-3-1/info/index.mjs";
|
|
4
5
|
import ContactVisitor from "./visitors/open-api-3-1/contact/index.mjs";
|
|
@@ -15,8 +16,6 @@ import ReferenceVisitor from "./visitors/open-api-3-1/reference/index.mjs";
|
|
|
15
16
|
import ParameterVisitor from "./visitors/open-api-3-1/parameter/index.mjs";
|
|
16
17
|
import HeaderVisitor from "./visitors/open-api-3-1/header/index.mjs";
|
|
17
18
|
import SchemaVisitor from "./visitors/open-api-3-1/schema/index.mjs";
|
|
18
|
-
import Schema$vocabularyVisitor from "./visitors/open-api-3-1/schema/$vocabularyVisitor.mjs";
|
|
19
|
-
import Schema$refVisitor from "./visitors/open-api-3-1/schema/$refVisitor.mjs";
|
|
20
19
|
import Schema$defsVisitor from "./visitors/open-api-3-1/schema/$defsVisitor.mjs";
|
|
21
20
|
import SchemaAllOfVisitor from "./visitors/open-api-3-1/schema/AllOfVisitor.mjs";
|
|
22
21
|
import SchemaAnyOfVisitor from "./visitors/open-api-3-1/schema/AnyOfVisitor.mjs";
|
|
@@ -25,10 +24,6 @@ import SchemaDependantSchemasVisitor from "./visitors/open-api-3-1/schema/Depend
|
|
|
25
24
|
import SchemaPrefixItemsVisitor from "./visitors/open-api-3-1/schema/PrefixItemsVisitor.mjs";
|
|
26
25
|
import SchemaPropertiesVisitor from "./visitors/open-api-3-1/schema/PropertiesVisitor.mjs";
|
|
27
26
|
import SchemaPatternPropertiesVisitor from "./visitors/open-api-3-1/schema/PatternPropertiesVisitor.mjs";
|
|
28
|
-
import SchemaTypeVisitor from "./visitors/open-api-3-1/schema/TypeVisitor.mjs";
|
|
29
|
-
import SchemaEnumVisitor from "./visitors/open-api-3-1/schema/EnumVisitor.mjs";
|
|
30
|
-
import SchemaDependentRequiredVisitor from "./visitors/open-api-3-1/schema/DependentRequiredVisitor.mjs";
|
|
31
|
-
import SchemaExamplesVisitor from "./visitors/open-api-3-1/schema/ExamplesVisitor.mjs";
|
|
32
27
|
import DiscriminatorVisitor from "./visitors/open-api-3-1/distriminator/index.mjs";
|
|
33
28
|
import XmlVisitor from "./visitors/open-api-3-1/xml/index.mjs";
|
|
34
29
|
import ComponentsSchemasVisitor from "./visitors/open-api-3-1/components/SchemasVisitor.mjs";
|
|
@@ -47,6 +42,11 @@ import SecuritySchemeVisitor from "./visitors/open-api-3-1/security-scheme/index
|
|
|
47
42
|
import OAuthFlowsVisitor from "./visitors/open-api-3-1/oauth-flows/index.mjs";
|
|
48
43
|
import OAuthFlowVisitor from "./visitors/open-api-3-1/oauth-flow/index.mjs";
|
|
49
44
|
import WebhooksVisitor from "./visitors/open-api-3-1/WebhooksVisitor.mjs";
|
|
45
|
+
const {
|
|
46
|
+
JSONSchema: JSONSchemaVisitor,
|
|
47
|
+
LinkDescription: LinkDescriptionVisitor
|
|
48
|
+
} = JSONSchema202012Specification.visitors.document.objects;
|
|
49
|
+
|
|
50
50
|
/**
|
|
51
51
|
* Specification object allows us to have complete control over visitors
|
|
52
52
|
* when traversing the ApiDOM.
|
|
@@ -345,31 +345,18 @@ const specification = {
|
|
|
345
345
|
}
|
|
346
346
|
}
|
|
347
347
|
},
|
|
348
|
+
JSONSchema: {
|
|
349
|
+
$ref: '#/visitors/document/objects/Schema'
|
|
350
|
+
},
|
|
351
|
+
LinkDescription: {
|
|
352
|
+
...LinkDescriptionVisitor
|
|
353
|
+
},
|
|
348
354
|
Schema: {
|
|
349
355
|
$visitor: SchemaVisitor,
|
|
350
356
|
fixedFields: {
|
|
357
|
+
...JSONSchemaVisitor.fixedFields,
|
|
351
358
|
// core vocabulary
|
|
352
|
-
$schema: {
|
|
353
|
-
$ref: '#/visitors/value'
|
|
354
|
-
},
|
|
355
|
-
$vocabulary: Schema$vocabularyVisitor,
|
|
356
|
-
$id: {
|
|
357
|
-
$ref: '#/visitors/value'
|
|
358
|
-
},
|
|
359
|
-
$anchor: {
|
|
360
|
-
$ref: '#/visitors/value'
|
|
361
|
-
},
|
|
362
|
-
$dynamicAnchor: {
|
|
363
|
-
$ref: '#/visitors/value'
|
|
364
|
-
},
|
|
365
|
-
$dynamicRef: {
|
|
366
|
-
$ref: '#/visitors/value'
|
|
367
|
-
},
|
|
368
|
-
$ref: Schema$refVisitor,
|
|
369
359
|
$defs: Schema$defsVisitor,
|
|
370
|
-
$comment: {
|
|
371
|
-
$ref: '#/visitors/value'
|
|
372
|
-
},
|
|
373
360
|
// applicator vocabulary
|
|
374
361
|
allOf: SchemaAllOfVisitor,
|
|
375
362
|
anyOf: SchemaAnyOfVisitor,
|
|
@@ -410,96 +397,7 @@ const specification = {
|
|
|
410
397
|
$ref: '#/visitors/document/objects/Schema'
|
|
411
398
|
},
|
|
412
399
|
// validation vocabulary
|
|
413
|
-
// validation Keywords for Any Instance Type
|
|
414
|
-
type: SchemaTypeVisitor,
|
|
415
|
-
enum: SchemaEnumVisitor,
|
|
416
|
-
const: {
|
|
417
|
-
$ref: '#/visitors/value'
|
|
418
|
-
},
|
|
419
|
-
// validation Keywords for Numeric Instances (number and integer)
|
|
420
|
-
multipleOf: {
|
|
421
|
-
$ref: '#/visitors/value'
|
|
422
|
-
},
|
|
423
|
-
maximum: {
|
|
424
|
-
$ref: '#/visitors/value'
|
|
425
|
-
},
|
|
426
|
-
exclusiveMaximum: {
|
|
427
|
-
$ref: '#/visitors/value'
|
|
428
|
-
},
|
|
429
|
-
minimum: {
|
|
430
|
-
$ref: '#/visitors/value'
|
|
431
|
-
},
|
|
432
|
-
exclusiveMinimum: {
|
|
433
|
-
$ref: '#/visitors/value'
|
|
434
|
-
},
|
|
435
|
-
// validation Keywords for Strings
|
|
436
|
-
maxLength: {
|
|
437
|
-
$ref: '#/visitors/value'
|
|
438
|
-
},
|
|
439
|
-
minLength: {
|
|
440
|
-
$ref: '#/visitors/value'
|
|
441
|
-
},
|
|
442
|
-
pattern: {
|
|
443
|
-
$ref: '#/visitors/value'
|
|
444
|
-
},
|
|
445
|
-
// validation Keywords for Arrays
|
|
446
|
-
maxItems: {
|
|
447
|
-
$ref: '#/visitors/value'
|
|
448
|
-
},
|
|
449
|
-
minItems: {
|
|
450
|
-
$ref: '#/visitors/value'
|
|
451
|
-
},
|
|
452
|
-
uniqueItems: {
|
|
453
|
-
$ref: '#/visitors/value'
|
|
454
|
-
},
|
|
455
|
-
maxContains: {
|
|
456
|
-
$ref: '#/visitors/value'
|
|
457
|
-
},
|
|
458
|
-
minContains: {
|
|
459
|
-
$ref: '#/visitors/value'
|
|
460
|
-
},
|
|
461
|
-
// validation Keywords for Objects
|
|
462
|
-
maxProperties: {
|
|
463
|
-
$ref: '#/visitors/value'
|
|
464
|
-
},
|
|
465
|
-
minProperties: {
|
|
466
|
-
$ref: '#/visitors/value'
|
|
467
|
-
},
|
|
468
|
-
required: {
|
|
469
|
-
$ref: '#/visitors/value'
|
|
470
|
-
},
|
|
471
|
-
dependentRequired: SchemaDependentRequiredVisitor,
|
|
472
|
-
// basic Meta-Data Annotations vocabulary
|
|
473
|
-
title: {
|
|
474
|
-
$ref: '#/visitors/value'
|
|
475
|
-
},
|
|
476
|
-
description: {
|
|
477
|
-
$ref: '#/visitors/value'
|
|
478
|
-
},
|
|
479
|
-
default: {
|
|
480
|
-
$ref: '#/visitors/value'
|
|
481
|
-
},
|
|
482
|
-
deprecated: {
|
|
483
|
-
$ref: '#/visitors/value'
|
|
484
|
-
},
|
|
485
|
-
readOnly: {
|
|
486
|
-
$ref: '#/visitors/value'
|
|
487
|
-
},
|
|
488
|
-
writeOnly: {
|
|
489
|
-
$ref: '#/visitors/value'
|
|
490
|
-
},
|
|
491
|
-
examples: SchemaExamplesVisitor,
|
|
492
|
-
// semantic Content With "format" vocabulary
|
|
493
|
-
format: {
|
|
494
|
-
$ref: '#/visitors/value'
|
|
495
|
-
},
|
|
496
400
|
// contents of String-Encoded Data vocabulary
|
|
497
|
-
contentEncoding: {
|
|
498
|
-
$ref: '#/visitors/value'
|
|
499
|
-
},
|
|
500
|
-
contentMediaType: {
|
|
501
|
-
$ref: '#/visitors/value'
|
|
502
|
-
},
|
|
503
401
|
contentSchema: {
|
|
504
402
|
$ref: '#/visitors/document/objects/Schema'
|
|
505
403
|
},
|
|
@@ -5,7 +5,7 @@ var _interopRequireWildcard = require("@babel/runtime-corejs3/helpers/interopReq
|
|
|
5
5
|
exports.__esModule = true;
|
|
6
6
|
exports.default = exports.ancestorLineageToJSONPointer = void 0;
|
|
7
7
|
var _apidomCore = require("@swagger-api/apidom-core");
|
|
8
|
-
var
|
|
8
|
+
var _modern = require("@swagger-api/apidom-json-pointer/modern");
|
|
9
9
|
var _apidomNsOpenapi = require("@swagger-api/apidom-ns-openapi-3-0");
|
|
10
10
|
var openApi3_1Predicates = _interopRequireWildcard(require("../predicates.cjs"));
|
|
11
11
|
var _namespace = _interopRequireDefault(require("../namespace.cjs"));
|
|
@@ -41,7 +41,7 @@ const ancestorLineageToJSONPointer = elementPath => {
|
|
|
41
41
|
}
|
|
42
42
|
return path;
|
|
43
43
|
}, []);
|
|
44
|
-
return (0,
|
|
44
|
+
return (0, _modern.compile)(jsonPointerTokens);
|
|
45
45
|
};
|
|
46
46
|
|
|
47
47
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { isElement, isStringElement, isArrayElement, isObjectElement, isMemberElement, toValue, createNamespace, includesClasses, hasElementSourceMap } from '@swagger-api/apidom-core';
|
|
2
|
-
import { compile as compileJSONPointerTokens } from '@swagger-api/apidom-json-pointer';
|
|
2
|
+
import { compile as compileJSONPointerTokens } from '@swagger-api/apidom-json-pointer/modern';
|
|
3
3
|
import { isServersElement } from '@swagger-api/apidom-ns-openapi-3-0';
|
|
4
4
|
import * as openApi3_1Predicates from "../predicates.mjs";
|
|
5
5
|
import openApi3_1Namespace from "../namespace.mjs";
|
|
@@ -4,7 +4,9 @@ exports.__esModule = true;
|
|
|
4
4
|
exports.default = void 0;
|
|
5
5
|
var _tsMixer = require("ts-mixer");
|
|
6
6
|
var _ramda = require("ramda");
|
|
7
|
+
var _apidomCore = require("@swagger-api/apidom-core");
|
|
7
8
|
var _apidomNsOpenapi = require("@swagger-api/apidom-ns-openapi-3-0");
|
|
9
|
+
var _predicates = require("../../../../predicates.cjs");
|
|
8
10
|
/**
|
|
9
11
|
* @public
|
|
10
12
|
*/
|
|
@@ -18,5 +20,16 @@ class SchemasVisitor extends (0, _tsMixer.Mixin)(_apidomNsOpenapi.MapVisitor, _a
|
|
|
18
20
|
this.element = new _apidomNsOpenapi.ComponentsSchemasElement();
|
|
19
21
|
this.specPath = (0, _ramda.always)(['document', 'objects', 'Schema']);
|
|
20
22
|
}
|
|
23
|
+
ObjectElement(objectElement) {
|
|
24
|
+
const result = _apidomNsOpenapi.MapVisitor.prototype.ObjectElement.call(this, objectElement);
|
|
25
|
+
|
|
26
|
+
// decorate Schemas elements with Schema name
|
|
27
|
+
this.element.filter(_predicates.isSchemaElement)
|
|
28
|
+
// @ts-ignore
|
|
29
|
+
.forEach((schemaElement, schemaName) => {
|
|
30
|
+
schemaElement.setMetaProperty('schemaName', (0, _apidomCore.toValue)(schemaName));
|
|
31
|
+
});
|
|
32
|
+
return result;
|
|
33
|
+
}
|
|
21
34
|
}
|
|
22
35
|
var _default = exports.default = SchemasVisitor;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { Mixin } from 'ts-mixer';
|
|
2
2
|
import { always } from 'ramda';
|
|
3
|
+
import { toValue } from '@swagger-api/apidom-core';
|
|
3
4
|
import { ComponentsSchemasElement, MapVisitor, FallbackVisitor } from '@swagger-api/apidom-ns-openapi-3-0';
|
|
4
|
-
|
|
5
|
+
import { isSchemaElement } from "../../../../predicates.mjs";
|
|
5
6
|
/**
|
|
6
7
|
* @public
|
|
7
8
|
*/
|
|
8
|
-
|
|
9
9
|
/**
|
|
10
10
|
* @public
|
|
11
11
|
*/
|
|
@@ -15,5 +15,16 @@ class SchemasVisitor extends Mixin(MapVisitor, FallbackVisitor) {
|
|
|
15
15
|
this.element = new ComponentsSchemasElement();
|
|
16
16
|
this.specPath = always(['document', 'objects', 'Schema']);
|
|
17
17
|
}
|
|
18
|
+
ObjectElement(objectElement) {
|
|
19
|
+
const result = MapVisitor.prototype.ObjectElement.call(this, objectElement);
|
|
20
|
+
|
|
21
|
+
// decorate Schemas elements with Schema name
|
|
22
|
+
this.element.filter(isSchemaElement)
|
|
23
|
+
// @ts-ignore
|
|
24
|
+
.forEach((schemaElement, schemaName) => {
|
|
25
|
+
schemaElement.setMetaProperty('schemaName', toValue(schemaName));
|
|
26
|
+
});
|
|
27
|
+
return result;
|
|
28
|
+
}
|
|
18
29
|
}
|
|
19
30
|
export default SchemasVisitor;
|
|
@@ -1,13 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault").default;
|
|
4
3
|
exports.__esModule = true;
|
|
5
4
|
exports.default = void 0;
|
|
6
|
-
var
|
|
7
|
-
var _ramda = require("ramda");
|
|
8
|
-
var _apidomCore = require("@swagger-api/apidom-core");
|
|
9
|
-
var _apidomNsOpenapi = require("@swagger-api/apidom-ns-openapi-3-0");
|
|
10
|
-
var _ParentSchemaAwareVisitor = _interopRequireDefault(require("./ParentSchemaAwareVisitor.cjs"));
|
|
5
|
+
var _apidomNsJsonSchema = require("@swagger-api/apidom-ns-json-schema-2020-12");
|
|
11
6
|
/**
|
|
12
7
|
* @public
|
|
13
8
|
*/
|
|
@@ -15,12 +10,9 @@ var _ParentSchemaAwareVisitor = _interopRequireDefault(require("./ParentSchemaAw
|
|
|
15
10
|
/**
|
|
16
11
|
* @public
|
|
17
12
|
*/
|
|
18
|
-
class $defsVisitor extends
|
|
13
|
+
class $defsVisitor extends _apidomNsJsonSchema.$defsVisitor {
|
|
19
14
|
constructor(options) {
|
|
20
15
|
super(options);
|
|
21
|
-
this.element = new _apidomCore.ObjectElement();
|
|
22
|
-
this.element.classes.push('json-schema-$defs');
|
|
23
|
-
this.specPath = (0, _ramda.always)(['document', 'objects', 'Schema']);
|
|
24
16
|
this.passingOptionsNames.push('parent');
|
|
25
17
|
}
|
|
26
18
|
}
|
|
@@ -1,20 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import { ObjectElement } from '@swagger-api/apidom-core';
|
|
4
|
-
import { FallbackVisitor, MapVisitor } from '@swagger-api/apidom-ns-openapi-3-0';
|
|
5
|
-
import ParentSchemaAwareVisitor from "./ParentSchemaAwareVisitor.mjs";
|
|
1
|
+
import { $defsVisitor as $defsJSONSchema202012Visitor } from '@swagger-api/apidom-ns-json-schema-2020-12';
|
|
2
|
+
|
|
6
3
|
/**
|
|
7
4
|
* @public
|
|
8
5
|
*/
|
|
6
|
+
|
|
9
7
|
/**
|
|
10
8
|
* @public
|
|
11
9
|
*/
|
|
12
|
-
class $defsVisitor extends
|
|
10
|
+
class $defsVisitor extends $defsJSONSchema202012Visitor {
|
|
13
11
|
constructor(options) {
|
|
14
12
|
super(options);
|
|
15
|
-
this.element = new ObjectElement();
|
|
16
|
-
this.element.classes.push('json-schema-$defs');
|
|
17
|
-
this.specPath = always(['document', 'objects', 'Schema']);
|
|
18
13
|
this.passingOptionsNames.push('parent');
|
|
19
14
|
}
|
|
20
15
|
}
|
|
@@ -1,38 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault").default;
|
|
4
3
|
exports.__esModule = true;
|
|
5
4
|
exports.default = void 0;
|
|
6
|
-
var
|
|
7
|
-
var _apidomCore = require("@swagger-api/apidom-core");
|
|
8
|
-
var _apidomNsOpenapi = require("@swagger-api/apidom-ns-openapi-3-0");
|
|
9
|
-
var _ParentSchemaAwareVisitor = _interopRequireDefault(require("./ParentSchemaAwareVisitor.cjs"));
|
|
5
|
+
var _apidomNsJsonSchema = require("@swagger-api/apidom-ns-json-schema-2020-12");
|
|
10
6
|
/**
|
|
11
7
|
* @public
|
|
12
8
|
*/
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* @public
|
|
16
|
-
*/
|
|
17
|
-
class AllOfVisitor extends (0, _tsMixer.Mixin)(_apidomNsOpenapi.SpecificationVisitor, _ParentSchemaAwareVisitor.default, _apidomNsOpenapi.FallbackVisitor) {
|
|
9
|
+
class AllOfVisitor extends _apidomNsJsonSchema.AllOfVisitor {
|
|
18
10
|
constructor(options) {
|
|
19
11
|
super(options);
|
|
20
|
-
this.element = new _apidomCore.ArrayElement();
|
|
21
|
-
this.element.classes.push('json-schema-allOf');
|
|
22
12
|
this.passingOptionsNames.push('parent');
|
|
23
13
|
}
|
|
24
|
-
ArrayElement(arrayElement) {
|
|
25
|
-
arrayElement.forEach(item => {
|
|
26
|
-
if ((0, _apidomCore.isObjectElement)(item)) {
|
|
27
|
-
const schemaElement = this.toRefractedElement(['document', 'objects', 'Schema'], item);
|
|
28
|
-
this.element.push(schemaElement);
|
|
29
|
-
} else {
|
|
30
|
-
const element = (0, _apidomCore.cloneDeep)(item);
|
|
31
|
-
this.element.push(element);
|
|
32
|
-
}
|
|
33
|
-
});
|
|
34
|
-
this.copyMetaAndAttributes(arrayElement, this.element);
|
|
35
|
-
return _apidomCore.BREAK;
|
|
36
|
-
}
|
|
37
14
|
}
|
|
38
15
|
var _default = exports.default = AllOfVisitor;
|
|
@@ -1,32 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ArrayElement, isObjectElement, BREAK, cloneDeep } from '@swagger-api/apidom-core';
|
|
3
|
-
import { FallbackVisitor, SpecificationVisitor } from '@swagger-api/apidom-ns-openapi-3-0';
|
|
4
|
-
import ParentSchemaAwareVisitor from "./ParentSchemaAwareVisitor.mjs";
|
|
1
|
+
import { AllOfVisitor as AllOfJSONSchema202012Options } from '@swagger-api/apidom-ns-json-schema-2020-12';
|
|
5
2
|
/**
|
|
6
3
|
* @public
|
|
7
4
|
*/
|
|
8
|
-
|
|
9
|
-
* @public
|
|
10
|
-
*/
|
|
11
|
-
class AllOfVisitor extends Mixin(SpecificationVisitor, ParentSchemaAwareVisitor, FallbackVisitor) {
|
|
5
|
+
class AllOfVisitor extends AllOfJSONSchema202012Options {
|
|
12
6
|
constructor(options) {
|
|
13
7
|
super(options);
|
|
14
|
-
this.element = new ArrayElement();
|
|
15
|
-
this.element.classes.push('json-schema-allOf');
|
|
16
8
|
this.passingOptionsNames.push('parent');
|
|
17
9
|
}
|
|
18
|
-
ArrayElement(arrayElement) {
|
|
19
|
-
arrayElement.forEach(item => {
|
|
20
|
-
if (isObjectElement(item)) {
|
|
21
|
-
const schemaElement = this.toRefractedElement(['document', 'objects', 'Schema'], item);
|
|
22
|
-
this.element.push(schemaElement);
|
|
23
|
-
} else {
|
|
24
|
-
const element = cloneDeep(item);
|
|
25
|
-
this.element.push(element);
|
|
26
|
-
}
|
|
27
|
-
});
|
|
28
|
-
this.copyMetaAndAttributes(arrayElement, this.element);
|
|
29
|
-
return BREAK;
|
|
30
|
-
}
|
|
31
10
|
}
|
|
32
11
|
export default AllOfVisitor;
|
|
@@ -1,38 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault").default;
|
|
4
3
|
exports.__esModule = true;
|
|
5
4
|
exports.default = void 0;
|
|
6
|
-
var
|
|
7
|
-
var _apidomCore = require("@swagger-api/apidom-core");
|
|
8
|
-
var _apidomNsOpenapi = require("@swagger-api/apidom-ns-openapi-3-0");
|
|
9
|
-
var _ParentSchemaAwareVisitor = _interopRequireDefault(require("./ParentSchemaAwareVisitor.cjs"));
|
|
5
|
+
var _apidomNsJsonSchema = require("@swagger-api/apidom-ns-json-schema-2020-12");
|
|
10
6
|
/**
|
|
11
7
|
* @public
|
|
12
8
|
*/
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* @public
|
|
16
|
-
*/
|
|
17
|
-
class AnyOfVisitor extends (0, _tsMixer.Mixin)(_apidomNsOpenapi.SpecificationVisitor, _ParentSchemaAwareVisitor.default, _apidomNsOpenapi.FallbackVisitor) {
|
|
9
|
+
class AnyOfVisitor extends _apidomNsJsonSchema.AnyOfVisitor {
|
|
18
10
|
constructor(options) {
|
|
19
11
|
super(options);
|
|
20
|
-
this.element = new _apidomCore.ArrayElement();
|
|
21
|
-
this.element.classes.push('json-schema-anyOf');
|
|
22
12
|
this.passingOptionsNames.push('parent');
|
|
23
13
|
}
|
|
24
|
-
ArrayElement(arrayElement) {
|
|
25
|
-
arrayElement.forEach(item => {
|
|
26
|
-
if ((0, _apidomCore.isObjectElement)(item)) {
|
|
27
|
-
const schemaElement = this.toRefractedElement(['document', 'objects', 'Schema'], item);
|
|
28
|
-
this.element.push(schemaElement);
|
|
29
|
-
} else {
|
|
30
|
-
const element = (0, _apidomCore.cloneDeep)(item);
|
|
31
|
-
this.element.push(element);
|
|
32
|
-
}
|
|
33
|
-
});
|
|
34
|
-
this.copyMetaAndAttributes(arrayElement, this.element);
|
|
35
|
-
return _apidomCore.BREAK;
|
|
36
|
-
}
|
|
37
14
|
}
|
|
38
15
|
var _default = exports.default = AnyOfVisitor;
|
|
@@ -1,32 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ArrayElement, isObjectElement, BREAK, cloneDeep } from '@swagger-api/apidom-core';
|
|
3
|
-
import { FallbackVisitor, SpecificationVisitor } from '@swagger-api/apidom-ns-openapi-3-0';
|
|
4
|
-
import ParentSchemaAwareVisitor from "./ParentSchemaAwareVisitor.mjs";
|
|
1
|
+
import { AnyOfVisitor as AnyOfJSONSchema202012Options } from '@swagger-api/apidom-ns-json-schema-2020-12';
|
|
5
2
|
/**
|
|
6
3
|
* @public
|
|
7
4
|
*/
|
|
8
|
-
|
|
9
|
-
* @public
|
|
10
|
-
*/
|
|
11
|
-
class AnyOfVisitor extends Mixin(SpecificationVisitor, ParentSchemaAwareVisitor, FallbackVisitor) {
|
|
5
|
+
class AnyOfVisitor extends AnyOfJSONSchema202012Options {
|
|
12
6
|
constructor(options) {
|
|
13
7
|
super(options);
|
|
14
|
-
this.element = new ArrayElement();
|
|
15
|
-
this.element.classes.push('json-schema-anyOf');
|
|
16
8
|
this.passingOptionsNames.push('parent');
|
|
17
9
|
}
|
|
18
|
-
ArrayElement(arrayElement) {
|
|
19
|
-
arrayElement.forEach(item => {
|
|
20
|
-
if (isObjectElement(item)) {
|
|
21
|
-
const schemaElement = this.toRefractedElement(['document', 'objects', 'Schema'], item);
|
|
22
|
-
this.element.push(schemaElement);
|
|
23
|
-
} else {
|
|
24
|
-
const element = cloneDeep(item);
|
|
25
|
-
this.element.push(element);
|
|
26
|
-
}
|
|
27
|
-
});
|
|
28
|
-
this.copyMetaAndAttributes(arrayElement, this.element);
|
|
29
|
-
return BREAK;
|
|
30
|
-
}
|
|
31
10
|
}
|
|
32
11
|
export default AnyOfVisitor;
|
|
@@ -1,26 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault").default;
|
|
4
3
|
exports.__esModule = true;
|
|
5
4
|
exports.default = void 0;
|
|
6
|
-
var
|
|
7
|
-
var _ramda = require("ramda");
|
|
8
|
-
var _apidomCore = require("@swagger-api/apidom-core");
|
|
9
|
-
var _apidomNsOpenapi = require("@swagger-api/apidom-ns-openapi-3-0");
|
|
10
|
-
var _ParentSchemaAwareVisitor = _interopRequireDefault(require("./ParentSchemaAwareVisitor.cjs"));
|
|
5
|
+
var _apidomNsJsonSchema = require("@swagger-api/apidom-ns-json-schema-2020-12");
|
|
11
6
|
/**
|
|
12
7
|
* @public
|
|
13
8
|
*/
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* @public
|
|
17
|
-
*/
|
|
18
|
-
class DependentSchemasVisitor extends (0, _tsMixer.Mixin)(_apidomNsOpenapi.MapVisitor, _ParentSchemaAwareVisitor.default, _apidomNsOpenapi.FallbackVisitor) {
|
|
9
|
+
class DependentSchemasVisitor extends _apidomNsJsonSchema.DependentSchemasVisitor {
|
|
19
10
|
constructor(options) {
|
|
20
11
|
super(options);
|
|
21
|
-
this.element = new _apidomCore.ObjectElement();
|
|
22
|
-
this.element.classes.push('json-schema-dependentSchemas');
|
|
23
|
-
this.specPath = (0, _ramda.always)(['document', 'objects', 'Schema']);
|
|
24
12
|
this.passingOptionsNames.push('parent');
|
|
25
13
|
}
|
|
26
14
|
}
|
|
@@ -1,20 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { always } from 'ramda';
|
|
3
|
-
import { ObjectElement } from '@swagger-api/apidom-core';
|
|
4
|
-
import { FallbackVisitor, MapVisitor } from '@swagger-api/apidom-ns-openapi-3-0';
|
|
5
|
-
import ParentSchemaAwareVisitor from "./ParentSchemaAwareVisitor.mjs";
|
|
1
|
+
import { DependentSchemasVisitor as DependentSchemaJSONSchema202012Visitor } from '@swagger-api/apidom-ns-json-schema-2020-12';
|
|
6
2
|
/**
|
|
7
3
|
* @public
|
|
8
4
|
*/
|
|
9
|
-
|
|
10
|
-
* @public
|
|
11
|
-
*/
|
|
12
|
-
class DependentSchemasVisitor extends Mixin(MapVisitor, ParentSchemaAwareVisitor, FallbackVisitor) {
|
|
5
|
+
class DependentSchemasVisitor extends DependentSchemaJSONSchema202012Visitor {
|
|
13
6
|
constructor(options) {
|
|
14
7
|
super(options);
|
|
15
|
-
this.element = new ObjectElement();
|
|
16
|
-
this.element.classes.push('json-schema-dependentSchemas');
|
|
17
|
-
this.specPath = always(['document', 'objects', 'Schema']);
|
|
18
8
|
this.passingOptionsNames.push('parent');
|
|
19
9
|
}
|
|
20
10
|
}
|
|
@@ -1,38 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault").default;
|
|
4
3
|
exports.__esModule = true;
|
|
5
4
|
exports.default = void 0;
|
|
6
|
-
var
|
|
7
|
-
var _apidomCore = require("@swagger-api/apidom-core");
|
|
8
|
-
var _apidomNsOpenapi = require("@swagger-api/apidom-ns-openapi-3-0");
|
|
9
|
-
var _ParentSchemaAwareVisitor = _interopRequireDefault(require("./ParentSchemaAwareVisitor.cjs"));
|
|
5
|
+
var _apidomNsJsonSchema = require("@swagger-api/apidom-ns-json-schema-2020-12");
|
|
10
6
|
/**
|
|
11
7
|
* @public
|
|
12
8
|
*/
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* @public
|
|
16
|
-
*/
|
|
17
|
-
class OneOfVisitor extends (0, _tsMixer.Mixin)(_apidomNsOpenapi.SpecificationVisitor, _ParentSchemaAwareVisitor.default, _apidomNsOpenapi.FallbackVisitor) {
|
|
9
|
+
class OneOfVisitor extends _apidomNsJsonSchema.OneOfVisitor {
|
|
18
10
|
constructor(options) {
|
|
19
11
|
super(options);
|
|
20
|
-
this.element = new _apidomCore.ArrayElement();
|
|
21
|
-
this.element.classes.push('json-schema-oneOf');
|
|
22
12
|
this.passingOptionsNames.push('parent');
|
|
23
13
|
}
|
|
24
|
-
ArrayElement(arrayElement) {
|
|
25
|
-
arrayElement.forEach(item => {
|
|
26
|
-
if ((0, _apidomCore.isObjectElement)(item)) {
|
|
27
|
-
const schemaElement = this.toRefractedElement(['document', 'objects', 'Schema'], item);
|
|
28
|
-
this.element.push(schemaElement);
|
|
29
|
-
} else {
|
|
30
|
-
const element = (0, _apidomCore.cloneDeep)(item);
|
|
31
|
-
this.element.push(element);
|
|
32
|
-
}
|
|
33
|
-
});
|
|
34
|
-
this.copyMetaAndAttributes(arrayElement, this.element);
|
|
35
|
-
return _apidomCore.BREAK;
|
|
36
|
-
}
|
|
37
14
|
}
|
|
38
15
|
var _default = exports.default = OneOfVisitor;
|
|
@@ -1,32 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ArrayElement, isObjectElement, BREAK, cloneDeep } from '@swagger-api/apidom-core';
|
|
3
|
-
import { FallbackVisitor, SpecificationVisitor } from '@swagger-api/apidom-ns-openapi-3-0';
|
|
4
|
-
import ParentSchemaAwareVisitor from "./ParentSchemaAwareVisitor.mjs";
|
|
1
|
+
import { OneOfVisitor as OneOfJSONSchema202012Options } from '@swagger-api/apidom-ns-json-schema-2020-12';
|
|
5
2
|
/**
|
|
6
3
|
* @public
|
|
7
4
|
*/
|
|
8
|
-
|
|
9
|
-
* @public
|
|
10
|
-
*/
|
|
11
|
-
class OneOfVisitor extends Mixin(SpecificationVisitor, ParentSchemaAwareVisitor, FallbackVisitor) {
|
|
5
|
+
class OneOfVisitor extends OneOfJSONSchema202012Options {
|
|
12
6
|
constructor(options) {
|
|
13
7
|
super(options);
|
|
14
|
-
this.element = new ArrayElement();
|
|
15
|
-
this.element.classes.push('json-schema-oneOf');
|
|
16
8
|
this.passingOptionsNames.push('parent');
|
|
17
9
|
}
|
|
18
|
-
ArrayElement(arrayElement) {
|
|
19
|
-
arrayElement.forEach(item => {
|
|
20
|
-
if (isObjectElement(item)) {
|
|
21
|
-
const schemaElement = this.toRefractedElement(['document', 'objects', 'Schema'], item);
|
|
22
|
-
this.element.push(schemaElement);
|
|
23
|
-
} else {
|
|
24
|
-
const element = cloneDeep(item);
|
|
25
|
-
this.element.push(element);
|
|
26
|
-
}
|
|
27
|
-
});
|
|
28
|
-
this.copyMetaAndAttributes(arrayElement, this.element);
|
|
29
|
-
return BREAK;
|
|
30
|
-
}
|
|
31
10
|
}
|
|
32
11
|
export default OneOfVisitor;
|
|
@@ -1,26 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault").default;
|
|
4
3
|
exports.__esModule = true;
|
|
5
4
|
exports.default = void 0;
|
|
6
|
-
var
|
|
7
|
-
var _ramda = require("ramda");
|
|
8
|
-
var _apidomCore = require("@swagger-api/apidom-core");
|
|
9
|
-
var _apidomNsOpenapi = require("@swagger-api/apidom-ns-openapi-3-0");
|
|
10
|
-
var _ParentSchemaAwareVisitor = _interopRequireDefault(require("./ParentSchemaAwareVisitor.cjs"));
|
|
5
|
+
var _apidomNsJsonSchema = require("@swagger-api/apidom-ns-json-schema-2020-12");
|
|
11
6
|
/**
|
|
12
7
|
* @public
|
|
13
8
|
*/
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* @public
|
|
17
|
-
*/
|
|
18
|
-
class PatternPropertiesVisitor extends (0, _tsMixer.Mixin)(_apidomNsOpenapi.MapVisitor, _ParentSchemaAwareVisitor.default, _apidomNsOpenapi.FallbackVisitor) {
|
|
9
|
+
class PatternPropertiesVisitor extends _apidomNsJsonSchema.PatternPropertiesVisitor {
|
|
19
10
|
constructor(options) {
|
|
20
11
|
super(options);
|
|
21
|
-
this.element = new _apidomCore.ObjectElement();
|
|
22
|
-
this.element.classes.push('json-schema-patternProperties');
|
|
23
|
-
this.specPath = (0, _ramda.always)(['document', 'objects', 'Schema']);
|
|
24
12
|
this.passingOptionsNames.push('parent');
|
|
25
13
|
}
|
|
26
14
|
}
|
|
@@ -1,20 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { always } from 'ramda';
|
|
3
|
-
import { ObjectElement } from '@swagger-api/apidom-core';
|
|
4
|
-
import { FallbackVisitor, MapVisitor } from '@swagger-api/apidom-ns-openapi-3-0';
|
|
5
|
-
import ParentSchemaAwareVisitor from "./ParentSchemaAwareVisitor.mjs";
|
|
1
|
+
import { PatternPropertiesVisitor as PatternPropertiesJSONSchema202012Visitor } from '@swagger-api/apidom-ns-json-schema-2020-12';
|
|
6
2
|
/**
|
|
7
3
|
* @public
|
|
8
4
|
*/
|
|
9
|
-
|
|
10
|
-
* @public
|
|
11
|
-
*/
|
|
12
|
-
class PatternPropertiesVisitor extends Mixin(MapVisitor, ParentSchemaAwareVisitor, FallbackVisitor) {
|
|
5
|
+
class PatternPropertiesVisitor extends PatternPropertiesJSONSchema202012Visitor {
|
|
13
6
|
constructor(options) {
|
|
14
7
|
super(options);
|
|
15
|
-
this.element = new ObjectElement();
|
|
16
|
-
this.element.classes.push('json-schema-patternProperties');
|
|
17
|
-
this.specPath = always(['document', 'objects', 'Schema']);
|
|
18
8
|
this.passingOptionsNames.push('parent');
|
|
19
9
|
}
|
|
20
10
|
}
|