@speclynx/apidom-ns-openapi-3-0 4.0.3 → 4.0.5
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 +10 -0
- package/dist/apidom-ns-openapi-3-0.browser.js +30 -6
- package/dist/apidom-ns-openapi-3-0.browser.min.js +1 -1
- package/package.json +9 -8
- package/src/elements/Callback.ts +0 -13
- package/src/elements/Components.ts +0 -85
- package/src/elements/Contact.ts +0 -42
- package/src/elements/Discriminator.ts +0 -34
- package/src/elements/Encoding.ts +0 -59
- package/src/elements/Example.ts +0 -51
- package/src/elements/ExternalDocumentation.ts +0 -34
- package/src/elements/Header.ts +0 -119
- package/src/elements/Info.ts +0 -70
- package/src/elements/License.ts +0 -34
- package/src/elements/Link.ts +0 -85
- package/src/elements/MediaType.ts +0 -48
- package/src/elements/OAuthFlow.ts +0 -50
- package/src/elements/OAuthFlows.ts +0 -47
- package/src/elements/OpenApi3-0.ts +0 -90
- package/src/elements/Openapi.ts +0 -15
- package/src/elements/Operation.ts +0 -124
- package/src/elements/Parameter.ts +0 -135
- package/src/elements/PathItem.ts +0 -125
- package/src/elements/Paths.ts +0 -13
- package/src/elements/Reference.ts +0 -27
- package/src/elements/RequestBody.ts +0 -46
- package/src/elements/Response.ts +0 -50
- package/src/elements/Responses.ts +0 -24
- package/src/elements/Schema.ts +0 -230
- package/src/elements/SecurityRequirement.ts +0 -13
- package/src/elements/SecurityScheme.ts +0 -84
- package/src/elements/Server.ts +0 -42
- package/src/elements/ServerVariable.ts +0 -43
- package/src/elements/Tag.ts +0 -44
- package/src/elements/Xml.ts +0 -59
- package/src/elements/nces/ComponentsCallbacks.ts +0 -15
- package/src/elements/nces/ComponentsExamples.ts +0 -16
- package/src/elements/nces/ComponentsHeaders.ts +0 -15
- package/src/elements/nces/ComponentsLinks.ts +0 -15
- package/src/elements/nces/ComponentsParameters.ts +0 -16
- package/src/elements/nces/ComponentsRequestBodies.ts +0 -15
- package/src/elements/nces/ComponentsResponses.ts +0 -15
- package/src/elements/nces/ComponentsSchemas.ts +0 -15
- package/src/elements/nces/ComponentsSecuritySchemes.ts +0 -15
- package/src/elements/nces/DiscriminatorMapping.ts +0 -15
- package/src/elements/nces/EncodingHeaders.ts +0 -15
- package/src/elements/nces/HeaderContent.ts +0 -16
- package/src/elements/nces/HeaderExamples.ts +0 -16
- package/src/elements/nces/LinkParameters.ts +0 -15
- package/src/elements/nces/MediaTypeEncoding.ts +0 -15
- package/src/elements/nces/MediaTypeExamples.ts +0 -16
- package/src/elements/nces/OAuthFlowScopes.ts +0 -15
- package/src/elements/nces/OperationCallbacks.ts +0 -15
- package/src/elements/nces/OperationParameters.ts +0 -16
- package/src/elements/nces/OperationSecurity.ts +0 -16
- package/src/elements/nces/OperationServers.ts +0 -16
- package/src/elements/nces/OperationTags.ts +0 -15
- package/src/elements/nces/ParameterContent.ts +0 -16
- package/src/elements/nces/ParameterExamples.ts +0 -16
- package/src/elements/nces/PathItemParameters.ts +0 -16
- package/src/elements/nces/PathItemServers.ts +0 -16
- package/src/elements/nces/RequestBodyContent.ts +0 -16
- package/src/elements/nces/ResponseContent.ts +0 -16
- package/src/elements/nces/ResponseHeaders.ts +0 -15
- package/src/elements/nces/ResponseLinks.ts +0 -15
- package/src/elements/nces/Security.ts +0 -15
- package/src/elements/nces/ServerVariables.ts +0 -15
- package/src/elements/nces/Servers.ts +0 -15
- package/src/elements/nces/Tags.ts +0 -15
- package/src/index.ts +0 -550
- package/src/media-types.ts +0 -52
- package/src/namespace.ts +0 -78
- package/src/predicates.ts +0 -185
- package/src/refractor/index.ts +0 -370
- package/src/refractor/inspect.ts +0 -239
- package/src/refractor/plugins/replace-empty-element.ts +0 -656
- package/src/refractor/predicates.ts +0 -39
- package/src/refractor/specification.ts +0 -557
- package/src/refractor/toolbox.ts +0 -24
- package/src/refractor/visitors/FallbackVisitor.ts +0 -24
- package/src/refractor/visitors/SpecificationExtensionVisitor.ts +0 -22
- package/src/refractor/visitors/SpecificationVisitor.ts +0 -112
- package/src/refractor/visitors/Visitor.ts +0 -47
- package/src/refractor/visitors/generics/AlternatingVisitor.ts +0 -45
- package/src/refractor/visitors/generics/FixedFieldsVisitor.ts +0 -110
- package/src/refractor/visitors/generics/MapVisitor.ts +0 -25
- package/src/refractor/visitors/generics/MixedFieldsVisitor.ts +0 -77
- package/src/refractor/visitors/generics/PatternedFieldsVisitor.ts +0 -99
- package/src/refractor/visitors/open-api-3-0/ContentVisitor.ts +0 -28
- package/src/refractor/visitors/open-api-3-0/ExamplesVisitor.ts +0 -48
- package/src/refractor/visitors/open-api-3-0/OpenapiVisitor.ts +0 -30
- package/src/refractor/visitors/open-api-3-0/ParametersVisitor.ts +0 -47
- package/src/refractor/visitors/open-api-3-0/SecurityVisitor.ts +0 -44
- package/src/refractor/visitors/open-api-3-0/ServersVisitor.ts +0 -40
- package/src/refractor/visitors/open-api-3-0/TagsVisitor.ts +0 -40
- package/src/refractor/visitors/open-api-3-0/bases.ts +0 -82
- package/src/refractor/visitors/open-api-3-0/callback/index.ts +0 -49
- package/src/refractor/visitors/open-api-3-0/components/CallbacksVisitor.ts +0 -45
- package/src/refractor/visitors/open-api-3-0/components/ExamplesVisitor.ts +0 -46
- package/src/refractor/visitors/open-api-3-0/components/HeadersVisitor.ts +0 -53
- package/src/refractor/visitors/open-api-3-0/components/LinksVisitor.ts +0 -45
- package/src/refractor/visitors/open-api-3-0/components/ParametersVisitor.ts +0 -46
- package/src/refractor/visitors/open-api-3-0/components/RequestBodiesVisitor.ts +0 -45
- package/src/refractor/visitors/open-api-3-0/components/ResponsesVisitor.ts +0 -53
- package/src/refractor/visitors/open-api-3-0/components/SchemasVisitor.ts +0 -46
- package/src/refractor/visitors/open-api-3-0/components/SecuritySchemesVisitor.ts +0 -45
- package/src/refractor/visitors/open-api-3-0/components/index.ts +0 -31
- package/src/refractor/visitors/open-api-3-0/contact/index.ts +0 -27
- package/src/refractor/visitors/open-api-3-0/distriminator/MappingVisitor.ts +0 -24
- package/src/refractor/visitors/open-api-3-0/distriminator/index.ts +0 -27
- package/src/refractor/visitors/open-api-3-0/encoding/HeadersVisitor.ts +0 -57
- package/src/refractor/visitors/open-api-3-0/encoding/index.ts +0 -49
- package/src/refractor/visitors/open-api-3-0/example/ExternalValueVisitor.ts +0 -20
- package/src/refractor/visitors/open-api-3-0/example/index.ts +0 -38
- package/src/refractor/visitors/open-api-3-0/external-documentation/index.ts +0 -27
- package/src/refractor/visitors/open-api-3-0/header/ContentVisitor.ts +0 -18
- package/src/refractor/visitors/open-api-3-0/header/ExamplesVisitor.ts +0 -18
- package/src/refractor/visitors/open-api-3-0/header/SchemaVisitor.ts +0 -33
- package/src/refractor/visitors/open-api-3-0/header/index.ts +0 -27
- package/src/refractor/visitors/open-api-3-0/index.ts +0 -39
- package/src/refractor/visitors/open-api-3-0/info/VersionVisitor.ts +0 -21
- package/src/refractor/visitors/open-api-3-0/info/index.ts +0 -27
- package/src/refractor/visitors/open-api-3-0/license/index.ts +0 -27
- package/src/refractor/visitors/open-api-3-0/link/OperationIdVisitor.ts +0 -20
- package/src/refractor/visitors/open-api-3-0/link/OperationRefVisitor.ts +0 -20
- package/src/refractor/visitors/open-api-3-0/link/ParametersVisitor.ts +0 -24
- package/src/refractor/visitors/open-api-3-0/link/index.ts +0 -38
- package/src/refractor/visitors/open-api-3-0/media-type/EncodingVisitor.ts +0 -24
- package/src/refractor/visitors/open-api-3-0/media-type/ExamplesVisitor.ts +0 -18
- package/src/refractor/visitors/open-api-3-0/media-type/SchemaVisitor.ts +0 -33
- package/src/refractor/visitors/open-api-3-0/media-type/index.ts +0 -27
- package/src/refractor/visitors/open-api-3-0/oauth-flow/ScopesVisitor.ts +0 -24
- package/src/refractor/visitors/open-api-3-0/oauth-flow/index.ts +0 -27
- package/src/refractor/visitors/open-api-3-0/oauth-flows/index.ts +0 -27
- package/src/refractor/visitors/open-api-3-0/operation/CallbacksVisitor.ts +0 -45
- package/src/refractor/visitors/open-api-3-0/operation/ParametersVisitor.ts +0 -18
- package/src/refractor/visitors/open-api-3-0/operation/RequestBodyVisitor.ts +0 -39
- package/src/refractor/visitors/open-api-3-0/operation/SecurityVisitor.ts +0 -41
- package/src/refractor/visitors/open-api-3-0/operation/ServersVisitor.ts +0 -18
- package/src/refractor/visitors/open-api-3-0/operation/TagsVisitor.ts +0 -32
- package/src/refractor/visitors/open-api-3-0/operation/index.ts +0 -27
- package/src/refractor/visitors/open-api-3-0/parameter/ContentVisitor.ts +0 -18
- package/src/refractor/visitors/open-api-3-0/parameter/ExamplesVisitor.ts +0 -18
- package/src/refractor/visitors/open-api-3-0/parameter/SchemaVisitor.ts +0 -36
- package/src/refractor/visitors/open-api-3-0/parameter/index.ts +0 -49
- package/src/refractor/visitors/open-api-3-0/path-item/$RefVisitor.ts +0 -20
- package/src/refractor/visitors/open-api-3-0/path-item/ParametersVisitor.ts +0 -18
- package/src/refractor/visitors/open-api-3-0/path-item/ServersVisitor.ts +0 -18
- package/src/refractor/visitors/open-api-3-0/path-item/index.ts +0 -53
- package/src/refractor/visitors/open-api-3-0/paths/index.ts +0 -51
- package/src/refractor/visitors/open-api-3-0/reference/$RefVisitor.ts +0 -20
- package/src/refractor/visitors/open-api-3-0/reference/index.ts +0 -41
- package/src/refractor/visitors/open-api-3-0/request-body/ContentVisitor.ts +0 -18
- package/src/refractor/visitors/open-api-3-0/request-body/index.ts +0 -46
- package/src/refractor/visitors/open-api-3-0/response/ContentVisitor.ts +0 -18
- package/src/refractor/visitors/open-api-3-0/response/HeadersVisitor.ts +0 -57
- package/src/refractor/visitors/open-api-3-0/response/LinksVisitor.ts +0 -45
- package/src/refractor/visitors/open-api-3-0/response/index.ts +0 -57
- package/src/refractor/visitors/open-api-3-0/responses/DefaultVisitor.ts +0 -39
- package/src/refractor/visitors/open-api-3-0/responses/index.ts +0 -64
- package/src/refractor/visitors/open-api-3-0/schema/AllOfVisitor.ts +0 -34
- package/src/refractor/visitors/open-api-3-0/schema/AnyOfVisitor.ts +0 -34
- package/src/refractor/visitors/open-api-3-0/schema/ItemsVisitor.ts +0 -31
- package/src/refractor/visitors/open-api-3-0/schema/OneOfVisitor.ts +0 -34
- package/src/refractor/visitors/open-api-3-0/schema/PropertiesVisitor.ts +0 -34
- package/src/refractor/visitors/open-api-3-0/schema/SchemaOrReferenceVisitor.ts +0 -36
- package/src/refractor/visitors/open-api-3-0/schema/TypeVisitor.ts +0 -26
- package/src/refractor/visitors/open-api-3-0/schema/index.ts +0 -30
- package/src/refractor/visitors/open-api-3-0/security-requirement/index.ts +0 -24
- package/src/refractor/visitors/open-api-3-0/security-scheme/index.ts +0 -27
- package/src/refractor/visitors/open-api-3-0/server/UrlVisitor.ts +0 -20
- package/src/refractor/visitors/open-api-3-0/server/VariablesVisitor.ts +0 -24
- package/src/refractor/visitors/open-api-3-0/server/index.ts +0 -27
- package/src/refractor/visitors/open-api-3-0/server-variable/index.ts +0 -27
- package/src/refractor/visitors/open-api-3-0/tag/index.ts +0 -27
- package/src/refractor/visitors/open-api-3-0/xml/index.ts +0 -27
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
import { pathSatisfies, path, pick } from 'ramda';
|
|
2
|
-
import { isFunction } from 'ramda-adjunct';
|
|
3
|
-
import { ObjectElement, cloneDeep } from '@speclynx/apidom-datamodel';
|
|
4
|
-
import { traverse, getNodePrimitiveType } from '@speclynx/apidom-traverse';
|
|
5
|
-
|
|
6
|
-
import OpenApi3_0Element from '../../elements/OpenApi3-0.ts';
|
|
7
|
-
import Visitor, { VisitorOptions } from './Visitor.ts';
|
|
8
|
-
import type specification from '../specification.ts';
|
|
9
|
-
import FallbackVisitor from './FallbackVisitor.ts';
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* This is a base Type for every visitor that does
|
|
13
|
-
* internal look-ups to retrieve other child visitors.
|
|
14
|
-
* @public
|
|
15
|
-
*/
|
|
16
|
-
export interface SpecificationVisitorOptions extends VisitorOptions {
|
|
17
|
-
readonly specObj: typeof specification;
|
|
18
|
-
readonly passingOptionsNames?: string[];
|
|
19
|
-
readonly openApiGenericElement?: ObjectElement;
|
|
20
|
-
readonly sourceContext?: Record<string, unknown>;
|
|
21
|
-
readonly openApiSemanticElement?: OpenApi3_0Element;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* @public
|
|
26
|
-
*/
|
|
27
|
-
class SpecificationVisitor extends Visitor {
|
|
28
|
-
protected readonly specObj: typeof specification;
|
|
29
|
-
|
|
30
|
-
protected readonly passingOptionsNames: string[] = [
|
|
31
|
-
'specObj',
|
|
32
|
-
'openApiGenericElement',
|
|
33
|
-
'sourceContext',
|
|
34
|
-
'openApiSemanticElement',
|
|
35
|
-
'consume',
|
|
36
|
-
];
|
|
37
|
-
|
|
38
|
-
protected openApiGenericElement?: ObjectElement;
|
|
39
|
-
|
|
40
|
-
protected sourceContext?: Record<string, unknown>;
|
|
41
|
-
|
|
42
|
-
protected openApiSemanticElement?: OpenApi3_0Element;
|
|
43
|
-
|
|
44
|
-
constructor({
|
|
45
|
-
specObj,
|
|
46
|
-
passingOptionsNames,
|
|
47
|
-
openApiGenericElement,
|
|
48
|
-
openApiSemanticElement,
|
|
49
|
-
...rest
|
|
50
|
-
}: SpecificationVisitorOptions) {
|
|
51
|
-
super({ ...rest });
|
|
52
|
-
this.specObj = specObj;
|
|
53
|
-
this.openApiGenericElement = openApiGenericElement;
|
|
54
|
-
this.openApiSemanticElement = openApiSemanticElement;
|
|
55
|
-
|
|
56
|
-
if (Array.isArray(passingOptionsNames)) {
|
|
57
|
-
this.passingOptionsNames = passingOptionsNames;
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
retrievePassingOptions() {
|
|
62
|
-
return pick(this.passingOptionsNames as (keyof this)[], this) as unknown as Record<
|
|
63
|
-
string,
|
|
64
|
-
unknown
|
|
65
|
-
>;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
retrieveFixedFields(specPath: string[]) {
|
|
69
|
-
const fixedFields = path(['visitors', ...specPath, 'fixedFields'], this.specObj);
|
|
70
|
-
if (typeof fixedFields === 'object' && fixedFields !== null) {
|
|
71
|
-
return Object.keys(fixedFields);
|
|
72
|
-
}
|
|
73
|
-
return [];
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
retrieveVisitor(specPath: string[]) {
|
|
77
|
-
if (pathSatisfies(isFunction, ['visitors', ...specPath], this.specObj)) {
|
|
78
|
-
return path(['visitors', ...specPath], this.specObj);
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
return path(['visitors', ...specPath, '$visitor'], this.specObj);
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
retrieveVisitorInstance(specPath: string[], options = {}): Visitor {
|
|
85
|
-
const passingOpts = this.retrievePassingOptions();
|
|
86
|
-
const VisitorClz = this.retrieveVisitor(specPath) as typeof Visitor;
|
|
87
|
-
const visitorOpts = { ...passingOpts, ...options };
|
|
88
|
-
|
|
89
|
-
return new VisitorClz(visitorOpts);
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
toRefractedElement(specPath: string[], element: any, options = {}) {
|
|
93
|
-
/**
|
|
94
|
-
* This is `Visitor shortcut`: a mechanism for short-circuiting the traversal and replacing
|
|
95
|
-
* it by basic node cloning.
|
|
96
|
-
*
|
|
97
|
-
* Visiting the element is equivalent to cloning it if the prototype of a visitor
|
|
98
|
-
* is the same as the prototype of FallbackVisitor. If that's the case, we can avoid
|
|
99
|
-
* bootstrapping the traversal cycle for fields that don't require any special visiting.
|
|
100
|
-
*/
|
|
101
|
-
const visitor = this.retrieveVisitorInstance(specPath, options);
|
|
102
|
-
|
|
103
|
-
if (visitor instanceof FallbackVisitor && visitor?.constructor === FallbackVisitor) {
|
|
104
|
-
return this.consume ? element : cloneDeep(element);
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
traverse(element, visitor, { nodeTypeGetter: getNodePrimitiveType });
|
|
108
|
-
return visitor.element;
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
export default SpecificationVisitor;
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { deepmerge } from '@speclynx/apidom-core';
|
|
2
|
-
import {
|
|
3
|
-
Element,
|
|
4
|
-
ObjectElement,
|
|
5
|
-
SourceMapElement,
|
|
6
|
-
StyleElement,
|
|
7
|
-
cloneDeep,
|
|
8
|
-
} from '@speclynx/apidom-datamodel';
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* @public
|
|
12
|
-
*/
|
|
13
|
-
export interface VisitorOptions {
|
|
14
|
-
readonly consume?: boolean;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* @public
|
|
19
|
-
*/
|
|
20
|
-
class Visitor {
|
|
21
|
-
public element!: Element;
|
|
22
|
-
|
|
23
|
-
protected readonly consume: boolean = false;
|
|
24
|
-
|
|
25
|
-
protected consumeSafe: boolean = false;
|
|
26
|
-
|
|
27
|
-
constructor(options: VisitorOptions = {}) {
|
|
28
|
-
Object.assign(this, options);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
public copyMetaAndAttributes(from: Element, to: Element) {
|
|
32
|
-
if (!from.isMetaEmpty && !to.isMetaEmpty) {
|
|
33
|
-
to.meta = to.meta.merge(from.meta);
|
|
34
|
-
} else if (!from.isMetaEmpty) {
|
|
35
|
-
to.meta = from.meta.cloneDeep();
|
|
36
|
-
}
|
|
37
|
-
if (!from.isAttributesEmpty && !to.isAttributesEmpty) {
|
|
38
|
-
to.attributes = deepmerge(to.attributes, from.attributes) as ObjectElement;
|
|
39
|
-
} else if (!from.isAttributesEmpty) {
|
|
40
|
-
to.attributes = cloneDeep(from.attributes);
|
|
41
|
-
}
|
|
42
|
-
SourceMapElement.transfer(from, to);
|
|
43
|
-
StyleElement.transfer(from, to);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
export default Visitor;
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { ifElse, always } from 'ramda';
|
|
2
|
-
import { dispatch, stubUndefined } from 'ramda-adjunct';
|
|
3
|
-
import { Element } from '@speclynx/apidom-datamodel';
|
|
4
|
-
import { Path } from '@speclynx/apidom-traverse';
|
|
5
|
-
|
|
6
|
-
import SpecificationVisitor, { SpecificationVisitorOptions } from '../SpecificationVisitor.ts';
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* @public
|
|
10
|
-
*/
|
|
11
|
-
export type Alternator = { predicate: (element: unknown) => boolean; specPath: string[] };
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* @public
|
|
15
|
-
*/
|
|
16
|
-
export interface AlternatingVisitorOptions extends SpecificationVisitorOptions {
|
|
17
|
-
readonly alternator: Alternator[];
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* @public
|
|
22
|
-
*/
|
|
23
|
-
class AlternatingVisitor extends SpecificationVisitor {
|
|
24
|
-
protected alternator: Alternator[];
|
|
25
|
-
|
|
26
|
-
constructor({ alternator, ...rest }: AlternatingVisitorOptions) {
|
|
27
|
-
super({ ...rest });
|
|
28
|
-
this.alternator = alternator || [];
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
enter(path: Path<Element>) {
|
|
32
|
-
const element = path.node;
|
|
33
|
-
const functions = this.alternator.map(
|
|
34
|
-
({ predicate, specPath }: { predicate: (element: unknown) => boolean; specPath: string[] }) =>
|
|
35
|
-
ifElse(predicate, always(specPath), stubUndefined),
|
|
36
|
-
);
|
|
37
|
-
const specPath = dispatch(functions)(element);
|
|
38
|
-
|
|
39
|
-
this.element = this.toRefractedElement(specPath, element);
|
|
40
|
-
|
|
41
|
-
path.stop();
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
export default AlternatingVisitor;
|
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
isStringElement,
|
|
3
|
-
MemberElement,
|
|
4
|
-
Element,
|
|
5
|
-
ObjectElement,
|
|
6
|
-
cloneDeep,
|
|
7
|
-
} from '@speclynx/apidom-datamodel';
|
|
8
|
-
import { toValue } from '@speclynx/apidom-core';
|
|
9
|
-
import { Path } from '@speclynx/apidom-traverse';
|
|
10
|
-
|
|
11
|
-
import SpecificationVisitor, { SpecificationVisitorOptions } from '../SpecificationVisitor.ts';
|
|
12
|
-
import { isOpenApiExtension } from '../../predicates.ts';
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* @public
|
|
16
|
-
*/
|
|
17
|
-
export type SpecPath<T = string[]> = (element: unknown) => T;
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* @public
|
|
21
|
-
*/
|
|
22
|
-
export interface FixedFieldsVisitorOptions extends SpecificationVisitorOptions {
|
|
23
|
-
readonly specPath: SpecPath;
|
|
24
|
-
readonly ignoredFields?: string[];
|
|
25
|
-
readonly canSupportSpecificationExtensions?: boolean;
|
|
26
|
-
readonly specificationExtensionPredicate?: typeof isOpenApiExtension;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* @public
|
|
31
|
-
*/
|
|
32
|
-
class FixedFieldsVisitor extends SpecificationVisitor {
|
|
33
|
-
protected specPath: SpecPath;
|
|
34
|
-
|
|
35
|
-
protected ignoredFields: string[];
|
|
36
|
-
|
|
37
|
-
protected canSupportSpecificationExtensions: boolean = true;
|
|
38
|
-
|
|
39
|
-
protected specificationExtensionPredicate = isOpenApiExtension;
|
|
40
|
-
|
|
41
|
-
constructor({
|
|
42
|
-
specPath,
|
|
43
|
-
ignoredFields,
|
|
44
|
-
canSupportSpecificationExtensions,
|
|
45
|
-
specificationExtensionPredicate,
|
|
46
|
-
...rest
|
|
47
|
-
}: FixedFieldsVisitorOptions) {
|
|
48
|
-
super({ ...rest });
|
|
49
|
-
this.specPath = specPath;
|
|
50
|
-
this.ignoredFields = ignoredFields || [];
|
|
51
|
-
|
|
52
|
-
if (typeof canSupportSpecificationExtensions === 'boolean') {
|
|
53
|
-
this.canSupportSpecificationExtensions = canSupportSpecificationExtensions;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
if (typeof specificationExtensionPredicate === 'function') {
|
|
57
|
-
this.specificationExtensionPredicate = specificationExtensionPredicate;
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
ObjectElement(path: Path<ObjectElement>) {
|
|
62
|
-
const objectElement = path.node;
|
|
63
|
-
const specPath = this.specPath(objectElement);
|
|
64
|
-
const fields = this.retrieveFixedFields(specPath);
|
|
65
|
-
|
|
66
|
-
// @ts-ignore
|
|
67
|
-
objectElement.forEach((value: Element, key: Element, memberElement: MemberElement) => {
|
|
68
|
-
const keyValue = toValue(key) as string;
|
|
69
|
-
if (
|
|
70
|
-
isStringElement(key) &&
|
|
71
|
-
fields.includes(keyValue) &&
|
|
72
|
-
!this.ignoredFields.includes(keyValue)
|
|
73
|
-
) {
|
|
74
|
-
const fixedFieldElement = this.toRefractedElement(
|
|
75
|
-
[...specPath, 'fixedFields', keyValue],
|
|
76
|
-
value,
|
|
77
|
-
);
|
|
78
|
-
const newMemberElement = new MemberElement(
|
|
79
|
-
this.consume ? key : cloneDeep(key),
|
|
80
|
-
fixedFieldElement,
|
|
81
|
-
);
|
|
82
|
-
this.copyMetaAndAttributes(memberElement, newMemberElement);
|
|
83
|
-
(this.element.content as Element[]).push(newMemberElement);
|
|
84
|
-
// consume: release processed generic subtree
|
|
85
|
-
if (this.consume && this.consumeSafe && !memberElement.isFrozen)
|
|
86
|
-
memberElement.value = undefined;
|
|
87
|
-
} else if (
|
|
88
|
-
this.canSupportSpecificationExtensions &&
|
|
89
|
-
this.specificationExtensionPredicate(memberElement)
|
|
90
|
-
) {
|
|
91
|
-
const extensionElement = this.toRefractedElement(['document', 'extension'], memberElement);
|
|
92
|
-
(this.element.content as Element[]).push(extensionElement);
|
|
93
|
-
// consume: release processed generic subtree
|
|
94
|
-
if (this.consume && this.consumeSafe && !memberElement.isFrozen) {
|
|
95
|
-
memberElement.value = undefined;
|
|
96
|
-
}
|
|
97
|
-
} else if (!this.ignoredFields.includes(keyValue)) {
|
|
98
|
-
(this.element.content as Element[]).push(
|
|
99
|
-
this.consume ? memberElement : cloneDeep(memberElement),
|
|
100
|
-
);
|
|
101
|
-
}
|
|
102
|
-
});
|
|
103
|
-
|
|
104
|
-
this.copyMetaAndAttributes(objectElement, this.element);
|
|
105
|
-
|
|
106
|
-
path.stop();
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
export default FixedFieldsVisitor;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { isNonEmptyString } from 'ramda-adjunct';
|
|
2
|
-
|
|
3
|
-
import PatternedFieldsVisitor, {
|
|
4
|
-
PatternedFieldsVisitorOptions,
|
|
5
|
-
SpecPath,
|
|
6
|
-
} from './PatternedFieldsVisitor.ts';
|
|
7
|
-
|
|
8
|
-
export type { SpecPath };
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* @public
|
|
12
|
-
*/
|
|
13
|
-
export interface MapVisitorOptions extends PatternedFieldsVisitorOptions {}
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* @public
|
|
17
|
-
*/
|
|
18
|
-
class MapVisitor extends PatternedFieldsVisitor {
|
|
19
|
-
constructor(options: MapVisitorOptions) {
|
|
20
|
-
super(options);
|
|
21
|
-
this.fieldPatternPredicate = isNonEmptyString;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export default MapVisitor;
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import { Mixin } from 'ts-mixer';
|
|
2
|
-
import { difference } from 'ramda';
|
|
3
|
-
import { ObjectElement, MemberElement, Element } from '@speclynx/apidom-datamodel';
|
|
4
|
-
import { toValue } from '@speclynx/apidom-core';
|
|
5
|
-
import { Path } from '@speclynx/apidom-traverse';
|
|
6
|
-
|
|
7
|
-
import FixedFieldsVisitor, { SpecPath } from './FixedFieldsVisitor.ts';
|
|
8
|
-
import PatternedFieldsVisitor, { PatternedFieldsVisitorOptions } from './PatternedFieldsVisitor.ts';
|
|
9
|
-
|
|
10
|
-
export type { SpecPath };
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* @public
|
|
14
|
-
*/
|
|
15
|
-
export interface MixedFieldsVisitorOptions extends PatternedFieldsVisitorOptions {
|
|
16
|
-
readonly specPathFixedFields: SpecPath;
|
|
17
|
-
readonly specPathPatternedFields: SpecPath;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* Base class for MixedFieldsVisitor combining FixedFieldsVisitor and PatternedFieldsVisitor.
|
|
22
|
-
* @public
|
|
23
|
-
*/
|
|
24
|
-
export const MixedFieldsVisitorBase = Mixin(FixedFieldsVisitor, PatternedFieldsVisitor);
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* @public
|
|
28
|
-
*/
|
|
29
|
-
class MixedFieldsVisitor extends MixedFieldsVisitorBase {
|
|
30
|
-
protected readonly specPathFixedFields: SpecPath;
|
|
31
|
-
|
|
32
|
-
protected readonly specPathPatternedFields: SpecPath;
|
|
33
|
-
|
|
34
|
-
constructor({
|
|
35
|
-
specPathFixedFields,
|
|
36
|
-
specPathPatternedFields,
|
|
37
|
-
...rest
|
|
38
|
-
}: MixedFieldsVisitorOptions) {
|
|
39
|
-
super({ ...rest });
|
|
40
|
-
this.specPathFixedFields = specPathFixedFields;
|
|
41
|
-
this.specPathPatternedFields = specPathPatternedFields;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
ObjectElement(path: Path<ObjectElement>) {
|
|
45
|
-
const objectElement = path.node;
|
|
46
|
-
const { specPath, ignoredFields } = this;
|
|
47
|
-
|
|
48
|
-
try {
|
|
49
|
-
this.specPath = this.specPathFixedFields;
|
|
50
|
-
const fixedFields = this.retrieveFixedFields(this.specPath(objectElement));
|
|
51
|
-
// let FixedFieldsVisitor only process fixed fields and leave rest to PatternedFieldsVisitor
|
|
52
|
-
// @ts-ignore
|
|
53
|
-
this.ignoredFields = [...ignoredFields, ...difference(objectElement.keys(), fixedFields)];
|
|
54
|
-
FixedFieldsVisitor.prototype.ObjectElement.call(this, path);
|
|
55
|
-
|
|
56
|
-
this.specPath = this.specPathPatternedFields;
|
|
57
|
-
this.ignoredFields = fixedFields;
|
|
58
|
-
PatternedFieldsVisitor.prototype.ObjectElement.call(this, path);
|
|
59
|
-
|
|
60
|
-
// reorder this.element members by original objectElement keys
|
|
61
|
-
const objectElementKeys = objectElement.keys() as string[];
|
|
62
|
-
(this.element.content as Element[]).sort((a: unknown, b: unknown) => {
|
|
63
|
-
return (
|
|
64
|
-
objectElementKeys.indexOf(toValue((a as MemberElement).key) as string) -
|
|
65
|
-
objectElementKeys.indexOf(toValue((b as MemberElement).key) as string)
|
|
66
|
-
);
|
|
67
|
-
});
|
|
68
|
-
} catch (e) {
|
|
69
|
-
this.specPath = specPath;
|
|
70
|
-
throw e;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
path.stop();
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
export default MixedFieldsVisitor;
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
import { F as stubFalse } from 'ramda';
|
|
2
|
-
import { ObjectElement, Element, MemberElement, cloneDeep } from '@speclynx/apidom-datamodel';
|
|
3
|
-
import { toValue } from '@speclynx/apidom-core';
|
|
4
|
-
import { Path } from '@speclynx/apidom-traverse';
|
|
5
|
-
|
|
6
|
-
import SpecificationVisitor, { SpecificationVisitorOptions } from '../SpecificationVisitor.ts';
|
|
7
|
-
import type { SpecPath } from './FixedFieldsVisitor.ts';
|
|
8
|
-
import { isOpenApiExtension } from '../../predicates.ts';
|
|
9
|
-
|
|
10
|
-
export type { SpecPath };
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* @public
|
|
14
|
-
*/
|
|
15
|
-
export interface PatternedFieldsVisitorOptions extends SpecificationVisitorOptions {
|
|
16
|
-
readonly specPath: SpecPath;
|
|
17
|
-
readonly ignoredFields?: string[];
|
|
18
|
-
readonly fieldPatternPredicate?: (...args: unknown[]) => boolean;
|
|
19
|
-
readonly canSupportSpecificationExtensions?: boolean;
|
|
20
|
-
readonly specificationExtensionPredicate?: typeof isOpenApiExtension;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* @public
|
|
25
|
-
*/
|
|
26
|
-
class PatternedFieldsVisitor extends SpecificationVisitor {
|
|
27
|
-
protected specPath: SpecPath;
|
|
28
|
-
|
|
29
|
-
protected ignoredFields: string[];
|
|
30
|
-
|
|
31
|
-
protected fieldPatternPredicate: (value: unknown) => boolean = stubFalse;
|
|
32
|
-
|
|
33
|
-
protected canSupportSpecificationExtensions: boolean = false;
|
|
34
|
-
|
|
35
|
-
protected specificationExtensionPredicate = isOpenApiExtension;
|
|
36
|
-
|
|
37
|
-
constructor({
|
|
38
|
-
specPath,
|
|
39
|
-
ignoredFields,
|
|
40
|
-
fieldPatternPredicate,
|
|
41
|
-
canSupportSpecificationExtensions,
|
|
42
|
-
specificationExtensionPredicate,
|
|
43
|
-
...rest
|
|
44
|
-
}: PatternedFieldsVisitorOptions) {
|
|
45
|
-
super({ ...rest });
|
|
46
|
-
this.specPath = specPath;
|
|
47
|
-
this.ignoredFields = ignoredFields || [];
|
|
48
|
-
|
|
49
|
-
if (typeof fieldPatternPredicate === 'function') {
|
|
50
|
-
this.fieldPatternPredicate = fieldPatternPredicate;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
if (typeof canSupportSpecificationExtensions === 'boolean') {
|
|
54
|
-
this.canSupportSpecificationExtensions = canSupportSpecificationExtensions;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
if (typeof specificationExtensionPredicate === 'function') {
|
|
58
|
-
this.specificationExtensionPredicate = specificationExtensionPredicate;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
ObjectElement(path: Path<ObjectElement>) {
|
|
63
|
-
const objectElement = path.node;
|
|
64
|
-
// @ts-ignore
|
|
65
|
-
objectElement.forEach((value: Element, key: Element, memberElement: MemberElement) => {
|
|
66
|
-
const keyValue = toValue(key) as string;
|
|
67
|
-
if (
|
|
68
|
-
this.canSupportSpecificationExtensions &&
|
|
69
|
-
this.specificationExtensionPredicate(memberElement)
|
|
70
|
-
) {
|
|
71
|
-
const extensionElement = this.toRefractedElement(['document', 'extension'], memberElement);
|
|
72
|
-
(this.element.content as Element[]).push(extensionElement);
|
|
73
|
-
} else if (!this.ignoredFields.includes(keyValue) && this.fieldPatternPredicate(keyValue)) {
|
|
74
|
-
const specPath = this.specPath(value);
|
|
75
|
-
const patternedFieldElement = this.toRefractedElement(specPath, value);
|
|
76
|
-
const newMemberElement = new MemberElement(
|
|
77
|
-
this.consume ? key : cloneDeep(key),
|
|
78
|
-
patternedFieldElement,
|
|
79
|
-
);
|
|
80
|
-
this.copyMetaAndAttributes(memberElement, newMemberElement);
|
|
81
|
-
newMemberElement.classes.push('patterned-field');
|
|
82
|
-
(this.element.content as Element[]).push(newMemberElement);
|
|
83
|
-
// consume: release processed generic subtree
|
|
84
|
-
if (this.consume && this.consumeSafe && !memberElement.isFrozen)
|
|
85
|
-
memberElement.value = undefined;
|
|
86
|
-
} else if (!this.ignoredFields.includes(keyValue)) {
|
|
87
|
-
(this.element.content as Element[]).push(
|
|
88
|
-
this.consume ? memberElement : cloneDeep(memberElement),
|
|
89
|
-
);
|
|
90
|
-
}
|
|
91
|
-
});
|
|
92
|
-
|
|
93
|
-
this.copyMetaAndAttributes(objectElement, this.element);
|
|
94
|
-
|
|
95
|
-
path.stop();
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
export default PatternedFieldsVisitor;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { always } from 'ramda';
|
|
2
|
-
import { ObjectElement } from '@speclynx/apidom-datamodel';
|
|
3
|
-
|
|
4
|
-
import { SpecPath } from '../generics/MapVisitor.ts';
|
|
5
|
-
import { BaseMapVisitor, BaseMapVisitorOptions } from './bases.ts';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* @public
|
|
9
|
-
*/
|
|
10
|
-
export type { BaseMapVisitorOptions as ContentVisitorOptions };
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* @public
|
|
14
|
-
*/
|
|
15
|
-
class ContentVisitor extends BaseMapVisitor {
|
|
16
|
-
declare public readonly element: ObjectElement;
|
|
17
|
-
|
|
18
|
-
declare protected readonly specPath: SpecPath<['document', 'objects', 'MediaType']>;
|
|
19
|
-
|
|
20
|
-
constructor(options: BaseMapVisitorOptions) {
|
|
21
|
-
super(options);
|
|
22
|
-
this.element = new ObjectElement();
|
|
23
|
-
this.element.classes.push('content');
|
|
24
|
-
this.specPath = always(['document', 'objects', 'MediaType']);
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export default ContentVisitor;
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { ObjectElement } from '@speclynx/apidom-datamodel';
|
|
2
|
-
import { Path } from '@speclynx/apidom-traverse';
|
|
3
|
-
|
|
4
|
-
import { SpecPath } from '../generics/MapVisitor.ts';
|
|
5
|
-
import { BaseMapVisitor, BaseMapVisitorOptions } from './bases.ts';
|
|
6
|
-
import { isReferenceLikeElement } from '../../predicates.ts';
|
|
7
|
-
import { isReferenceElement } from '../../../predicates.ts';
|
|
8
|
-
import ReferenceElement from '../../../elements/Reference.ts';
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* @public
|
|
12
|
-
*/
|
|
13
|
-
export type { BaseMapVisitorOptions as ExamplesVisitorOptions };
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* @public
|
|
17
|
-
*/
|
|
18
|
-
class ExamplesVisitor extends BaseMapVisitor {
|
|
19
|
-
declare public readonly element: ObjectElement;
|
|
20
|
-
|
|
21
|
-
declare protected readonly specPath: SpecPath<
|
|
22
|
-
['document', 'objects', 'Reference'] | ['document', 'objects', 'Example']
|
|
23
|
-
>;
|
|
24
|
-
|
|
25
|
-
declare protected readonly canSupportSpecificationExtensions: true;
|
|
26
|
-
|
|
27
|
-
constructor(options: BaseMapVisitorOptions) {
|
|
28
|
-
super(options);
|
|
29
|
-
this.element = new ObjectElement();
|
|
30
|
-
this.element.classes.push('examples');
|
|
31
|
-
this.specPath = (element: unknown) =>
|
|
32
|
-
isReferenceLikeElement(element)
|
|
33
|
-
? ['document', 'objects', 'Reference']
|
|
34
|
-
: ['document', 'objects', 'Example'];
|
|
35
|
-
this.canSupportSpecificationExtensions = true;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
ObjectElement(path: Path<ObjectElement>) {
|
|
39
|
-
BaseMapVisitor.prototype.ObjectElement.call(this, path);
|
|
40
|
-
|
|
41
|
-
// @ts-ignore
|
|
42
|
-
this.element.filter(isReferenceElement).forEach((referenceElement: ReferenceElement) => {
|
|
43
|
-
referenceElement.meta.set('referenced-element', 'example');
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
export default ExamplesVisitor;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { StringElement } from '@speclynx/apidom-datamodel';
|
|
2
|
-
import { toValue } from '@speclynx/apidom-core';
|
|
3
|
-
import { Path } from '@speclynx/apidom-traverse';
|
|
4
|
-
|
|
5
|
-
import { BaseSpecificationVisitor, BaseSpecificationVisitorOptions } from './bases.ts';
|
|
6
|
-
import OpenapiElement from '../../../elements/Openapi.ts';
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* @public
|
|
10
|
-
*/
|
|
11
|
-
export type { BaseSpecificationVisitorOptions as OpenapiVisitorOptions };
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* @public
|
|
15
|
-
*/
|
|
16
|
-
class OpenapiVisitor extends BaseSpecificationVisitor {
|
|
17
|
-
declare public element: OpenapiElement;
|
|
18
|
-
|
|
19
|
-
StringElement(path: Path<StringElement>) {
|
|
20
|
-
const stringElement = path.node;
|
|
21
|
-
const openapiElement = new OpenapiElement(toValue(stringElement) as string | undefined);
|
|
22
|
-
|
|
23
|
-
this.copyMetaAndAttributes(stringElement, openapiElement);
|
|
24
|
-
|
|
25
|
-
this.element = openapiElement;
|
|
26
|
-
path.stop();
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export default OpenapiVisitor;
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { ArrayElement, Element } from '@speclynx/apidom-datamodel';
|
|
2
|
-
import { Path } from '@speclynx/apidom-traverse';
|
|
3
|
-
|
|
4
|
-
import { BaseSpecificationVisitor, BaseSpecificationVisitorOptions } from './bases.ts';
|
|
5
|
-
import { isReferenceLikeElement } from '../../predicates.ts';
|
|
6
|
-
import { isReferenceElement } from '../../../predicates.ts';
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* @public
|
|
10
|
-
*/
|
|
11
|
-
export type { BaseSpecificationVisitorOptions as ParametersVisitorOptions };
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* @public
|
|
15
|
-
*/
|
|
16
|
-
class ParametersVisitor extends BaseSpecificationVisitor {
|
|
17
|
-
declare public readonly element: ArrayElement;
|
|
18
|
-
|
|
19
|
-
constructor(options: BaseSpecificationVisitorOptions) {
|
|
20
|
-
super(options);
|
|
21
|
-
this.element = new ArrayElement();
|
|
22
|
-
this.element.classes.push('parameters');
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
ArrayElement(path: Path<ArrayElement>) {
|
|
26
|
-
const arrayElement = path.node;
|
|
27
|
-
|
|
28
|
-
arrayElement.forEach((item: Element): void => {
|
|
29
|
-
const specPath = isReferenceLikeElement(item)
|
|
30
|
-
? ['document', 'objects', 'Reference']
|
|
31
|
-
: ['document', 'objects', 'Parameter'];
|
|
32
|
-
const element = this.toRefractedElement(specPath, item);
|
|
33
|
-
|
|
34
|
-
if (isReferenceElement(element)) {
|
|
35
|
-
element.meta.set('referenced-element', 'parameter');
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
this.element.push(element);
|
|
39
|
-
});
|
|
40
|
-
|
|
41
|
-
this.copyMetaAndAttributes(arrayElement, this.element);
|
|
42
|
-
|
|
43
|
-
path.stop();
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
export default ParametersVisitor;
|