@swagger-api/apidom-ns-openapi-2 0.79.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 +24 -0
- package/LICENSES/Apache-2.0.txt +202 -0
- package/LICENSES/MIT.txt +9 -0
- package/NOTICE +57 -0
- package/README.md +215 -0
- package/cjs/elements/Contact.cjs +30 -0
- package/cjs/elements/Definitions.cjs +12 -0
- package/cjs/elements/Example.cjs +12 -0
- package/cjs/elements/ExternalDocumentation.cjs +24 -0
- package/cjs/elements/Header.cjs +184 -0
- package/cjs/elements/Headers.cjs +12 -0
- package/cjs/elements/Info.cjs +49 -0
- package/cjs/elements/Items.cjs +189 -0
- package/cjs/elements/License.cjs +24 -0
- package/cjs/elements/Operation.cjs +75 -0
- package/cjs/elements/Parameter.cjs +229 -0
- package/cjs/elements/ParametersDefinitions.cjs +12 -0
- package/cjs/elements/PathItem.cjs +66 -0
- package/cjs/elements/Paths.cjs +12 -0
- package/cjs/elements/Reference.cjs +19 -0
- package/cjs/elements/Response.cjs +36 -0
- package/cjs/elements/Responses.cjs +18 -0
- package/cjs/elements/ResponsesDefinitions.cjs +12 -0
- package/cjs/elements/Schema.cjs +115 -0
- package/cjs/elements/Scopes.cjs +12 -0
- package/cjs/elements/SecurityDefinitions.cjs +12 -0
- package/cjs/elements/SecurityRequirement.cjs +12 -0
- package/cjs/elements/SecurityScheme.cjs +60 -0
- package/cjs/elements/Swagger.cjs +103 -0
- package/cjs/elements/SwaggerVersion.cjs +14 -0
- package/cjs/elements/Tag.cjs +30 -0
- package/cjs/elements/Xml.cjs +42 -0
- package/cjs/elements/nces/OperationConsumes.cjs +13 -0
- package/cjs/elements/nces/OperationParameters.cjs +14 -0
- package/cjs/elements/nces/OperationProduces.cjs +13 -0
- package/cjs/elements/nces/OperationSchemes.cjs +13 -0
- package/cjs/elements/nces/OperationSecurity.cjs +14 -0
- package/cjs/elements/nces/OperationTags.cjs +13 -0
- package/cjs/elements/nces/PathItemParameters.cjs +14 -0
- package/cjs/elements/nces/SwaggerConsumes.cjs +13 -0
- package/cjs/elements/nces/SwaggerProduces.cjs +13 -0
- package/cjs/elements/nces/SwaggerSchemes.cjs +13 -0
- package/cjs/elements/nces/SwaggerSecurity.cjs +14 -0
- package/cjs/elements/nces/SwaggerTags.cjs +13 -0
- package/cjs/index.cjs +134 -0
- package/cjs/media-types.cjs +23 -0
- package/cjs/namespace.cjs +68 -0
- package/cjs/predicates.cjs +222 -0
- package/cjs/refractor/index.cjs +47 -0
- package/cjs/refractor/plugins/replace-empty-element.cjs +365 -0
- package/cjs/refractor/predicates.cjs +14 -0
- package/cjs/refractor/registration.cjs +87 -0
- package/cjs/refractor/specification.cjs +488 -0
- package/cjs/refractor/toolbox.cjs +23 -0
- package/cjs/refractor/visitors/FallbackVisitor.cjs +23 -0
- package/cjs/refractor/visitors/SpecificationExtensionVisitor.cjs +18 -0
- package/cjs/refractor/visitors/SpecificationVisitor.cjs +87 -0
- package/cjs/refractor/visitors/Visitor.cjs +22 -0
- package/cjs/refractor/visitors/generics/AlternatingVisitor.cjs +27 -0
- package/cjs/refractor/visitors/generics/FixedFieldsVisitor.cjs +56 -0
- package/cjs/refractor/visitors/generics/MapVisitor.cjs +14 -0
- package/cjs/refractor/visitors/generics/MixedFieldsVisitor.cjs +42 -0
- package/cjs/refractor/visitors/generics/PatternedFieldsVisitor.cjs +58 -0
- package/cjs/refractor/visitors/open-api-2/ConsumesVisitor.cjs +21 -0
- package/cjs/refractor/visitors/open-api-2/ProducesVisitor.cjs +21 -0
- package/cjs/refractor/visitors/open-api-2/SchemesVisitor.cjs +21 -0
- package/cjs/refractor/visitors/open-api-2/SecurityVisitor.cjs +27 -0
- package/cjs/refractor/visitors/open-api-2/SwaggerVisitor.cjs +21 -0
- package/cjs/refractor/visitors/open-api-2/TagsVisitor.cjs +27 -0
- package/cjs/refractor/visitors/open-api-2/contact/index.cjs +20 -0
- package/cjs/refractor/visitors/open-api-2/definitions/index.cjs +33 -0
- package/cjs/refractor/visitors/open-api-2/example/index.cjs +20 -0
- package/cjs/refractor/visitors/open-api-2/external-documentation/index.cjs +20 -0
- package/cjs/refractor/visitors/open-api-2/header/index.cjs +20 -0
- package/cjs/refractor/visitors/open-api-2/headers/index.cjs +20 -0
- package/cjs/refractor/visitors/open-api-2/index.cjs +20 -0
- package/cjs/refractor/visitors/open-api-2/info/VersionVisitor.cjs +19 -0
- package/cjs/refractor/visitors/open-api-2/info/index.cjs +20 -0
- package/cjs/refractor/visitors/open-api-2/items/index.cjs +20 -0
- package/cjs/refractor/visitors/open-api-2/license/index.cjs +20 -0
- package/cjs/refractor/visitors/open-api-2/operation/ConsumesVisitor.cjs +21 -0
- package/cjs/refractor/visitors/open-api-2/operation/ParametersVisitor.cjs +32 -0
- package/cjs/refractor/visitors/open-api-2/operation/ProducesVisitor.cjs +21 -0
- package/cjs/refractor/visitors/open-api-2/operation/SchemesVisitor.cjs +21 -0
- package/cjs/refractor/visitors/open-api-2/operation/SecurityVisitor.cjs +27 -0
- package/cjs/refractor/visitors/open-api-2/operation/TagsVisitor.cjs +21 -0
- package/cjs/refractor/visitors/open-api-2/operation/index.cjs +19 -0
- package/cjs/refractor/visitors/open-api-2/parameter/index.cjs +20 -0
- package/cjs/refractor/visitors/open-api-2/parameters-definitions/index.cjs +19 -0
- package/cjs/refractor/visitors/open-api-2/path-item/$RefVisitor.cjs +18 -0
- package/cjs/refractor/visitors/open-api-2/path-item/ParametersVisitor.cjs +32 -0
- package/cjs/refractor/visitors/open-api-2/path-item/index.cjs +40 -0
- package/cjs/refractor/visitors/open-api-2/paths/index.cjs +35 -0
- package/cjs/refractor/visitors/open-api-2/reference/$RefVisitor.cjs +18 -0
- package/cjs/refractor/visitors/open-api-2/reference/index.cjs +33 -0
- package/cjs/refractor/visitors/open-api-2/response/index.cjs +20 -0
- package/cjs/refractor/visitors/open-api-2/responses/DefaultVisitor.cjs +37 -0
- package/cjs/refractor/visitors/open-api-2/responses/index.cjs +46 -0
- package/cjs/refractor/visitors/open-api-2/responses-definitions/index.cjs +19 -0
- package/cjs/refractor/visitors/open-api-2/schema/AllOfVisitor.cjs +23 -0
- package/cjs/refractor/visitors/open-api-2/schema/ItemsVisitor.cjs +31 -0
- package/cjs/refractor/visitors/open-api-2/schema/PropertiesVisitor.cjs +23 -0
- package/cjs/refractor/visitors/open-api-2/schema/SchemaOrJSONReferenceVisitor.cjs +23 -0
- package/cjs/refractor/visitors/open-api-2/schema/index.cjs +20 -0
- package/cjs/refractor/visitors/open-api-2/scopes/index.cjs +20 -0
- package/cjs/refractor/visitors/open-api-2/security-definitions/index.cjs +19 -0
- package/cjs/refractor/visitors/open-api-2/security-requirement/index.cjs +19 -0
- package/cjs/refractor/visitors/open-api-2/security-scheme/index.cjs +20 -0
- package/cjs/refractor/visitors/open-api-2/tag/index.cjs +20 -0
- package/cjs/refractor/visitors/open-api-2/xml/index.cjs +20 -0
- package/cjs/traversal/visitor.cjs +53 -0
- package/dist/apidom-ns-openapi-2.browser.js +25296 -0
- package/dist/apidom-ns-openapi-2.browser.min.js +1 -0
- package/es/elements/Contact.mjs +26 -0
- package/es/elements/Definitions.mjs +8 -0
- package/es/elements/Example.mjs +8 -0
- package/es/elements/ExternalDocumentation.mjs +20 -0
- package/es/elements/Header.mjs +182 -0
- package/es/elements/Headers.mjs +8 -0
- package/es/elements/Info.mjs +45 -0
- package/es/elements/Items.mjs +187 -0
- package/es/elements/License.mjs +20 -0
- package/es/elements/Operation.mjs +71 -0
- package/es/elements/Parameter.mjs +226 -0
- package/es/elements/ParametersDefinitions.mjs +8 -0
- package/es/elements/PathItem.mjs +62 -0
- package/es/elements/Paths.mjs +8 -0
- package/es/elements/Reference.mjs +15 -0
- package/es/elements/Response.mjs +32 -0
- package/es/elements/Responses.mjs +14 -0
- package/es/elements/ResponsesDefinitions.mjs +8 -0
- package/es/elements/Schema.mjs +113 -0
- package/es/elements/Scopes.mjs +8 -0
- package/es/elements/SecurityDefinitions.mjs +8 -0
- package/es/elements/SecurityRequirement.mjs +8 -0
- package/es/elements/SecurityScheme.mjs +56 -0
- package/es/elements/Swagger.mjs +99 -0
- package/es/elements/SwaggerVersion.mjs +10 -0
- package/es/elements/Tag.mjs +26 -0
- package/es/elements/Xml.mjs +38 -0
- package/es/elements/nces/OperationConsumes.mjs +9 -0
- package/es/elements/nces/OperationParameters.mjs +10 -0
- package/es/elements/nces/OperationProduces.mjs +9 -0
- package/es/elements/nces/OperationSchemes.mjs +9 -0
- package/es/elements/nces/OperationSecurity.mjs +10 -0
- package/es/elements/nces/OperationTags.mjs +9 -0
- package/es/elements/nces/PathItemParameters.mjs +10 -0
- package/es/elements/nces/SwaggerConsumes.mjs +9 -0
- package/es/elements/nces/SwaggerProduces.mjs +9 -0
- package/es/elements/nces/SwaggerSchemes.mjs +9 -0
- package/es/elements/nces/SwaggerSecurity.mjs +10 -0
- package/es/elements/nces/SwaggerTags.mjs +9 -0
- package/es/index.mjs +31 -0
- package/es/media-types.mjs +18 -0
- package/es/namespace.mjs +63 -0
- package/es/predicates.mjs +217 -0
- package/es/refractor/index.mjs +41 -0
- package/es/refractor/plugins/replace-empty-element.mjs +357 -0
- package/es/refractor/predicates.mjs +8 -0
- package/es/refractor/registration.mjs +56 -0
- package/es/refractor/specification.mjs +482 -0
- package/es/refractor/toolbox.mjs +17 -0
- package/es/refractor/visitors/FallbackVisitor.mjs +18 -0
- package/es/refractor/visitors/SpecificationExtensionVisitor.mjs +13 -0
- package/es/refractor/visitors/SpecificationVisitor.mjs +82 -0
- package/es/refractor/visitors/Visitor.mjs +17 -0
- package/es/refractor/visitors/generics/AlternatingVisitor.mjs +22 -0
- package/es/refractor/visitors/generics/FixedFieldsVisitor.mjs +51 -0
- package/es/refractor/visitors/generics/MapVisitor.mjs +9 -0
- package/es/refractor/visitors/generics/MixedFieldsVisitor.mjs +37 -0
- package/es/refractor/visitors/generics/PatternedFieldsVisitor.mjs +53 -0
- package/es/refractor/visitors/open-api-2/ConsumesVisitor.mjs +16 -0
- package/es/refractor/visitors/open-api-2/ProducesVisitor.mjs +16 -0
- package/es/refractor/visitors/open-api-2/SchemesVisitor.mjs +16 -0
- package/es/refractor/visitors/open-api-2/SecurityVisitor.mjs +22 -0
- package/es/refractor/visitors/open-api-2/SwaggerVisitor.mjs +16 -0
- package/es/refractor/visitors/open-api-2/TagsVisitor.mjs +22 -0
- package/es/refractor/visitors/open-api-2/contact/index.mjs +15 -0
- package/es/refractor/visitors/open-api-2/definitions/index.mjs +28 -0
- package/es/refractor/visitors/open-api-2/example/index.mjs +15 -0
- package/es/refractor/visitors/open-api-2/external-documentation/index.mjs +15 -0
- package/es/refractor/visitors/open-api-2/header/index.mjs +15 -0
- package/es/refractor/visitors/open-api-2/headers/index.mjs +15 -0
- package/es/refractor/visitors/open-api-2/index.mjs +15 -0
- package/es/refractor/visitors/open-api-2/info/VersionVisitor.mjs +14 -0
- package/es/refractor/visitors/open-api-2/info/index.mjs +15 -0
- package/es/refractor/visitors/open-api-2/items/index.mjs +15 -0
- package/es/refractor/visitors/open-api-2/license/index.mjs +15 -0
- package/es/refractor/visitors/open-api-2/operation/ConsumesVisitor.mjs +16 -0
- package/es/refractor/visitors/open-api-2/operation/ParametersVisitor.mjs +27 -0
- package/es/refractor/visitors/open-api-2/operation/ProducesVisitor.mjs +16 -0
- package/es/refractor/visitors/open-api-2/operation/SchemesVisitor.mjs +16 -0
- package/es/refractor/visitors/open-api-2/operation/SecurityVisitor.mjs +22 -0
- package/es/refractor/visitors/open-api-2/operation/TagsVisitor.mjs +16 -0
- package/es/refractor/visitors/open-api-2/operation/index.mjs +14 -0
- package/es/refractor/visitors/open-api-2/parameter/index.mjs +15 -0
- package/es/refractor/visitors/open-api-2/parameters-definitions/index.mjs +14 -0
- package/es/refractor/visitors/open-api-2/path-item/$RefVisitor.mjs +13 -0
- package/es/refractor/visitors/open-api-2/path-item/ParametersVisitor.mjs +27 -0
- package/es/refractor/visitors/open-api-2/path-item/index.mjs +35 -0
- package/es/refractor/visitors/open-api-2/paths/index.mjs +30 -0
- package/es/refractor/visitors/open-api-2/reference/$RefVisitor.mjs +13 -0
- package/es/refractor/visitors/open-api-2/reference/index.mjs +28 -0
- package/es/refractor/visitors/open-api-2/response/index.mjs +15 -0
- package/es/refractor/visitors/open-api-2/responses/DefaultVisitor.mjs +32 -0
- package/es/refractor/visitors/open-api-2/responses/index.mjs +41 -0
- package/es/refractor/visitors/open-api-2/responses-definitions/index.mjs +14 -0
- package/es/refractor/visitors/open-api-2/schema/AllOfVisitor.mjs +18 -0
- package/es/refractor/visitors/open-api-2/schema/ItemsVisitor.mjs +26 -0
- package/es/refractor/visitors/open-api-2/schema/PropertiesVisitor.mjs +18 -0
- package/es/refractor/visitors/open-api-2/schema/SchemaOrJSONReferenceVisitor.mjs +18 -0
- package/es/refractor/visitors/open-api-2/schema/index.mjs +15 -0
- package/es/refractor/visitors/open-api-2/scopes/index.mjs +15 -0
- package/es/refractor/visitors/open-api-2/security-definitions/index.mjs +14 -0
- package/es/refractor/visitors/open-api-2/security-requirement/index.mjs +14 -0
- package/es/refractor/visitors/open-api-2/security-scheme/index.mjs +15 -0
- package/es/refractor/visitors/open-api-2/tag/index.mjs +15 -0
- package/es/refractor/visitors/open-api-2/xml/index.mjs +15 -0
- package/es/traversal/visitor.mjs +50 -0
- package/package.json +64 -0
- package/types/dist.d.ts +1143 -0
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import stampit from 'stampit';
|
|
2
|
+
import { noop } from 'ramda-adjunct';
|
|
3
|
+
import { isStringElement, MemberElement, BREAK, cloneDeep, toValue } from '@swagger-api/apidom-core';
|
|
4
|
+
import SpecificationVisitor from "../SpecificationVisitor.mjs";
|
|
5
|
+
import { isSwaggerExtension } from "../../predicates.mjs";
|
|
6
|
+
const FixedFieldsVisitor = stampit(SpecificationVisitor, {
|
|
7
|
+
props: {
|
|
8
|
+
specPath: noop,
|
|
9
|
+
ignoredFields: [],
|
|
10
|
+
canSupportSpecificationExtensions: true,
|
|
11
|
+
specificationExtensionPredicate: isSwaggerExtension
|
|
12
|
+
},
|
|
13
|
+
init({
|
|
14
|
+
// @ts-ignore
|
|
15
|
+
specPath = this.specPath,
|
|
16
|
+
// @ts-ignore
|
|
17
|
+
ignoredFields = this.ignoredFields,
|
|
18
|
+
// @ts-ignore
|
|
19
|
+
canSupportSpecificationExtensions = this.canSupportSpecificationExtensions,
|
|
20
|
+
// @ts-ignore
|
|
21
|
+
specificationExtensionPredicate = this.specificationExtensionPredicate
|
|
22
|
+
} = {}) {
|
|
23
|
+
this.specPath = specPath;
|
|
24
|
+
this.ignoredFields = ignoredFields;
|
|
25
|
+
this.canSupportSpecificationExtensions = canSupportSpecificationExtensions;
|
|
26
|
+
this.specificationExtensionPredicate = specificationExtensionPredicate;
|
|
27
|
+
},
|
|
28
|
+
methods: {
|
|
29
|
+
ObjectElement(objectElement) {
|
|
30
|
+
const specPath = this.specPath(objectElement);
|
|
31
|
+
const fields = this.retrieveFixedFields(specPath);
|
|
32
|
+
objectElement.forEach((value, key, memberElement) => {
|
|
33
|
+
if (isStringElement(key) && fields.includes(toValue(key)) && !this.ignoredFields.includes(toValue(key))) {
|
|
34
|
+
const fixedFieldElement = this.toRefractedElement([...specPath, 'fixedFields', toValue(key)], value);
|
|
35
|
+
const newMemberElement = new MemberElement(cloneDeep(key), fixedFieldElement);
|
|
36
|
+
this.copyMetaAndAttributes(memberElement, newMemberElement);
|
|
37
|
+
newMemberElement.classes.push('fixed-field');
|
|
38
|
+
this.element.content.push(newMemberElement);
|
|
39
|
+
} else if (this.canSupportSpecificationExtensions && this.specificationExtensionPredicate(memberElement)) {
|
|
40
|
+
const extensionElement = this.toRefractedElement(['document', 'extension'], memberElement);
|
|
41
|
+
this.element.content.push(extensionElement);
|
|
42
|
+
} else if (!this.ignoredFields.includes(toValue(key))) {
|
|
43
|
+
this.element.content.push(cloneDeep(memberElement));
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
this.copyMetaAndAttributes(objectElement, this.element);
|
|
47
|
+
return BREAK;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
export default FixedFieldsVisitor;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import stampit from 'stampit';
|
|
2
|
+
import { isNonEmptyString } from 'ramda-adjunct';
|
|
3
|
+
import PatternedFieldsVisitor from "./PatternedFieldsVisitor.mjs";
|
|
4
|
+
const MapVisitor = stampit(PatternedFieldsVisitor, {
|
|
5
|
+
props: {
|
|
6
|
+
fieldPatternPredicate: isNonEmptyString
|
|
7
|
+
}
|
|
8
|
+
});
|
|
9
|
+
export default MapVisitor;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import stampit from 'stampit';
|
|
2
|
+
import { difference } from 'ramda';
|
|
3
|
+
import { noop } from 'ramda-adjunct';
|
|
4
|
+
import { BREAK } from '@swagger-api/apidom-core';
|
|
5
|
+
import FixedFieldsVisitor from "./FixedFieldsVisitor.mjs";
|
|
6
|
+
import PatternedFieldsVisitor from "./PatternedFieldsVisitor.mjs";
|
|
7
|
+
const MixedFieldsVisitor = stampit(FixedFieldsVisitor, PatternedFieldsVisitor, {
|
|
8
|
+
props: {
|
|
9
|
+
specPathFixedFields: noop,
|
|
10
|
+
specPathPatternedFields: noop
|
|
11
|
+
},
|
|
12
|
+
methods: {
|
|
13
|
+
ObjectElement(objectElement) {
|
|
14
|
+
const {
|
|
15
|
+
specPath,
|
|
16
|
+
ignoredFields
|
|
17
|
+
} = this;
|
|
18
|
+
try {
|
|
19
|
+
this.specPath = this.specPathFixedFields;
|
|
20
|
+
const fixedFields = this.retrieveFixedFields(this.specPath(objectElement));
|
|
21
|
+
// let FixedFieldsVisitor only process fixed fields and leave rest to PatternedFieldsVisitor
|
|
22
|
+
this.ignoredFields = [...ignoredFields, ...difference(objectElement.keys(), fixedFields)];
|
|
23
|
+
// @ts-ignore
|
|
24
|
+
FixedFieldsVisitor.compose.methods.ObjectElement.call(this, objectElement);
|
|
25
|
+
this.specPath = this.specPathPatternedFields;
|
|
26
|
+
this.ignoredFields = fixedFields;
|
|
27
|
+
// @ts-ignore
|
|
28
|
+
PatternedFieldsVisitor.compose.methods.ObjectElement.call(this, objectElement);
|
|
29
|
+
} catch (e) {
|
|
30
|
+
this.specPath = specPath;
|
|
31
|
+
throw e;
|
|
32
|
+
}
|
|
33
|
+
return BREAK;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
export default MixedFieldsVisitor;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import stampit from 'stampit';
|
|
2
|
+
import { F as stubFalse } from 'ramda';
|
|
3
|
+
import { noop } from 'ramda-adjunct';
|
|
4
|
+
import { MemberElement, BREAK, cloneDeep, toValue } from '@swagger-api/apidom-core';
|
|
5
|
+
import SpecificationVisitor from "../SpecificationVisitor.mjs";
|
|
6
|
+
import { isSwaggerExtension } from "../../predicates.mjs";
|
|
7
|
+
const PatternedFieldsJsonObjectVisitor = stampit(SpecificationVisitor, {
|
|
8
|
+
props: {
|
|
9
|
+
fieldPatternPredicate: stubFalse,
|
|
10
|
+
specPath: noop,
|
|
11
|
+
ignoredFields: [],
|
|
12
|
+
canSupportSpecificationExtensions: false,
|
|
13
|
+
specificationExtensionPredicate: isSwaggerExtension
|
|
14
|
+
},
|
|
15
|
+
init({
|
|
16
|
+
// @ts-ignore
|
|
17
|
+
specPath = this.specPath,
|
|
18
|
+
// @ts-ignore
|
|
19
|
+
ignoredFields = this.ignoredFields,
|
|
20
|
+
// @ts-ignore
|
|
21
|
+
canSupportSpecificationExtensions = this.canSupportSpecificationExtensions,
|
|
22
|
+
// @ts-ignore
|
|
23
|
+
specificationExtensionPredicate = this.specificationExtensionPredicate
|
|
24
|
+
} = {}) {
|
|
25
|
+
this.specPath = specPath;
|
|
26
|
+
this.ignoredFields = ignoredFields;
|
|
27
|
+
this.canSupportSpecificationExtensions = canSupportSpecificationExtensions;
|
|
28
|
+
this.specificationExtensionPredicate = specificationExtensionPredicate;
|
|
29
|
+
},
|
|
30
|
+
methods: {
|
|
31
|
+
ObjectElement(objectElement) {
|
|
32
|
+
// @ts-ignore
|
|
33
|
+
objectElement.forEach((value, key, memberElement) => {
|
|
34
|
+
if (this.canSupportSpecificationExtensions && this.specificationExtensionPredicate(memberElement)) {
|
|
35
|
+
const extensionElement = this.toRefractedElement(['document', 'extension'], memberElement);
|
|
36
|
+
this.element.content.push(extensionElement);
|
|
37
|
+
} else if (!this.ignoredFields.includes(toValue(key)) && this.fieldPatternPredicate(toValue(key))) {
|
|
38
|
+
const specPath = this.specPath(value);
|
|
39
|
+
const patternedFieldElement = this.toRefractedElement(specPath, value);
|
|
40
|
+
const newMemberElement = new MemberElement(cloneDeep(key), patternedFieldElement);
|
|
41
|
+
this.copyMetaAndAttributes(memberElement, newMemberElement);
|
|
42
|
+
newMemberElement.classes.push('patterned-field');
|
|
43
|
+
this.element.content.push(newMemberElement);
|
|
44
|
+
} else if (!this.ignoredFields.includes(toValue(key))) {
|
|
45
|
+
this.element.content.push(cloneDeep(memberElement));
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
this.copyMetaAndAttributes(objectElement, this.element);
|
|
49
|
+
return BREAK;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
export default PatternedFieldsJsonObjectVisitor;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import stampit from 'stampit';
|
|
2
|
+
import { BREAK, cloneDeep } from '@swagger-api/apidom-core';
|
|
3
|
+
import SwaggerConsumesElement from "../../../elements/nces/SwaggerConsumes.mjs";
|
|
4
|
+
import FallbackVisitor from "../FallbackVisitor.mjs";
|
|
5
|
+
const ConsumesVisitor = stampit(FallbackVisitor, {
|
|
6
|
+
init() {
|
|
7
|
+
this.element = new SwaggerConsumesElement();
|
|
8
|
+
},
|
|
9
|
+
methods: {
|
|
10
|
+
ArrayElement(arrayElement) {
|
|
11
|
+
this.element = this.element.concat(cloneDeep(arrayElement));
|
|
12
|
+
return BREAK;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
export default ConsumesVisitor;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import stampit from 'stampit';
|
|
2
|
+
import { BREAK, cloneDeep } from '@swagger-api/apidom-core';
|
|
3
|
+
import SwaggerProducesElement from "../../../elements/nces/SwaggerProduces.mjs";
|
|
4
|
+
import FallbackVisitor from "../FallbackVisitor.mjs";
|
|
5
|
+
const ProducesVisitor = stampit(FallbackVisitor, {
|
|
6
|
+
init() {
|
|
7
|
+
this.element = new SwaggerProducesElement();
|
|
8
|
+
},
|
|
9
|
+
methods: {
|
|
10
|
+
ArrayElement(arrayElement) {
|
|
11
|
+
this.element = this.element.concat(cloneDeep(arrayElement));
|
|
12
|
+
return BREAK;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
export default ProducesVisitor;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import stampit from 'stampit';
|
|
2
|
+
import { BREAK, cloneDeep } from '@swagger-api/apidom-core';
|
|
3
|
+
import SwaggerSchemesElement from "../../../elements/nces/SwaggerSchemes.mjs";
|
|
4
|
+
import FallbackVisitor from "../FallbackVisitor.mjs";
|
|
5
|
+
const SchemesVisitor = stampit(FallbackVisitor, {
|
|
6
|
+
init() {
|
|
7
|
+
this.element = new SwaggerSchemesElement();
|
|
8
|
+
},
|
|
9
|
+
methods: {
|
|
10
|
+
ArrayElement(arrayElement) {
|
|
11
|
+
this.element = this.element.concat(cloneDeep(arrayElement));
|
|
12
|
+
return BREAK;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
export default SchemesVisitor;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import stampit from 'stampit';
|
|
2
|
+
import { BREAK } from '@swagger-api/apidom-core';
|
|
3
|
+
import SwaggerSecurityElement from "../../../elements/nces/SwaggerSecurity.mjs";
|
|
4
|
+
import FallbackVisitor from "../FallbackVisitor.mjs";
|
|
5
|
+
import SpecificationVisitor from "../SpecificationVisitor.mjs";
|
|
6
|
+
const SecurityVisitor = stampit(SpecificationVisitor, FallbackVisitor, {
|
|
7
|
+
init() {
|
|
8
|
+
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
|
+
}
|
|
21
|
+
});
|
|
22
|
+
export default SecurityVisitor;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import stampit from 'stampit';
|
|
2
|
+
import { BREAK, toValue } from '@swagger-api/apidom-core';
|
|
3
|
+
import FallbackVisitor from "../FallbackVisitor.mjs";
|
|
4
|
+
import SpecificationVisitor from "../SpecificationVisitor.mjs";
|
|
5
|
+
import SwaggerVersionElement from "../../../elements/SwaggerVersion.mjs";
|
|
6
|
+
const SwaggerVisitor = stampit(SpecificationVisitor, FallbackVisitor, {
|
|
7
|
+
methods: {
|
|
8
|
+
StringElement(stringElement) {
|
|
9
|
+
const swaggerVersionElement = new SwaggerVersionElement(toValue(stringElement));
|
|
10
|
+
this.copyMetaAndAttributes(stringElement, swaggerVersionElement);
|
|
11
|
+
this.element = swaggerVersionElement;
|
|
12
|
+
return BREAK;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
export default SwaggerVisitor;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import stampit from 'stampit';
|
|
2
|
+
import { BREAK } from '@swagger-api/apidom-core';
|
|
3
|
+
import SwaggerTagsElement from "../../../elements/nces/SwaggerTags.mjs";
|
|
4
|
+
import FallbackVisitor from "../FallbackVisitor.mjs";
|
|
5
|
+
import SpecificationVisitor from "../SpecificationVisitor.mjs";
|
|
6
|
+
const TagsVisitor = stampit(SpecificationVisitor, FallbackVisitor, {
|
|
7
|
+
init() {
|
|
8
|
+
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
|
+
}
|
|
21
|
+
});
|
|
22
|
+
export default TagsVisitor;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import stampit from 'stampit';
|
|
2
|
+
import { always } from 'ramda';
|
|
3
|
+
import ContactElement from "../../../../elements/Contact.mjs";
|
|
4
|
+
import FallbackVisitor from "../../FallbackVisitor.mjs";
|
|
5
|
+
import FixedFieldsVisitor from "../../generics/FixedFieldsVisitor.mjs";
|
|
6
|
+
const ContactVisitor = stampit(FixedFieldsVisitor, FallbackVisitor, {
|
|
7
|
+
props: {
|
|
8
|
+
specPath: always(['document', 'objects', 'Contact']),
|
|
9
|
+
canSupportSpecificationExtensions: true
|
|
10
|
+
},
|
|
11
|
+
init() {
|
|
12
|
+
this.element = new ContactElement();
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
export default ContactVisitor;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import stampit from 'stampit';
|
|
2
|
+
import { isJSONReferenceLikeElement, isJSONReferenceElement } from '@swagger-api/apidom-ns-json-schema-draft-4';
|
|
3
|
+
import DefinitionsElement from "../../../../elements/Definitions.mjs";
|
|
4
|
+
import MapVisitor from "../../generics/MapVisitor.mjs";
|
|
5
|
+
import FallbackVisitor from "../../FallbackVisitor.mjs";
|
|
6
|
+
const DefinitionsVisitor = stampit(MapVisitor, FallbackVisitor, {
|
|
7
|
+
props: {
|
|
8
|
+
specPath: element => {
|
|
9
|
+
return isJSONReferenceLikeElement(element) ? ['document', 'objects', 'JSONReference'] : ['document', 'objects', 'Schema'];
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
init() {
|
|
13
|
+
this.element = new DefinitionsElement();
|
|
14
|
+
},
|
|
15
|
+
methods: {
|
|
16
|
+
ObjectElement(objectElement) {
|
|
17
|
+
// @ts-ignore
|
|
18
|
+
const result = MapVisitor.compose.methods.ObjectElement.call(this, objectElement);
|
|
19
|
+
|
|
20
|
+
// decorate every JSONReferenceElement with metadata about their referencing type
|
|
21
|
+
this.element.filter(isJSONReferenceElement).forEach(referenceElement => {
|
|
22
|
+
referenceElement.setMetaProperty('referenced-element', 'schema');
|
|
23
|
+
});
|
|
24
|
+
return result;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
export default DefinitionsVisitor;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import stampit from 'stampit';
|
|
2
|
+
import { always } from 'ramda';
|
|
3
|
+
import ExampleElement from "../../../../elements/Example.mjs";
|
|
4
|
+
import FallbackVisitor from "../../FallbackVisitor.mjs";
|
|
5
|
+
import MapVisitor from "../../generics/MapVisitor.mjs";
|
|
6
|
+
const ExampleVisitor = stampit(MapVisitor, FallbackVisitor, {
|
|
7
|
+
props: {
|
|
8
|
+
specPath: always(['value']),
|
|
9
|
+
canSupportSpecificationExtensions: false
|
|
10
|
+
},
|
|
11
|
+
init() {
|
|
12
|
+
this.element = new ExampleElement();
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
export default ExampleVisitor;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import stampit from 'stampit';
|
|
2
|
+
import { always } from 'ramda';
|
|
3
|
+
import ExternalDocumentationElement from "../../../../elements/ExternalDocumentation.mjs";
|
|
4
|
+
import FixedFieldsVisitor from "../../generics/FixedFieldsVisitor.mjs";
|
|
5
|
+
import FallbackVisitor from "../../FallbackVisitor.mjs";
|
|
6
|
+
const ExternalDocumentationVisitor = stampit(FixedFieldsVisitor, FallbackVisitor, {
|
|
7
|
+
props: {
|
|
8
|
+
specPath: always(['document', 'objects', 'ExternalDocumentation']),
|
|
9
|
+
canSupportSpecificationExtensions: true
|
|
10
|
+
},
|
|
11
|
+
init() {
|
|
12
|
+
this.element = new ExternalDocumentationElement();
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
export default ExternalDocumentationVisitor;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import stampit from 'stampit';
|
|
2
|
+
import { always } from 'ramda';
|
|
3
|
+
import HeaderElement from "../../../../elements/Header.mjs";
|
|
4
|
+
import FallbackVisitor from "../../FallbackVisitor.mjs";
|
|
5
|
+
import FixedFieldsVisitor from "../../generics/FixedFieldsVisitor.mjs";
|
|
6
|
+
const HeaderVisitor = stampit(FixedFieldsVisitor, FallbackVisitor, {
|
|
7
|
+
props: {
|
|
8
|
+
specPath: always(['document', 'objects', 'Header']),
|
|
9
|
+
canSupportSpecificationExtensions: true
|
|
10
|
+
},
|
|
11
|
+
init() {
|
|
12
|
+
this.element = new HeaderElement();
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
export default HeaderVisitor;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import stampit from 'stampit';
|
|
2
|
+
import { always } from 'ramda';
|
|
3
|
+
import MapVisitor from "../../generics/MapVisitor.mjs";
|
|
4
|
+
import FallbackVisitor from "../../FallbackVisitor.mjs";
|
|
5
|
+
import HeadersElement from "../../../../elements/Headers.mjs";
|
|
6
|
+
const HeadersVisitor = stampit(MapVisitor, FallbackVisitor, {
|
|
7
|
+
props: {
|
|
8
|
+
specPath: always(['document', 'objects', 'Header']),
|
|
9
|
+
canSupportSpecificationExtensions: false
|
|
10
|
+
},
|
|
11
|
+
init() {
|
|
12
|
+
this.element = new HeadersElement();
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
export default HeadersVisitor;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import stampit from 'stampit';
|
|
2
|
+
import { always } from 'ramda';
|
|
3
|
+
import SwaggerElement from "../../../elements/Swagger.mjs";
|
|
4
|
+
import FallbackVisitor from "../FallbackVisitor.mjs";
|
|
5
|
+
import FixedFieldsVisitor from "../generics/FixedFieldsVisitor.mjs";
|
|
6
|
+
const SwaggerVisitor = stampit(FixedFieldsVisitor, FallbackVisitor, {
|
|
7
|
+
props: {
|
|
8
|
+
specPath: always(['document', 'objects', 'Swagger']),
|
|
9
|
+
canSupportSpecificationExtensions: true
|
|
10
|
+
},
|
|
11
|
+
init() {
|
|
12
|
+
this.element = new SwaggerElement();
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
export default SwaggerVisitor;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import stampit from 'stampit';
|
|
2
|
+
import { BREAK, cloneDeep } from '@swagger-api/apidom-core';
|
|
3
|
+
import FallbackVisitor from "../../FallbackVisitor.mjs";
|
|
4
|
+
const VersionVisitor = stampit(FallbackVisitor, {
|
|
5
|
+
methods: {
|
|
6
|
+
StringElement(stringElement) {
|
|
7
|
+
this.element = cloneDeep(stringElement);
|
|
8
|
+
this.element.classes.push('api-version');
|
|
9
|
+
this.element.classes.push('version');
|
|
10
|
+
return BREAK;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
export default VersionVisitor;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import stampit from 'stampit';
|
|
2
|
+
import { always } from 'ramda';
|
|
3
|
+
import InfoElement from "../../../../elements/Info.mjs";
|
|
4
|
+
import FallbackVisitor from "../../FallbackVisitor.mjs";
|
|
5
|
+
import FixedFieldsVisitor from "../../generics/FixedFieldsVisitor.mjs";
|
|
6
|
+
const InfoVisitor = stampit(FixedFieldsVisitor, FallbackVisitor, {
|
|
7
|
+
props: {
|
|
8
|
+
specPath: always(['document', 'objects', 'Info']),
|
|
9
|
+
canSupportSpecificationExtensions: true
|
|
10
|
+
},
|
|
11
|
+
init() {
|
|
12
|
+
this.element = new InfoElement();
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
export default InfoVisitor;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import stampit from 'stampit';
|
|
2
|
+
import { always } from 'ramda';
|
|
3
|
+
import ItemsElement from "../../../../elements/Items.mjs";
|
|
4
|
+
import FallbackVisitor from "../../FallbackVisitor.mjs";
|
|
5
|
+
import FixedFieldsVisitor from "../../generics/FixedFieldsVisitor.mjs";
|
|
6
|
+
const ItemsVisitor = stampit(FixedFieldsVisitor, FallbackVisitor, {
|
|
7
|
+
props: {
|
|
8
|
+
specPath: always(['document', 'objects', 'Items']),
|
|
9
|
+
canSupportSpecificationExtensions: true
|
|
10
|
+
},
|
|
11
|
+
init() {
|
|
12
|
+
this.element = new ItemsElement();
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
export default ItemsVisitor;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import stampit from 'stampit';
|
|
2
|
+
import { always } from 'ramda';
|
|
3
|
+
import LicenseElement from "../../../../elements/License.mjs";
|
|
4
|
+
import FallbackVisitor from "../../FallbackVisitor.mjs";
|
|
5
|
+
import FixedFieldsVisitor from "../../generics/FixedFieldsVisitor.mjs";
|
|
6
|
+
const LicenseVisitor = stampit(FixedFieldsVisitor, FallbackVisitor, {
|
|
7
|
+
props: {
|
|
8
|
+
specPath: always(['document', 'objects', 'License']),
|
|
9
|
+
canSupportSpecificationExtensions: true
|
|
10
|
+
},
|
|
11
|
+
init() {
|
|
12
|
+
this.element = new LicenseElement();
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
export default LicenseVisitor;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import stampit from 'stampit';
|
|
2
|
+
import { BREAK, cloneDeep } from '@swagger-api/apidom-core';
|
|
3
|
+
import OperationConsumesElement from "../../../../elements/nces/OperationConsumes.mjs";
|
|
4
|
+
import FallbackVisitor from "../../FallbackVisitor.mjs";
|
|
5
|
+
const ConsumesVisitor = stampit(FallbackVisitor, {
|
|
6
|
+
init() {
|
|
7
|
+
this.element = new OperationConsumesElement();
|
|
8
|
+
},
|
|
9
|
+
methods: {
|
|
10
|
+
ArrayElement(arrayElement) {
|
|
11
|
+
this.element = this.element.concat(cloneDeep(arrayElement));
|
|
12
|
+
return BREAK;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
export default ConsumesVisitor;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import stampit from 'stampit';
|
|
2
|
+
import { BREAK } from '@swagger-api/apidom-core';
|
|
3
|
+
import { isReferenceLikeElement } from "../../../predicates.mjs";
|
|
4
|
+
import { isReferenceElement } from "../../../../predicates.mjs";
|
|
5
|
+
import OperationParametersElement from "../../../../elements/nces/OperationParameters.mjs";
|
|
6
|
+
import FallbackVisitor from "../../FallbackVisitor.mjs";
|
|
7
|
+
import SpecificationVisitor from "../../SpecificationVisitor.mjs";
|
|
8
|
+
const ParametersVisitor = stampit(SpecificationVisitor, FallbackVisitor, {
|
|
9
|
+
init() {
|
|
10
|
+
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
|
+
}
|
|
26
|
+
});
|
|
27
|
+
export default ParametersVisitor;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import stampit from 'stampit';
|
|
2
|
+
import { BREAK, cloneDeep } from '@swagger-api/apidom-core';
|
|
3
|
+
import OperationProducesElement from "../../../../elements/nces/OperationProduces.mjs";
|
|
4
|
+
import FallbackVisitor from "../../FallbackVisitor.mjs";
|
|
5
|
+
const ProducesVisitor = stampit(FallbackVisitor, {
|
|
6
|
+
init() {
|
|
7
|
+
this.element = new OperationProducesElement();
|
|
8
|
+
},
|
|
9
|
+
methods: {
|
|
10
|
+
ArrayElement(arrayElement) {
|
|
11
|
+
this.element = this.element.concat(cloneDeep(arrayElement));
|
|
12
|
+
return BREAK;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
export default ProducesVisitor;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import stampit from 'stampit';
|
|
2
|
+
import { BREAK, cloneDeep } from '@swagger-api/apidom-core';
|
|
3
|
+
import OperationSchemesElement from "../../../../elements/nces/OperationSchemes.mjs";
|
|
4
|
+
import FallbackVisitor from "../../FallbackVisitor.mjs";
|
|
5
|
+
const SchemesVisitor = stampit(FallbackVisitor, {
|
|
6
|
+
init() {
|
|
7
|
+
this.element = new OperationSchemesElement();
|
|
8
|
+
},
|
|
9
|
+
methods: {
|
|
10
|
+
ArrayElement(arrayElement) {
|
|
11
|
+
this.element = this.element.concat(cloneDeep(arrayElement));
|
|
12
|
+
return BREAK;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
export default SchemesVisitor;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import stampit from 'stampit';
|
|
2
|
+
import { BREAK } from '@swagger-api/apidom-core';
|
|
3
|
+
import OperationSecurityElement from "../../../../elements/nces/OperationSecurity.mjs";
|
|
4
|
+
import FallbackVisitor from "../../FallbackVisitor.mjs";
|
|
5
|
+
import SpecificationVisitor from "../../SpecificationVisitor.mjs";
|
|
6
|
+
const SecurityVisitor = stampit(SpecificationVisitor, FallbackVisitor, {
|
|
7
|
+
init() {
|
|
8
|
+
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
|
+
}
|
|
21
|
+
});
|
|
22
|
+
export default SecurityVisitor;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import stampit from 'stampit';
|
|
2
|
+
import { BREAK, cloneDeep } from '@swagger-api/apidom-core';
|
|
3
|
+
import OperationTagsElement from "../../../../elements/nces/OperationTags.mjs";
|
|
4
|
+
import FallbackVisitor from "../../FallbackVisitor.mjs";
|
|
5
|
+
const TagsVisitor = stampit(FallbackVisitor, {
|
|
6
|
+
init() {
|
|
7
|
+
this.element = new OperationTagsElement();
|
|
8
|
+
},
|
|
9
|
+
methods: {
|
|
10
|
+
ArrayElement(arrayElement) {
|
|
11
|
+
this.element = this.element.concat(cloneDeep(arrayElement));
|
|
12
|
+
return BREAK;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
export default TagsVisitor;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import stampit from 'stampit';
|
|
2
|
+
import { always } from 'ramda';
|
|
3
|
+
import OperationElement from "../../../../elements/Operation.mjs";
|
|
4
|
+
import FixedFieldsVisitor from "../../generics/FixedFieldsVisitor.mjs";
|
|
5
|
+
import FallbackVisitor from "../../FallbackVisitor.mjs";
|
|
6
|
+
const OperationVisitor = stampit(FixedFieldsVisitor, FallbackVisitor, {
|
|
7
|
+
props: {
|
|
8
|
+
specPath: always(['document', 'objects', 'Operation'])
|
|
9
|
+
},
|
|
10
|
+
init() {
|
|
11
|
+
this.element = new OperationElement();
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
export default OperationVisitor;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import stampit from 'stampit';
|
|
2
|
+
import { always } from 'ramda';
|
|
3
|
+
import ParameterElement from "../../../../elements/Parameter.mjs";
|
|
4
|
+
import FallbackVisitor from "../../FallbackVisitor.mjs";
|
|
5
|
+
import FixedFieldsVisitor from "../../generics/FixedFieldsVisitor.mjs";
|
|
6
|
+
const ParameterVisitor = stampit(FixedFieldsVisitor, FallbackVisitor, {
|
|
7
|
+
props: {
|
|
8
|
+
specPath: always(['document', 'objects', 'Parameter']),
|
|
9
|
+
canSupportSpecificationExtensions: true
|
|
10
|
+
},
|
|
11
|
+
init() {
|
|
12
|
+
this.element = new ParameterElement();
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
export default ParameterVisitor;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import stampit from 'stampit';
|
|
2
|
+
import { always } from 'ramda';
|
|
3
|
+
import ParametersDefinitionsElement from "../../../../elements/ParametersDefinitions.mjs";
|
|
4
|
+
import MapVisitor from "../../generics/MapVisitor.mjs";
|
|
5
|
+
import FallbackVisitor from "../../FallbackVisitor.mjs";
|
|
6
|
+
const ParametersDefinitionsVisitor = stampit(MapVisitor, FallbackVisitor, {
|
|
7
|
+
props: {
|
|
8
|
+
specPath: always(['document', 'objects', 'Parameter'])
|
|
9
|
+
},
|
|
10
|
+
init() {
|
|
11
|
+
this.element = new ParametersDefinitionsElement();
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
export default ParametersDefinitionsVisitor;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import stampit from 'stampit';
|
|
2
|
+
import { BREAK, cloneDeep } from '@swagger-api/apidom-core';
|
|
3
|
+
import FallbackVisitor from "../../FallbackVisitor.mjs";
|
|
4
|
+
const $RefVisitor = stampit(FallbackVisitor, {
|
|
5
|
+
methods: {
|
|
6
|
+
StringElement(stringElement) {
|
|
7
|
+
this.element = cloneDeep(stringElement);
|
|
8
|
+
this.element.classes.push('reference-value');
|
|
9
|
+
return BREAK;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
export default $RefVisitor;
|