@swagger-api/apidom-ns-openapi-2 0.92.0 → 0.94.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 +8 -0
- package/cjs/refractor/index.cjs +5 -7
- package/cjs/refractor/visitors/FallbackVisitor.cjs +6 -8
- package/cjs/refractor/visitors/SpecificationExtensionVisitor.cjs +6 -9
- package/cjs/refractor/visitors/SpecificationVisitor.cjs +59 -61
- package/cjs/refractor/visitors/Visitor.cjs +12 -13
- package/cjs/refractor/visitors/generics/AlternatingVisitor.cjs +20 -16
- package/cjs/refractor/visitors/generics/FixedFieldsVisitor.cjs +44 -44
- package/cjs/refractor/visitors/generics/MapVisitor.cjs +5 -5
- package/cjs/refractor/visitors/generics/MixedFieldsVisitor.cjs +35 -30
- package/cjs/refractor/visitors/generics/PatternedFieldsVisitor.cjs +48 -46
- package/cjs/refractor/visitors/open-api-2/BasePathVisitor.cjs +6 -10
- package/cjs/refractor/visitors/open-api-2/ConsumesVisitor.cjs +8 -10
- package/cjs/refractor/visitors/open-api-2/HostVisitor.cjs +6 -10
- package/cjs/refractor/visitors/open-api-2/ProducesVisitor.cjs +8 -10
- package/cjs/refractor/visitors/open-api-2/SchemesVisitor.cjs +8 -10
- package/cjs/refractor/visitors/open-api-2/SecurityVisitor.cjs +15 -16
- package/cjs/refractor/visitors/open-api-2/SwaggerVisitor.cjs +10 -12
- package/cjs/refractor/visitors/open-api-2/TagsVisitor.cjs +16 -17
- package/cjs/refractor/visitors/open-api-2/contact/index.cjs +8 -9
- package/cjs/refractor/visitors/open-api-2/definitions/index.cjs +18 -20
- package/cjs/refractor/visitors/open-api-2/example/index.cjs +7 -8
- package/cjs/refractor/visitors/open-api-2/external-documentation/index.cjs +7 -8
- package/cjs/refractor/visitors/open-api-2/header/index.cjs +8 -9
- package/cjs/refractor/visitors/open-api-2/headers/index.cjs +7 -8
- package/cjs/refractor/visitors/open-api-2/index.cjs +8 -9
- package/cjs/refractor/visitors/open-api-2/info/VersionVisitor.cjs +7 -11
- package/cjs/refractor/visitors/open-api-2/info/index.cjs +8 -9
- package/cjs/refractor/visitors/open-api-2/items/index.cjs +10 -9
- package/cjs/refractor/visitors/open-api-2/license/index.cjs +8 -9
- package/cjs/refractor/visitors/open-api-2/operation/ConsumesVisitor.cjs +8 -10
- package/cjs/refractor/visitors/open-api-2/operation/ParametersVisitor.cjs +18 -19
- package/cjs/refractor/visitors/open-api-2/operation/ProducesVisitor.cjs +8 -10
- package/cjs/refractor/visitors/open-api-2/operation/SchemesVisitor.cjs +8 -10
- package/cjs/refractor/visitors/open-api-2/operation/SecurityVisitor.cjs +15 -16
- package/cjs/refractor/visitors/open-api-2/operation/TagsVisitor.cjs +8 -10
- package/cjs/refractor/visitors/open-api-2/operation/index.cjs +6 -7
- package/cjs/refractor/visitors/open-api-2/parameter/index.cjs +8 -9
- package/cjs/refractor/visitors/open-api-2/parameters-definitions/index.cjs +6 -7
- package/cjs/refractor/visitors/open-api-2/path-item/$RefVisitor.cjs +6 -10
- package/cjs/refractor/visitors/open-api-2/path-item/ParametersVisitor.cjs +18 -19
- package/cjs/refractor/visitors/open-api-2/path-item/index.cjs +21 -23
- package/cjs/refractor/visitors/open-api-2/paths/index.cjs +21 -22
- package/cjs/refractor/visitors/open-api-2/reference/$RefVisitor.cjs +6 -10
- package/cjs/refractor/visitors/open-api-2/reference/index.cjs +14 -18
- package/cjs/refractor/visitors/open-api-2/response/index.cjs +8 -9
- package/cjs/refractor/visitors/open-api-2/responses/DefaultVisitor.cjs +16 -18
- package/cjs/refractor/visitors/open-api-2/responses/index.cjs +28 -29
- package/cjs/refractor/visitors/open-api-2/responses-definitions/index.cjs +6 -7
- package/cjs/refractor/visitors/open-api-2/schema/AllOfVisitor.cjs +1 -3
- package/cjs/refractor/visitors/open-api-2/schema/ItemsVisitor.cjs +1 -3
- package/cjs/refractor/visitors/open-api-2/schema/PropertiesVisitor.cjs +1 -3
- package/cjs/refractor/visitors/open-api-2/schema/SchemaOrJSONReferenceVisitor.cjs +1 -3
- package/cjs/refractor/visitors/open-api-2/schema/index.cjs +8 -9
- package/cjs/refractor/visitors/open-api-2/scopes/index.cjs +7 -8
- package/cjs/refractor/visitors/open-api-2/security-definitions/index.cjs +7 -7
- package/cjs/refractor/visitors/open-api-2/security-requirement/index.cjs +6 -7
- package/cjs/refractor/visitors/open-api-2/security-scheme/index.cjs +8 -9
- package/cjs/refractor/visitors/open-api-2/tag/index.cjs +8 -9
- package/cjs/refractor/visitors/open-api-2/xml/index.cjs +8 -9
- package/dist/apidom-ns-openapi-2.browser.js +3421 -3248
- package/dist/apidom-ns-openapi-2.browser.min.js +1 -1
- package/es/refractor/index.mjs +5 -7
- package/es/refractor/visitors/FallbackVisitor.mjs +5 -8
- package/es/refractor/visitors/SpecificationExtensionVisitor.mjs +6 -9
- package/es/refractor/visitors/SpecificationVisitor.mjs +59 -62
- package/es/refractor/visitors/Visitor.mjs +12 -12
- package/es/refractor/visitors/generics/AlternatingVisitor.mjs +20 -16
- package/es/refractor/visitors/generics/FixedFieldsVisitor.mjs +44 -44
- package/es/refractor/visitors/generics/MapVisitor.mjs +5 -5
- package/es/refractor/visitors/generics/MixedFieldsVisitor.mjs +35 -30
- package/es/refractor/visitors/generics/PatternedFieldsVisitor.mjs +48 -46
- package/es/refractor/visitors/open-api-2/BasePathVisitor.mjs +6 -10
- package/es/refractor/visitors/open-api-2/ConsumesVisitor.mjs +8 -10
- package/es/refractor/visitors/open-api-2/HostVisitor.mjs +6 -10
- package/es/refractor/visitors/open-api-2/ProducesVisitor.mjs +8 -10
- package/es/refractor/visitors/open-api-2/SchemesVisitor.mjs +8 -10
- package/es/refractor/visitors/open-api-2/SecurityVisitor.mjs +15 -16
- package/es/refractor/visitors/open-api-2/SwaggerVisitor.mjs +10 -12
- package/es/refractor/visitors/open-api-2/TagsVisitor.mjs +16 -17
- package/es/refractor/visitors/open-api-2/contact/index.mjs +8 -9
- package/es/refractor/visitors/open-api-2/definitions/index.mjs +18 -20
- package/es/refractor/visitors/open-api-2/example/index.mjs +7 -8
- package/es/refractor/visitors/open-api-2/external-documentation/index.mjs +7 -8
- package/es/refractor/visitors/open-api-2/header/index.mjs +8 -9
- package/es/refractor/visitors/open-api-2/headers/index.mjs +7 -8
- package/es/refractor/visitors/open-api-2/index.mjs +8 -9
- package/es/refractor/visitors/open-api-2/info/VersionVisitor.mjs +7 -11
- package/es/refractor/visitors/open-api-2/info/index.mjs +8 -9
- package/es/refractor/visitors/open-api-2/items/index.mjs +10 -9
- package/es/refractor/visitors/open-api-2/license/index.mjs +8 -9
- package/es/refractor/visitors/open-api-2/operation/ConsumesVisitor.mjs +8 -10
- package/es/refractor/visitors/open-api-2/operation/ParametersVisitor.mjs +18 -19
- package/es/refractor/visitors/open-api-2/operation/ProducesVisitor.mjs +8 -10
- package/es/refractor/visitors/open-api-2/operation/SchemesVisitor.mjs +8 -10
- package/es/refractor/visitors/open-api-2/operation/SecurityVisitor.mjs +15 -16
- package/es/refractor/visitors/open-api-2/operation/TagsVisitor.mjs +8 -10
- package/es/refractor/visitors/open-api-2/operation/index.mjs +6 -7
- package/es/refractor/visitors/open-api-2/parameter/index.mjs +8 -9
- package/es/refractor/visitors/open-api-2/parameters-definitions/index.mjs +6 -7
- package/es/refractor/visitors/open-api-2/path-item/$RefVisitor.mjs +6 -10
- package/es/refractor/visitors/open-api-2/path-item/ParametersVisitor.mjs +18 -19
- package/es/refractor/visitors/open-api-2/path-item/index.mjs +21 -23
- package/es/refractor/visitors/open-api-2/paths/index.mjs +21 -22
- package/es/refractor/visitors/open-api-2/reference/$RefVisitor.mjs +6 -10
- package/es/refractor/visitors/open-api-2/reference/index.mjs +14 -18
- package/es/refractor/visitors/open-api-2/response/index.mjs +8 -9
- package/es/refractor/visitors/open-api-2/responses/DefaultVisitor.mjs +16 -18
- package/es/refractor/visitors/open-api-2/responses/index.mjs +28 -29
- package/es/refractor/visitors/open-api-2/responses-definitions/index.mjs +6 -7
- package/es/refractor/visitors/open-api-2/schema/AllOfVisitor.mjs +1 -2
- package/es/refractor/visitors/open-api-2/schema/ItemsVisitor.mjs +1 -2
- package/es/refractor/visitors/open-api-2/schema/PropertiesVisitor.mjs +1 -2
- package/es/refractor/visitors/open-api-2/schema/SchemaOrJSONReferenceVisitor.mjs +1 -2
- package/es/refractor/visitors/open-api-2/schema/index.mjs +8 -9
- package/es/refractor/visitors/open-api-2/scopes/index.mjs +7 -8
- package/es/refractor/visitors/open-api-2/security-definitions/index.mjs +7 -7
- package/es/refractor/visitors/open-api-2/security-requirement/index.mjs +6 -7
- package/es/refractor/visitors/open-api-2/security-scheme/index.mjs +8 -9
- package/es/refractor/visitors/open-api-2/tag/index.mjs +8 -9
- package/es/refractor/visitors/open-api-2/xml/index.mjs +8 -9
- package/package.json +6 -6
- package/types/dist.d.ts +915 -513
|
@@ -1,16 +1,14 @@
|
|
|
1
|
-
import stampit from 'stampit';
|
|
2
1
|
import { BREAK, cloneDeep } from '@swagger-api/apidom-core';
|
|
3
2
|
import SwaggerSchemesElement from "../../../elements/nces/SwaggerSchemes.mjs";
|
|
4
3
|
import FallbackVisitor from "../FallbackVisitor.mjs";
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
class SchemesVisitor extends FallbackVisitor {
|
|
5
|
+
constructor(options) {
|
|
6
|
+
super(options);
|
|
7
7
|
this.element = new SwaggerSchemesElement();
|
|
8
|
-
},
|
|
9
|
-
methods: {
|
|
10
|
-
ArrayElement(arrayElement) {
|
|
11
|
-
this.element = this.element.concat(cloneDeep(arrayElement));
|
|
12
|
-
return BREAK;
|
|
13
|
-
}
|
|
14
8
|
}
|
|
15
|
-
|
|
9
|
+
ArrayElement(arrayElement) {
|
|
10
|
+
this.element = this.element.concat(cloneDeep(arrayElement));
|
|
11
|
+
return BREAK;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
16
14
|
export default SchemesVisitor;
|
|
@@ -1,22 +1,21 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Mixin } from 'ts-mixer';
|
|
2
2
|
import { BREAK } from '@swagger-api/apidom-core';
|
|
3
3
|
import SwaggerSecurityElement from "../../../elements/nces/SwaggerSecurity.mjs";
|
|
4
|
-
import FallbackVisitor from "../FallbackVisitor.mjs";
|
|
5
4
|
import SpecificationVisitor from "../SpecificationVisitor.mjs";
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
import FallbackVisitor from "../FallbackVisitor.mjs";
|
|
6
|
+
class SecurityVisitor extends Mixin(SpecificationVisitor, FallbackVisitor) {
|
|
7
|
+
constructor(options) {
|
|
8
|
+
super(options);
|
|
8
9
|
this.element = new SwaggerSecurityElement();
|
|
9
|
-
},
|
|
10
|
-
methods: {
|
|
11
|
-
ArrayElement(arrayElement) {
|
|
12
|
-
arrayElement.forEach(item => {
|
|
13
|
-
const specPath = ['document', 'objects', 'SecurityRequirement'];
|
|
14
|
-
const element = this.toRefractedElement(specPath, item);
|
|
15
|
-
this.element.push(element);
|
|
16
|
-
});
|
|
17
|
-
this.copyMetaAndAttributes(arrayElement, this.element);
|
|
18
|
-
return BREAK;
|
|
19
|
-
}
|
|
20
10
|
}
|
|
21
|
-
|
|
11
|
+
ArrayElement(arrayElement) {
|
|
12
|
+
arrayElement.forEach(item => {
|
|
13
|
+
const specPath = ['document', 'objects', 'SecurityRequirement'];
|
|
14
|
+
const element = this.toRefractedElement(specPath, item);
|
|
15
|
+
this.element.push(element);
|
|
16
|
+
});
|
|
17
|
+
this.copyMetaAndAttributes(arrayElement, this.element);
|
|
18
|
+
return BREAK;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
22
21
|
export default SecurityVisitor;
|
|
@@ -1,16 +1,14 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Mixin } from 'ts-mixer';
|
|
2
2
|
import { BREAK, toValue } from '@swagger-api/apidom-core';
|
|
3
|
-
import FallbackVisitor from "../FallbackVisitor.mjs";
|
|
4
|
-
import SpecificationVisitor from "../SpecificationVisitor.mjs";
|
|
5
3
|
import SwaggerVersionElement from "../../../elements/SwaggerVersion.mjs";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
4
|
+
import SpecificationVisitor from "../SpecificationVisitor.mjs";
|
|
5
|
+
import FallbackVisitor from "../FallbackVisitor.mjs";
|
|
6
|
+
class SwaggerVisitor extends Mixin(SpecificationVisitor, FallbackVisitor) {
|
|
7
|
+
StringElement(stringElement) {
|
|
8
|
+
const swaggerVersionElement = new SwaggerVersionElement(toValue(stringElement));
|
|
9
|
+
this.copyMetaAndAttributes(stringElement, swaggerVersionElement);
|
|
10
|
+
this.element = swaggerVersionElement;
|
|
11
|
+
return BREAK;
|
|
14
12
|
}
|
|
15
|
-
}
|
|
13
|
+
}
|
|
16
14
|
export default SwaggerVisitor;
|
|
@@ -1,22 +1,21 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Mixin } from 'ts-mixer';
|
|
2
2
|
import { BREAK } from '@swagger-api/apidom-core';
|
|
3
|
-
import SwaggerTagsElement from "../../../elements/nces/SwaggerTags.mjs";
|
|
4
|
-
import FallbackVisitor from "../FallbackVisitor.mjs";
|
|
5
3
|
import SpecificationVisitor from "../SpecificationVisitor.mjs";
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
import FallbackVisitor from "../FallbackVisitor.mjs";
|
|
5
|
+
import SwaggerTagsElement from "../../../elements/nces/SwaggerTags.mjs";
|
|
6
|
+
class TagsVisitor extends Mixin(SpecificationVisitor, FallbackVisitor) {
|
|
7
|
+
constructor(options) {
|
|
8
|
+
super(options);
|
|
8
9
|
this.element = new SwaggerTagsElement();
|
|
9
|
-
},
|
|
10
|
-
methods: {
|
|
11
|
-
ArrayElement(arrayElement) {
|
|
12
|
-
arrayElement.forEach(item => {
|
|
13
|
-
const specPath = ['document', 'objects', 'Tag'];
|
|
14
|
-
const element = this.toRefractedElement(specPath, item);
|
|
15
|
-
this.element.push(element);
|
|
16
|
-
});
|
|
17
|
-
this.copyMetaAndAttributes(arrayElement, this.element);
|
|
18
|
-
return BREAK;
|
|
19
|
-
}
|
|
20
10
|
}
|
|
21
|
-
|
|
11
|
+
ArrayElement(arrayElement) {
|
|
12
|
+
arrayElement.forEach(item => {
|
|
13
|
+
const specPath = ['document', 'objects', 'Tag'];
|
|
14
|
+
const element = this.toRefractedElement(specPath, item);
|
|
15
|
+
this.element.push(element);
|
|
16
|
+
});
|
|
17
|
+
this.copyMetaAndAttributes(arrayElement, this.element);
|
|
18
|
+
return BREAK;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
22
21
|
export default TagsVisitor;
|
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Mixin } from 'ts-mixer';
|
|
2
2
|
import { always } from 'ramda';
|
|
3
3
|
import ContactElement from "../../../../elements/Contact.mjs";
|
|
4
|
-
import FallbackVisitor from "../../FallbackVisitor.mjs";
|
|
5
4
|
import FixedFieldsVisitor from "../../generics/FixedFieldsVisitor.mjs";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
},
|
|
11
|
-
init() {
|
|
5
|
+
import FallbackVisitor from "../../FallbackVisitor.mjs";
|
|
6
|
+
class ContactVisitor extends Mixin(FixedFieldsVisitor, FallbackVisitor) {
|
|
7
|
+
constructor(options) {
|
|
8
|
+
super(options);
|
|
12
9
|
this.element = new ContactElement();
|
|
10
|
+
this.specPath = always(['document', 'objects', 'Contact']);
|
|
11
|
+
this.canSupportSpecificationExtensions = true;
|
|
13
12
|
}
|
|
14
|
-
}
|
|
13
|
+
}
|
|
15
14
|
export default ContactVisitor;
|
|
@@ -1,28 +1,26 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Mixin } from 'ts-mixer';
|
|
2
2
|
import { isJSONReferenceLikeElement, isJSONReferenceElement } from '@swagger-api/apidom-ns-json-schema-draft-4';
|
|
3
3
|
import DefinitionsElement from "../../../../elements/Definitions.mjs";
|
|
4
4
|
import MapVisitor from "../../generics/MapVisitor.mjs";
|
|
5
5
|
import FallbackVisitor from "../../FallbackVisitor.mjs";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
return isJSONReferenceLikeElement(element) ? ['document', 'objects', 'JSONReference'] : ['document', 'objects', 'Schema'];
|
|
10
|
-
}
|
|
11
|
-
},
|
|
12
|
-
init() {
|
|
6
|
+
class DefinitionsVisitor extends Mixin(MapVisitor, FallbackVisitor) {
|
|
7
|
+
constructor(options) {
|
|
8
|
+
super(options);
|
|
13
9
|
this.element = new DefinitionsElement();
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
10
|
+
this.specPath = element => {
|
|
11
|
+
return isJSONReferenceLikeElement(element) ? ['document', 'objects', 'JSONReference'] : ['document', 'objects', 'Schema'];
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
ObjectElement(objectElement) {
|
|
15
|
+
const result = MapVisitor.prototype.ObjectElement.call(this, objectElement);
|
|
19
16
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}
|
|
17
|
+
// decorate every JSONReferenceElement with metadata about their referencing type
|
|
18
|
+
this.element.filter(isJSONReferenceElement)
|
|
19
|
+
// @ts-ignore
|
|
20
|
+
.forEach(referenceElement => {
|
|
21
|
+
referenceElement.setMetaProperty('referenced-element', 'schema');
|
|
22
|
+
});
|
|
23
|
+
return result;
|
|
26
24
|
}
|
|
27
|
-
}
|
|
25
|
+
}
|
|
28
26
|
export default DefinitionsVisitor;
|
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Mixin } from 'ts-mixer';
|
|
2
2
|
import { always } from 'ramda';
|
|
3
3
|
import ExampleElement from "../../../../elements/Example.mjs";
|
|
4
4
|
import FallbackVisitor from "../../FallbackVisitor.mjs";
|
|
5
5
|
import MapVisitor from "../../generics/MapVisitor.mjs";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
canSupportSpecificationExtensions: false
|
|
10
|
-
},
|
|
11
|
-
init() {
|
|
6
|
+
class ExampleVisitor extends Mixin(MapVisitor, FallbackVisitor) {
|
|
7
|
+
constructor(options) {
|
|
8
|
+
super(options);
|
|
12
9
|
this.element = new ExampleElement();
|
|
10
|
+
this.specPath = always(['value']);
|
|
11
|
+
this.canSupportSpecificationExtensions = false;
|
|
13
12
|
}
|
|
14
|
-
}
|
|
13
|
+
}
|
|
15
14
|
export default ExampleVisitor;
|
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Mixin } from 'ts-mixer';
|
|
2
2
|
import { always } from 'ramda';
|
|
3
3
|
import ExternalDocumentationElement from "../../../../elements/ExternalDocumentation.mjs";
|
|
4
4
|
import FixedFieldsVisitor from "../../generics/FixedFieldsVisitor.mjs";
|
|
5
5
|
import FallbackVisitor from "../../FallbackVisitor.mjs";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
canSupportSpecificationExtensions: true
|
|
10
|
-
},
|
|
11
|
-
init() {
|
|
6
|
+
class ExternalDocumentationVisitor extends Mixin(FixedFieldsVisitor, FallbackVisitor) {
|
|
7
|
+
constructor(options) {
|
|
8
|
+
super(options);
|
|
12
9
|
this.element = new ExternalDocumentationElement();
|
|
10
|
+
this.specPath = always(['document', 'objects', 'ExternalDocumentation']);
|
|
11
|
+
this.canSupportSpecificationExtensions = true;
|
|
13
12
|
}
|
|
14
|
-
}
|
|
13
|
+
}
|
|
15
14
|
export default ExternalDocumentationVisitor;
|
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Mixin } from 'ts-mixer';
|
|
2
2
|
import { always } from 'ramda';
|
|
3
3
|
import HeaderElement from "../../../../elements/Header.mjs";
|
|
4
|
-
import FallbackVisitor from "../../FallbackVisitor.mjs";
|
|
5
4
|
import FixedFieldsVisitor from "../../generics/FixedFieldsVisitor.mjs";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
},
|
|
11
|
-
init() {
|
|
5
|
+
import FallbackVisitor from "../../FallbackVisitor.mjs";
|
|
6
|
+
class HeaderVisitor extends Mixin(FixedFieldsVisitor, FallbackVisitor) {
|
|
7
|
+
constructor(options) {
|
|
8
|
+
super(options);
|
|
12
9
|
this.element = new HeaderElement();
|
|
10
|
+
this.specPath = always(['document', 'objects', 'Header']);
|
|
11
|
+
this.canSupportSpecificationExtensions = true;
|
|
13
12
|
}
|
|
14
|
-
}
|
|
13
|
+
}
|
|
15
14
|
export default HeaderVisitor;
|
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Mixin } from 'ts-mixer';
|
|
2
2
|
import { always } from 'ramda';
|
|
3
3
|
import MapVisitor from "../../generics/MapVisitor.mjs";
|
|
4
4
|
import FallbackVisitor from "../../FallbackVisitor.mjs";
|
|
5
5
|
import HeadersElement from "../../../../elements/Headers.mjs";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
canSupportSpecificationExtensions: false
|
|
10
|
-
},
|
|
11
|
-
init() {
|
|
6
|
+
class HeadersVisitor extends Mixin(MapVisitor, FallbackVisitor) {
|
|
7
|
+
constructor(options) {
|
|
8
|
+
super(options);
|
|
12
9
|
this.element = new HeadersElement();
|
|
10
|
+
this.specPath = always(['document', 'objects', 'Header']);
|
|
11
|
+
this.canSupportSpecificationExtensions = false;
|
|
13
12
|
}
|
|
14
|
-
}
|
|
13
|
+
}
|
|
15
14
|
export default HeadersVisitor;
|
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Mixin } from 'ts-mixer';
|
|
2
2
|
import { always } from 'ramda';
|
|
3
3
|
import SwaggerElement from "../../../elements/Swagger.mjs";
|
|
4
|
-
import FallbackVisitor from "../FallbackVisitor.mjs";
|
|
5
4
|
import FixedFieldsVisitor from "../generics/FixedFieldsVisitor.mjs";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
},
|
|
11
|
-
init() {
|
|
5
|
+
import FallbackVisitor from "../FallbackVisitor.mjs";
|
|
6
|
+
class SwaggerVisitor extends Mixin(FixedFieldsVisitor, FallbackVisitor) {
|
|
7
|
+
constructor(options) {
|
|
8
|
+
super(options);
|
|
12
9
|
this.element = new SwaggerElement();
|
|
10
|
+
this.specPath = always(['document', 'objects', 'Swagger']);
|
|
11
|
+
this.canSupportSpecificationExtensions = true;
|
|
13
12
|
}
|
|
14
|
-
}
|
|
13
|
+
}
|
|
15
14
|
export default SwaggerVisitor;
|
|
@@ -1,14 +1,10 @@
|
|
|
1
|
-
import stampit from 'stampit';
|
|
2
|
-
import { BREAK, cloneDeep } from '@swagger-api/apidom-core';
|
|
3
1
|
import FallbackVisitor from "../../FallbackVisitor.mjs";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
return BREAK;
|
|
11
|
-
}
|
|
2
|
+
class VersionVisitor extends FallbackVisitor {
|
|
3
|
+
StringElement(stringElement) {
|
|
4
|
+
const result = super.enter(stringElement);
|
|
5
|
+
this.element.classes.push('api-version');
|
|
6
|
+
this.element.classes.push('version');
|
|
7
|
+
return result;
|
|
12
8
|
}
|
|
13
|
-
}
|
|
9
|
+
}
|
|
14
10
|
export default VersionVisitor;
|
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Mixin } from 'ts-mixer';
|
|
2
2
|
import { always } from 'ramda';
|
|
3
3
|
import InfoElement from "../../../../elements/Info.mjs";
|
|
4
|
-
import FallbackVisitor from "../../FallbackVisitor.mjs";
|
|
5
4
|
import FixedFieldsVisitor from "../../generics/FixedFieldsVisitor.mjs";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
},
|
|
11
|
-
init() {
|
|
5
|
+
import FallbackVisitor from "../../FallbackVisitor.mjs";
|
|
6
|
+
class InfoVisitor extends Mixin(FixedFieldsVisitor, FallbackVisitor) {
|
|
7
|
+
constructor(options) {
|
|
8
|
+
super(options);
|
|
12
9
|
this.element = new InfoElement();
|
|
10
|
+
this.specPath = always(['document', 'objects', 'Info']);
|
|
11
|
+
this.canSupportSpecificationExtensions = true;
|
|
13
12
|
}
|
|
14
|
-
}
|
|
13
|
+
}
|
|
15
14
|
export default InfoVisitor;
|
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Mixin } from 'ts-mixer';
|
|
2
2
|
import { always } from 'ramda';
|
|
3
3
|
import ItemsElement from "../../../../elements/Items.mjs";
|
|
4
|
-
import FallbackVisitor from "../../FallbackVisitor.mjs";
|
|
5
4
|
import FixedFieldsVisitor from "../../generics/FixedFieldsVisitor.mjs";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
5
|
+
import FallbackVisitor from "../../FallbackVisitor.mjs";
|
|
6
|
+
class ItemsVisitor extends Mixin(FixedFieldsVisitor, FallbackVisitor) {
|
|
7
|
+
specPath;
|
|
8
|
+
canSupportSpecificationExtensions;
|
|
9
|
+
constructor(options) {
|
|
10
|
+
super(options);
|
|
12
11
|
this.element = new ItemsElement();
|
|
12
|
+
this.specPath = always(['document', 'objects', 'Items']);
|
|
13
|
+
this.canSupportSpecificationExtensions = true;
|
|
13
14
|
}
|
|
14
|
-
}
|
|
15
|
+
}
|
|
15
16
|
export default ItemsVisitor;
|
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Mixin } from 'ts-mixer';
|
|
2
2
|
import { always } from 'ramda';
|
|
3
3
|
import LicenseElement from "../../../../elements/License.mjs";
|
|
4
|
-
import FallbackVisitor from "../../FallbackVisitor.mjs";
|
|
5
4
|
import FixedFieldsVisitor from "../../generics/FixedFieldsVisitor.mjs";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
},
|
|
11
|
-
init() {
|
|
5
|
+
import FallbackVisitor from "../../FallbackVisitor.mjs";
|
|
6
|
+
class LicenseVisitor extends Mixin(FixedFieldsVisitor, FallbackVisitor) {
|
|
7
|
+
constructor(options) {
|
|
8
|
+
super(options);
|
|
12
9
|
this.element = new LicenseElement();
|
|
10
|
+
this.specPath = always(['document', 'objects', 'License']);
|
|
11
|
+
this.canSupportSpecificationExtensions = true;
|
|
13
12
|
}
|
|
14
|
-
}
|
|
13
|
+
}
|
|
15
14
|
export default LicenseVisitor;
|
|
@@ -1,16 +1,14 @@
|
|
|
1
|
-
import stampit from 'stampit';
|
|
2
1
|
import { BREAK, cloneDeep } from '@swagger-api/apidom-core';
|
|
3
2
|
import OperationConsumesElement from "../../../../elements/nces/OperationConsumes.mjs";
|
|
4
3
|
import FallbackVisitor from "../../FallbackVisitor.mjs";
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
class ConsumesVisitor extends FallbackVisitor {
|
|
5
|
+
constructor(options) {
|
|
6
|
+
super(options);
|
|
7
7
|
this.element = new OperationConsumesElement();
|
|
8
|
-
},
|
|
9
|
-
methods: {
|
|
10
|
-
ArrayElement(arrayElement) {
|
|
11
|
-
this.element = this.element.concat(cloneDeep(arrayElement));
|
|
12
|
-
return BREAK;
|
|
13
|
-
}
|
|
14
8
|
}
|
|
15
|
-
|
|
9
|
+
ArrayElement(arrayElement) {
|
|
10
|
+
this.element = this.element.concat(cloneDeep(arrayElement));
|
|
11
|
+
return BREAK;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
16
14
|
export default ConsumesVisitor;
|
|
@@ -1,27 +1,26 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Mixin } from 'ts-mixer';
|
|
2
2
|
import { BREAK } from '@swagger-api/apidom-core';
|
|
3
3
|
import { isReferenceLikeElement } from "../../../predicates.mjs";
|
|
4
4
|
import { isReferenceElement } from "../../../../predicates.mjs";
|
|
5
5
|
import OperationParametersElement from "../../../../elements/nces/OperationParameters.mjs";
|
|
6
|
-
import FallbackVisitor from "../../FallbackVisitor.mjs";
|
|
7
6
|
import SpecificationVisitor from "../../SpecificationVisitor.mjs";
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
import FallbackVisitor from "../../FallbackVisitor.mjs";
|
|
8
|
+
class ParametersVisitor extends Mixin(SpecificationVisitor, FallbackVisitor) {
|
|
9
|
+
constructor(options) {
|
|
10
|
+
super(options);
|
|
10
11
|
this.element = new OperationParametersElement();
|
|
11
|
-
},
|
|
12
|
-
methods: {
|
|
13
|
-
ArrayElement(arrayElement) {
|
|
14
|
-
arrayElement.forEach(item => {
|
|
15
|
-
const specPath = isReferenceLikeElement(item) ? ['document', 'objects', 'Reference'] : ['document', 'objects', 'Parameter'];
|
|
16
|
-
const element = this.toRefractedElement(specPath, item);
|
|
17
|
-
if (isReferenceElement(element)) {
|
|
18
|
-
element.setMetaProperty('referenced-element', 'parameter');
|
|
19
|
-
}
|
|
20
|
-
this.element.push(element);
|
|
21
|
-
});
|
|
22
|
-
this.copyMetaAndAttributes(arrayElement, this.element);
|
|
23
|
-
return BREAK;
|
|
24
|
-
}
|
|
25
12
|
}
|
|
26
|
-
|
|
13
|
+
ArrayElement(arrayElement) {
|
|
14
|
+
arrayElement.forEach(item => {
|
|
15
|
+
const specPath = isReferenceLikeElement(item) ? ['document', 'objects', 'Reference'] : ['document', 'objects', 'Parameter'];
|
|
16
|
+
const element = this.toRefractedElement(specPath, item);
|
|
17
|
+
if (isReferenceElement(element)) {
|
|
18
|
+
element.setMetaProperty('referenced-element', 'parameter');
|
|
19
|
+
}
|
|
20
|
+
this.element.push(element);
|
|
21
|
+
});
|
|
22
|
+
this.copyMetaAndAttributes(arrayElement, this.element);
|
|
23
|
+
return BREAK;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
27
26
|
export default ParametersVisitor;
|
|
@@ -1,16 +1,14 @@
|
|
|
1
|
-
import stampit from 'stampit';
|
|
2
1
|
import { BREAK, cloneDeep } from '@swagger-api/apidom-core';
|
|
3
2
|
import OperationProducesElement from "../../../../elements/nces/OperationProduces.mjs";
|
|
4
3
|
import FallbackVisitor from "../../FallbackVisitor.mjs";
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
class ProducesVisitor extends FallbackVisitor {
|
|
5
|
+
constructor(options) {
|
|
6
|
+
super(options);
|
|
7
7
|
this.element = new OperationProducesElement();
|
|
8
|
-
},
|
|
9
|
-
methods: {
|
|
10
|
-
ArrayElement(arrayElement) {
|
|
11
|
-
this.element = this.element.concat(cloneDeep(arrayElement));
|
|
12
|
-
return BREAK;
|
|
13
|
-
}
|
|
14
8
|
}
|
|
15
|
-
|
|
9
|
+
ArrayElement(arrayElement) {
|
|
10
|
+
this.element = this.element.concat(cloneDeep(arrayElement));
|
|
11
|
+
return BREAK;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
16
14
|
export default ProducesVisitor;
|
|
@@ -1,16 +1,14 @@
|
|
|
1
|
-
import stampit from 'stampit';
|
|
2
1
|
import { BREAK, cloneDeep } from '@swagger-api/apidom-core';
|
|
3
2
|
import OperationSchemesElement from "../../../../elements/nces/OperationSchemes.mjs";
|
|
4
3
|
import FallbackVisitor from "../../FallbackVisitor.mjs";
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
class SchemesVisitor extends FallbackVisitor {
|
|
5
|
+
constructor(options) {
|
|
6
|
+
super(options);
|
|
7
7
|
this.element = new OperationSchemesElement();
|
|
8
|
-
},
|
|
9
|
-
methods: {
|
|
10
|
-
ArrayElement(arrayElement) {
|
|
11
|
-
this.element = this.element.concat(cloneDeep(arrayElement));
|
|
12
|
-
return BREAK;
|
|
13
|
-
}
|
|
14
8
|
}
|
|
15
|
-
|
|
9
|
+
ArrayElement(arrayElement) {
|
|
10
|
+
this.element = this.element.concat(cloneDeep(arrayElement));
|
|
11
|
+
return BREAK;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
16
14
|
export default SchemesVisitor;
|
|
@@ -1,22 +1,21 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Mixin } from 'ts-mixer';
|
|
2
2
|
import { BREAK } from '@swagger-api/apidom-core';
|
|
3
3
|
import OperationSecurityElement from "../../../../elements/nces/OperationSecurity.mjs";
|
|
4
|
-
import FallbackVisitor from "../../FallbackVisitor.mjs";
|
|
5
4
|
import SpecificationVisitor from "../../SpecificationVisitor.mjs";
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
import FallbackVisitor from "../../FallbackVisitor.mjs";
|
|
6
|
+
class SecurityVisitor extends Mixin(SpecificationVisitor, FallbackVisitor) {
|
|
7
|
+
constructor(options) {
|
|
8
|
+
super(options);
|
|
8
9
|
this.element = new OperationSecurityElement();
|
|
9
|
-
},
|
|
10
|
-
methods: {
|
|
11
|
-
ArrayElement(arrayElement) {
|
|
12
|
-
arrayElement.forEach(item => {
|
|
13
|
-
const specPath = ['document', 'objects', 'SecurityRequirement'];
|
|
14
|
-
const element = this.toRefractedElement(specPath, item);
|
|
15
|
-
this.element.push(element);
|
|
16
|
-
});
|
|
17
|
-
this.copyMetaAndAttributes(arrayElement, this.element);
|
|
18
|
-
return BREAK;
|
|
19
|
-
}
|
|
20
10
|
}
|
|
21
|
-
|
|
11
|
+
ArrayElement(arrayElement) {
|
|
12
|
+
arrayElement.forEach(item => {
|
|
13
|
+
const specPath = ['document', 'objects', 'SecurityRequirement'];
|
|
14
|
+
const element = this.toRefractedElement(specPath, item);
|
|
15
|
+
this.element.push(element);
|
|
16
|
+
});
|
|
17
|
+
this.copyMetaAndAttributes(arrayElement, this.element);
|
|
18
|
+
return BREAK;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
22
21
|
export default SecurityVisitor;
|
|
@@ -1,16 +1,14 @@
|
|
|
1
|
-
import stampit from 'stampit';
|
|
2
1
|
import { BREAK, cloneDeep } from '@swagger-api/apidom-core';
|
|
3
2
|
import OperationTagsElement from "../../../../elements/nces/OperationTags.mjs";
|
|
4
3
|
import FallbackVisitor from "../../FallbackVisitor.mjs";
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
class TagsVisitor extends FallbackVisitor {
|
|
5
|
+
constructor(options) {
|
|
6
|
+
super(options);
|
|
7
7
|
this.element = new OperationTagsElement();
|
|
8
|
-
},
|
|
9
|
-
methods: {
|
|
10
|
-
ArrayElement(arrayElement) {
|
|
11
|
-
this.element = this.element.concat(cloneDeep(arrayElement));
|
|
12
|
-
return BREAK;
|
|
13
|
-
}
|
|
14
8
|
}
|
|
15
|
-
|
|
9
|
+
ArrayElement(arrayElement) {
|
|
10
|
+
this.element = this.element.concat(cloneDeep(arrayElement));
|
|
11
|
+
return BREAK;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
16
14
|
export default TagsVisitor;
|
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Mixin } from 'ts-mixer';
|
|
2
2
|
import { always } from 'ramda';
|
|
3
3
|
import OperationElement from "../../../../elements/Operation.mjs";
|
|
4
4
|
import FixedFieldsVisitor from "../../generics/FixedFieldsVisitor.mjs";
|
|
5
5
|
import FallbackVisitor from "../../FallbackVisitor.mjs";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
},
|
|
10
|
-
init() {
|
|
6
|
+
class OperationVisitor extends Mixin(FixedFieldsVisitor, FallbackVisitor) {
|
|
7
|
+
constructor(options) {
|
|
8
|
+
super(options);
|
|
11
9
|
this.element = new OperationElement();
|
|
10
|
+
this.specPath = always(['document', 'objects', 'Operation']);
|
|
12
11
|
}
|
|
13
|
-
}
|
|
12
|
+
}
|
|
14
13
|
export default OperationVisitor;
|