@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,15 +1,14 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Mixin } from 'ts-mixer';
|
|
2
2
|
import { always } from 'ramda';
|
|
3
3
|
import ParameterElement from "../../../../elements/Parameter.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 ParameterVisitor extends Mixin(FixedFieldsVisitor, FallbackVisitor) {
|
|
7
|
+
constructor(options) {
|
|
8
|
+
super(options);
|
|
12
9
|
this.element = new ParameterElement();
|
|
10
|
+
this.specPath = always(['document', 'objects', 'Parameter']);
|
|
11
|
+
this.canSupportSpecificationExtensions = true;
|
|
13
12
|
}
|
|
14
|
-
}
|
|
13
|
+
}
|
|
15
14
|
export default ParameterVisitor;
|
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Mixin } from 'ts-mixer';
|
|
2
2
|
import { always } from 'ramda';
|
|
3
3
|
import ParametersDefinitionsElement from "../../../../elements/ParametersDefinitions.mjs";
|
|
4
4
|
import MapVisitor from "../../generics/MapVisitor.mjs";
|
|
5
5
|
import FallbackVisitor from "../../FallbackVisitor.mjs";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
},
|
|
10
|
-
init() {
|
|
6
|
+
class ParametersDefinitionsVisitor extends Mixin(MapVisitor, FallbackVisitor) {
|
|
7
|
+
constructor(options) {
|
|
8
|
+
super(options);
|
|
11
9
|
this.element = new ParametersDefinitionsElement();
|
|
10
|
+
this.specPath = always(['document', 'objects', 'Parameter']);
|
|
12
11
|
}
|
|
13
|
-
}
|
|
12
|
+
}
|
|
14
13
|
export default ParametersDefinitionsVisitor;
|
|
@@ -1,13 +1,9 @@
|
|
|
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
|
-
return BREAK;
|
|
10
|
-
}
|
|
2
|
+
class $RefVisitor extends FallbackVisitor {
|
|
3
|
+
StringElement(stringElement) {
|
|
4
|
+
const result = super.enter(stringElement);
|
|
5
|
+
this.element.classes.push('reference-value');
|
|
6
|
+
return result;
|
|
11
7
|
}
|
|
12
|
-
}
|
|
8
|
+
}
|
|
13
9
|
export default $RefVisitor;
|
|
@@ -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 PathItemParametersElement from "../../../../elements/nces/PathItemParameters.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 PathItemParametersElement();
|
|
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,35 +1,33 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Mixin } from 'ts-mixer';
|
|
2
2
|
import { always } from 'ramda';
|
|
3
3
|
import { isStringElement, cloneDeep, toValue } from '@swagger-api/apidom-core';
|
|
4
4
|
import PathItemElement from "../../../../elements/PathItem.mjs";
|
|
5
5
|
import { isOperationElement } from "../../../../predicates.mjs";
|
|
6
6
|
import FixedFieldsVisitor from "../../generics/FixedFieldsVisitor.mjs";
|
|
7
7
|
import FallbackVisitor from "../../FallbackVisitor.mjs";
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
},
|
|
12
|
-
init() {
|
|
8
|
+
class PathItemVisitor extends Mixin(FixedFieldsVisitor, FallbackVisitor) {
|
|
9
|
+
constructor(options) {
|
|
10
|
+
super(options);
|
|
13
11
|
this.element = new PathItemElement();
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
const result = FixedFieldsVisitor.compose.methods.ObjectElement.call(this, objectElement);
|
|
12
|
+
this.specPath = always(['document', 'objects', 'PathItem']);
|
|
13
|
+
}
|
|
14
|
+
ObjectElement(objectElement) {
|
|
15
|
+
const result = FixedFieldsVisitor.prototype.ObjectElement.call(this, objectElement);
|
|
19
16
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
17
|
+
// decorate Operation elements with HTTP method
|
|
18
|
+
this.element.filter(isOperationElement)
|
|
19
|
+
// @ts-ignore
|
|
20
|
+
.forEach((operationElement, httpMethodElementCI) => {
|
|
21
|
+
const httpMethodElementCS = cloneDeep(httpMethodElementCI);
|
|
22
|
+
httpMethodElementCS.content = toValue(httpMethodElementCS).toUpperCase();
|
|
23
|
+
operationElement.setMetaProperty('http-method', httpMethodElementCS);
|
|
24
|
+
});
|
|
26
25
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
}
|
|
31
|
-
return result;
|
|
26
|
+
// mark this PathItemElement with reference metadata
|
|
27
|
+
if (isStringElement(this.element.$ref)) {
|
|
28
|
+
this.element.classes.push('reference-element');
|
|
32
29
|
}
|
|
30
|
+
return result;
|
|
33
31
|
}
|
|
34
|
-
}
|
|
32
|
+
}
|
|
35
33
|
export default PathItemVisitor;
|
|
@@ -1,32 +1,31 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Mixin } from 'ts-mixer';
|
|
2
2
|
import { T as stubTrue, always } from 'ramda';
|
|
3
3
|
import { cloneDeep } from '@swagger-api/apidom-core';
|
|
4
4
|
import PathsElement from "../../../../elements/Paths.mjs";
|
|
5
5
|
import PatternedFieldsVisitor from "../../generics/PatternedFieldsVisitor.mjs";
|
|
6
6
|
import FallbackVisitor from "../../FallbackVisitor.mjs";
|
|
7
7
|
import { isPathItemElement } from "../../../../predicates.mjs";
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
canSupportSpecificationExtensions: true
|
|
13
|
-
},
|
|
14
|
-
init() {
|
|
8
|
+
class PathsVisitor extends Mixin(PatternedFieldsVisitor, FallbackVisitor) {
|
|
9
|
+
element;
|
|
10
|
+
constructor(options) {
|
|
11
|
+
super(options);
|
|
15
12
|
this.element = new PathsElement();
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
13
|
+
this.specPath = always(['document', 'objects', 'PathItem']);
|
|
14
|
+
this.canSupportSpecificationExtensions = true;
|
|
15
|
+
this.fieldPatternPredicate = stubTrue;
|
|
16
|
+
}
|
|
17
|
+
ObjectElement(objectElement) {
|
|
18
|
+
const result = PatternedFieldsVisitor.prototype.ObjectElement.call(this, objectElement);
|
|
21
19
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}
|
|
20
|
+
// decorate every PathItemElement with path metadata
|
|
21
|
+
this.element.filter(isPathItemElement)
|
|
22
|
+
// @ts-ignore
|
|
23
|
+
.forEach((pathItemElement, key) => {
|
|
24
|
+
key.classes.push('openapi-path-template');
|
|
25
|
+
key.classes.push('path-template');
|
|
26
|
+
pathItemElement.setMetaProperty('path', cloneDeep(key));
|
|
27
|
+
});
|
|
28
|
+
return result;
|
|
30
29
|
}
|
|
31
|
-
}
|
|
30
|
+
}
|
|
32
31
|
export default PathsVisitor;
|
|
@@ -1,13 +1,9 @@
|
|
|
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
|
-
return BREAK;
|
|
10
|
-
}
|
|
2
|
+
class $RefVisitor extends FallbackVisitor {
|
|
3
|
+
StringElement(stringElement) {
|
|
4
|
+
const result = super.enter(stringElement);
|
|
5
|
+
this.element.classes.push('reference-value');
|
|
6
|
+
return result;
|
|
11
7
|
}
|
|
12
|
-
}
|
|
8
|
+
}
|
|
13
9
|
export default $RefVisitor;
|
|
@@ -1,28 +1,24 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Mixin } from 'ts-mixer';
|
|
2
2
|
import { always } from 'ramda';
|
|
3
3
|
import { isStringElement } from '@swagger-api/apidom-core';
|
|
4
4
|
import ReferenceElement from "../../../../elements/Reference.mjs";
|
|
5
5
|
import FixedFieldsVisitor from "../../generics/FixedFieldsVisitor.mjs";
|
|
6
6
|
import FallbackVisitor from "../../FallbackVisitor.mjs";
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
canSupportSpecificationExtensions: false
|
|
11
|
-
},
|
|
12
|
-
init() {
|
|
7
|
+
class ReferenceVisitor extends Mixin(FixedFieldsVisitor, FallbackVisitor) {
|
|
8
|
+
constructor(options) {
|
|
9
|
+
super(options);
|
|
13
10
|
this.element = new ReferenceElement();
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
11
|
+
this.specPath = always(['document', 'objects', 'Reference']);
|
|
12
|
+
this.canSupportSpecificationExtensions = false;
|
|
13
|
+
}
|
|
14
|
+
ObjectElement(objectElement) {
|
|
15
|
+
const result = FixedFieldsVisitor.prototype.ObjectElement.call(this, objectElement);
|
|
19
16
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
24
|
-
return result;
|
|
17
|
+
// mark this ReferenceElement with reference metadata
|
|
18
|
+
if (isStringElement(this.element.$ref)) {
|
|
19
|
+
this.element.classes.push('reference-element');
|
|
25
20
|
}
|
|
21
|
+
return result;
|
|
26
22
|
}
|
|
27
|
-
}
|
|
23
|
+
}
|
|
28
24
|
export default ReferenceVisitor;
|
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Mixin } from 'ts-mixer';
|
|
2
2
|
import { always } from 'ramda';
|
|
3
3
|
import ResponseElement from "../../../../elements/Response.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 ResponseVisitor extends Mixin(FixedFieldsVisitor, FallbackVisitor) {
|
|
7
|
+
constructor(options) {
|
|
8
|
+
super(options);
|
|
12
9
|
this.element = new ResponseElement();
|
|
10
|
+
this.specPath = always(['document', 'objects', 'Response']);
|
|
11
|
+
this.canSupportSpecificationExtensions = true;
|
|
13
12
|
}
|
|
14
|
-
}
|
|
13
|
+
}
|
|
15
14
|
export default ResponseVisitor;
|
|
@@ -1,32 +1,30 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Mixin } from 'ts-mixer';
|
|
2
2
|
import { T as stubTrue } from 'ramda';
|
|
3
3
|
import { isReferenceLikeElement } from "../../../predicates.mjs";
|
|
4
4
|
import { isReferenceElement, isResponseElement } from "../../../../predicates.mjs";
|
|
5
5
|
import AlternatingVisitor from "../../generics/AlternatingVisitor.mjs";
|
|
6
6
|
import FallbackVisitor from "../../FallbackVisitor.mjs";
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
class DefaultVisitor extends Mixin(AlternatingVisitor, FallbackVisitor) {
|
|
8
|
+
constructor(options) {
|
|
9
|
+
super(options);
|
|
10
|
+
this.alternator = [{
|
|
10
11
|
predicate: isReferenceLikeElement,
|
|
11
12
|
specPath: ['document', 'objects', 'Reference']
|
|
12
13
|
}, {
|
|
13
14
|
predicate: stubTrue,
|
|
14
15
|
specPath: ['document', 'objects', 'Response']
|
|
15
|
-
}]
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
// @ts-ignore
|
|
20
|
-
const result = AlternatingVisitor.compose.methods.enter.call(this, objectElement);
|
|
16
|
+
}];
|
|
17
|
+
}
|
|
18
|
+
ObjectElement(objectElement) {
|
|
19
|
+
const result = AlternatingVisitor.prototype.enter.call(this, objectElement);
|
|
21
20
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}
|
|
28
|
-
return result;
|
|
21
|
+
// decorate ReferenceElement with type of referencing element
|
|
22
|
+
if (isReferenceElement(this.element)) {
|
|
23
|
+
this.element.setMetaProperty('referenced-element', 'response');
|
|
24
|
+
} else if (isResponseElement(this.element)) {
|
|
25
|
+
this.element.setMetaProperty('http-status-code', 'default');
|
|
29
26
|
}
|
|
27
|
+
return result;
|
|
30
28
|
}
|
|
31
|
-
}
|
|
29
|
+
}
|
|
32
30
|
export default DefaultVisitor;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Mixin } from 'ts-mixer';
|
|
2
2
|
import { test, always, range } from 'ramda';
|
|
3
3
|
import { cloneDeep, toValue } from '@swagger-api/apidom-core';
|
|
4
4
|
import ResponsesElement from "../../../../elements/Responses.mjs";
|
|
@@ -6,36 +6,35 @@ import MixedFieldsVisitor from "../../generics/MixedFieldsVisitor.mjs";
|
|
|
6
6
|
import FallbackVisitor from "../../FallbackVisitor.mjs";
|
|
7
7
|
import { isReferenceLikeElement } from "../../../predicates.mjs";
|
|
8
8
|
import { isReferenceElement, isResponseElement } from "../../../../predicates.mjs";
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
specPathPatternedFields: element => {
|
|
13
|
-
return isReferenceLikeElement(element) ? ['document', 'objects', 'Reference'] : ['document', 'objects', 'Response'];
|
|
14
|
-
},
|
|
15
|
-
fieldPatternPredicate: test(new RegExp(`^(1XX|2XX|3XX|4XX|5XX|${range(100, 600).join('|')})$`)),
|
|
16
|
-
canSupportSpecificationExtensions: true
|
|
17
|
-
},
|
|
18
|
-
init() {
|
|
9
|
+
class ResponsesVisitor extends Mixin(MixedFieldsVisitor, FallbackVisitor) {
|
|
10
|
+
constructor(options) {
|
|
11
|
+
super(options);
|
|
19
12
|
this.element = new ResponsesElement();
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
13
|
+
this.specPathFixedFields = always(['document', 'objects', 'Responses']);
|
|
14
|
+
this.canSupportSpecificationExtensions = true;
|
|
15
|
+
this.specPathPatternedFields = element => {
|
|
16
|
+
return isReferenceLikeElement(element) ? ['document', 'objects', 'Reference'] : ['document', 'objects', 'Response'];
|
|
17
|
+
};
|
|
18
|
+
// @ts-ignore
|
|
19
|
+
this.fieldPatternPredicate = test(new RegExp(`^(1XX|2XX|3XX|4XX|5XX|${range(100, 600).join('|')})$`));
|
|
20
|
+
}
|
|
21
|
+
ObjectElement(objectElement) {
|
|
22
|
+
const result = MixedFieldsVisitor.prototype.ObjectElement.call(this, objectElement);
|
|
25
23
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
24
|
+
// decorate every ReferenceElement with metadata about their referencing type
|
|
25
|
+
// @ts-ignore
|
|
26
|
+
this.element.filter(isReferenceElement).forEach(referenceElement => {
|
|
27
|
+
referenceElement.setMetaProperty('referenced-element', 'response');
|
|
28
|
+
});
|
|
30
29
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
30
|
+
// decorate every ResponseElement with metadata about their status code
|
|
31
|
+
// @ts-ignore
|
|
32
|
+
this.element.filter(isResponseElement).forEach((value, key) => {
|
|
33
|
+
const httpStatusCode = cloneDeep(key);
|
|
34
|
+
if (!this.fieldPatternPredicate(toValue(httpStatusCode))) return;
|
|
35
|
+
value.setMetaProperty('http-status-code', httpStatusCode);
|
|
36
|
+
});
|
|
37
|
+
return result;
|
|
39
38
|
}
|
|
40
|
-
}
|
|
39
|
+
}
|
|
41
40
|
export default ResponsesVisitor;
|
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Mixin } from 'ts-mixer';
|
|
2
2
|
import { always } from 'ramda';
|
|
3
3
|
import ResponsesDefinitionsElement from "../../../../elements/ResponsesDefinitions.mjs";
|
|
4
4
|
import MapVisitor from "../../generics/MapVisitor.mjs";
|
|
5
5
|
import FallbackVisitor from "../../FallbackVisitor.mjs";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
},
|
|
10
|
-
init() {
|
|
6
|
+
class ResponsesDefinitionsVisitor extends Mixin(MapVisitor, FallbackVisitor) {
|
|
7
|
+
constructor(options) {
|
|
8
|
+
super(options);
|
|
11
9
|
this.element = new ResponsesDefinitionsElement();
|
|
10
|
+
this.specPath = always(['document', 'objects', 'Response']);
|
|
12
11
|
}
|
|
13
|
-
}
|
|
12
|
+
}
|
|
14
13
|
export default ResponsesDefinitionsVisitor;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import stampit from 'stampit';
|
|
2
1
|
import { specificationObj as JSONSchemaDraft4Specification, isJSONReferenceElement } from '@swagger-api/apidom-ns-json-schema-draft-4';
|
|
3
2
|
const {
|
|
4
3
|
allOf: JSONSchemaAllOfVisitor
|
|
5
4
|
} = JSONSchemaDraft4Specification.visitors.document.objects.JSONSchema.fixedFields;
|
|
6
|
-
const AllOfVisitor =
|
|
5
|
+
const AllOfVisitor = JSONSchemaAllOfVisitor.compose({
|
|
7
6
|
methods: {
|
|
8
7
|
ArrayElement(arrayElement) {
|
|
9
8
|
// @ts-ignore
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import stampit from 'stampit';
|
|
2
1
|
import { specificationObj as JSONSchemaDraft4Specification, isJSONReferenceElement } from '@swagger-api/apidom-ns-json-schema-draft-4';
|
|
3
2
|
const {
|
|
4
3
|
items: JSONSchemaItemsVisitor
|
|
5
4
|
} = JSONSchemaDraft4Specification.visitors.document.objects.JSONSchema.fixedFields;
|
|
6
|
-
const ItemsVisitor =
|
|
5
|
+
const ItemsVisitor = JSONSchemaItemsVisitor.compose({
|
|
7
6
|
methods: {
|
|
8
7
|
ObjectElement(objectElement) {
|
|
9
8
|
// @ts-ignore
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import stampit from 'stampit';
|
|
2
1
|
import { specificationObj as JSONSchemaDraft4Specification, isJSONReferenceElement } from '@swagger-api/apidom-ns-json-schema-draft-4';
|
|
3
2
|
const {
|
|
4
3
|
properties: JSONSchemaPropertiesVisitor
|
|
5
4
|
} = JSONSchemaDraft4Specification.visitors.document.objects.JSONSchema.fixedFields;
|
|
6
|
-
const PropertiesVisitor =
|
|
5
|
+
const PropertiesVisitor = JSONSchemaPropertiesVisitor.compose({
|
|
7
6
|
methods: {
|
|
8
7
|
ObjectElement(objectElement) {
|
|
9
8
|
// @ts-ignore
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import stampit from 'stampit';
|
|
2
1
|
import { specificationObj as JSONSchemaDraft4Specification, isJSONReferenceElement } from '@swagger-api/apidom-ns-json-schema-draft-4';
|
|
3
2
|
const {
|
|
4
3
|
JSONSchemaOrJSONReferenceVisitor
|
|
5
4
|
} = JSONSchemaDraft4Specification.visitors;
|
|
6
|
-
const SchemaOrJSONReferenceVisitor =
|
|
5
|
+
const SchemaOrJSONReferenceVisitor = JSONSchemaOrJSONReferenceVisitor.compose({
|
|
7
6
|
methods: {
|
|
8
7
|
ObjectElement(objectElement) {
|
|
9
8
|
// @ts-ignore
|
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Mixin } from 'ts-mixer';
|
|
2
2
|
import { always } from 'ramda';
|
|
3
3
|
import SchemaElement from "../../../../elements/Schema.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 SchemaVisitor extends Mixin(FixedFieldsVisitor, FallbackVisitor) {
|
|
7
|
+
constructor(options) {
|
|
8
|
+
super(options);
|
|
12
9
|
this.element = new SchemaElement();
|
|
10
|
+
this.specPath = always(['document', 'objects', 'Schema']);
|
|
11
|
+
this.canSupportSpecificationExtensions = true;
|
|
13
12
|
}
|
|
14
|
-
}
|
|
13
|
+
}
|
|
15
14
|
export default SchemaVisitor;
|
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Mixin } from 'ts-mixer';
|
|
2
2
|
import { always } from 'ramda';
|
|
3
3
|
import ScopesElement from "../../../../elements/Scopes.mjs";
|
|
4
4
|
import MapVisitor from "../../generics/MapVisitor.mjs";
|
|
5
5
|
import FallbackVisitor from "../../FallbackVisitor.mjs";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
canSupportSpecificationExtensions: true
|
|
10
|
-
},
|
|
11
|
-
init() {
|
|
6
|
+
class ScopesVisitor extends Mixin(MapVisitor, FallbackVisitor) {
|
|
7
|
+
constructor(options) {
|
|
8
|
+
super(options);
|
|
12
9
|
this.element = new ScopesElement();
|
|
10
|
+
this.specPath = always(['value']);
|
|
11
|
+
this.canSupportSpecificationExtensions = true;
|
|
13
12
|
}
|
|
14
|
-
}
|
|
13
|
+
}
|
|
15
14
|
export default ScopesVisitor;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Mixin } from 'ts-mixer';
|
|
2
2
|
import { always } from 'ramda';
|
|
3
3
|
import SecurityDefinitionsElement from "../../../../elements/SecurityDefinitions.mjs";
|
|
4
4
|
import MapVisitor from "../../generics/MapVisitor.mjs";
|
|
5
5
|
import FallbackVisitor from "../../FallbackVisitor.mjs";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
init() {
|
|
6
|
+
class SecurityDefinitionsVisitor extends Mixin(MapVisitor, FallbackVisitor) {
|
|
7
|
+
element;
|
|
8
|
+
constructor(options) {
|
|
9
|
+
super(options);
|
|
11
10
|
this.element = new SecurityDefinitionsElement();
|
|
11
|
+
this.specPath = always(['document', 'objects', 'SecurityScheme']);
|
|
12
12
|
}
|
|
13
|
-
}
|
|
13
|
+
}
|
|
14
14
|
export default SecurityDefinitionsVisitor;
|
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Mixin } from 'ts-mixer';
|
|
2
2
|
import { always } from 'ramda';
|
|
3
3
|
import SecurityRequirementElement from "../../../../elements/SecurityRequirement.mjs";
|
|
4
4
|
import MapVisitor from "../../generics/MapVisitor.mjs";
|
|
5
5
|
import FallbackVisitor from "../../FallbackVisitor.mjs";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
},
|
|
10
|
-
init() {
|
|
6
|
+
class SecurityRequirementVisitor extends Mixin(MapVisitor, FallbackVisitor) {
|
|
7
|
+
constructor(options) {
|
|
8
|
+
super(options);
|
|
11
9
|
this.element = new SecurityRequirementElement();
|
|
10
|
+
this.specPath = always(['value']);
|
|
12
11
|
}
|
|
13
|
-
}
|
|
12
|
+
}
|
|
14
13
|
export default SecurityRequirementVisitor;
|
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Mixin } from 'ts-mixer';
|
|
2
2
|
import { always } from 'ramda';
|
|
3
3
|
import SecuritySchemeElement from "../../../../elements/SecurityScheme.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 SecuritySchemeVisitor extends Mixin(FixedFieldsVisitor, FallbackVisitor) {
|
|
7
|
+
constructor(options) {
|
|
8
|
+
super(options);
|
|
12
9
|
this.element = new SecuritySchemeElement();
|
|
10
|
+
this.specPath = always(['document', 'objects', 'SecurityScheme']);
|
|
11
|
+
this.canSupportSpecificationExtensions = true;
|
|
13
12
|
}
|
|
14
|
-
}
|
|
13
|
+
}
|
|
15
14
|
export default SecuritySchemeVisitor;
|