@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,44 +0,0 @@
|
|
|
1
|
-
import { ArrayElement, isObjectElement, cloneDeep } from '@speclynx/apidom-datamodel';
|
|
2
|
-
import { Path } from '@speclynx/apidom-traverse';
|
|
3
|
-
|
|
4
|
-
import SecurityElement from '../../../elements/nces/Security.ts';
|
|
5
|
-
import { BaseSpecificationVisitor, BaseSpecificationVisitorOptions } from './bases.ts';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* @public
|
|
9
|
-
*/
|
|
10
|
-
export type { BaseSpecificationVisitorOptions as SecurityVisitorOptions };
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* @public
|
|
14
|
-
*/
|
|
15
|
-
class SecurityVisitor extends BaseSpecificationVisitor {
|
|
16
|
-
declare public readonly element: SecurityElement;
|
|
17
|
-
|
|
18
|
-
constructor(options: BaseSpecificationVisitorOptions) {
|
|
19
|
-
super(options);
|
|
20
|
-
this.element = new SecurityElement();
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
ArrayElement(path: Path<ArrayElement>) {
|
|
24
|
-
const arrayElement = path.node;
|
|
25
|
-
|
|
26
|
-
arrayElement.forEach((item) => {
|
|
27
|
-
if (isObjectElement(item)) {
|
|
28
|
-
const element = this.toRefractedElement(
|
|
29
|
-
['document', 'objects', 'SecurityRequirement'],
|
|
30
|
-
item,
|
|
31
|
-
);
|
|
32
|
-
this.element.push(element);
|
|
33
|
-
} else {
|
|
34
|
-
this.element.push(cloneDeep(item));
|
|
35
|
-
}
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
this.copyMetaAndAttributes(arrayElement, this.element);
|
|
39
|
-
|
|
40
|
-
path.stop();
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
export default SecurityVisitor;
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { ArrayElement, Element } from '@speclynx/apidom-datamodel';
|
|
2
|
-
import { Path } from '@speclynx/apidom-traverse';
|
|
3
|
-
|
|
4
|
-
import ServersElement from '../../../elements/nces/Servers.ts';
|
|
5
|
-
import { BaseSpecificationVisitor, BaseSpecificationVisitorOptions } from './bases.ts';
|
|
6
|
-
import { isServerLikeElement } from '../../predicates.ts';
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* @public
|
|
10
|
-
*/
|
|
11
|
-
export type { BaseSpecificationVisitorOptions as ServersVisitorOptions };
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* @public
|
|
15
|
-
*/
|
|
16
|
-
class ServersVisitor extends BaseSpecificationVisitor {
|
|
17
|
-
declare public readonly element: ServersElement;
|
|
18
|
-
|
|
19
|
-
constructor(options: BaseSpecificationVisitorOptions) {
|
|
20
|
-
super(options);
|
|
21
|
-
this.element = new ServersElement();
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
ArrayElement(path: Path<ArrayElement>) {
|
|
25
|
-
const arrayElement = path.node;
|
|
26
|
-
|
|
27
|
-
arrayElement.forEach((item: Element) => {
|
|
28
|
-
const specPath = isServerLikeElement(item) ? ['document', 'objects', 'Server'] : ['value'];
|
|
29
|
-
const element = this.toRefractedElement(specPath, item);
|
|
30
|
-
|
|
31
|
-
this.element.push(element);
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
this.copyMetaAndAttributes(arrayElement, this.element);
|
|
35
|
-
|
|
36
|
-
path.stop();
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
export default ServersVisitor;
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { ArrayElement, Element } from '@speclynx/apidom-datamodel';
|
|
2
|
-
import { Path } from '@speclynx/apidom-traverse';
|
|
3
|
-
|
|
4
|
-
import TagsElement from '../../../elements/nces/Tags.ts';
|
|
5
|
-
import { BaseSpecificationVisitor, BaseSpecificationVisitorOptions } from './bases.ts';
|
|
6
|
-
import { isTagLikeElement } from '../../predicates.ts';
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* @public
|
|
10
|
-
*/
|
|
11
|
-
export type { BaseSpecificationVisitorOptions as TagsVisitorOptions };
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* @public
|
|
15
|
-
*/
|
|
16
|
-
class TagsVisitor extends BaseSpecificationVisitor {
|
|
17
|
-
declare public readonly element: TagsElement;
|
|
18
|
-
|
|
19
|
-
constructor(options: BaseSpecificationVisitorOptions) {
|
|
20
|
-
super(options);
|
|
21
|
-
this.element = new TagsElement();
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
ArrayElement(path: Path<ArrayElement>) {
|
|
25
|
-
const arrayElement = path.node;
|
|
26
|
-
|
|
27
|
-
arrayElement.forEach((item: Element) => {
|
|
28
|
-
const specPath = isTagLikeElement(item) ? ['document', 'objects', 'Tag'] : ['value'];
|
|
29
|
-
const element = this.toRefractedElement(specPath, item);
|
|
30
|
-
|
|
31
|
-
this.element.push(element);
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
this.copyMetaAndAttributes(arrayElement, this.element);
|
|
35
|
-
|
|
36
|
-
path.stop();
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
export default TagsVisitor;
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import { Mixin } from 'ts-mixer';
|
|
2
|
-
|
|
3
|
-
import SpecificationVisitor, { SpecificationVisitorOptions } from '../SpecificationVisitor.ts';
|
|
4
|
-
import FallbackVisitor, { FallbackVisitorOptions } from '../FallbackVisitor.ts';
|
|
5
|
-
import FixedFieldsVisitor, { FixedFieldsVisitorOptions } from '../generics/FixedFieldsVisitor.ts';
|
|
6
|
-
import PatternedFieldsVisitor, {
|
|
7
|
-
PatternedFieldsVisitorOptions,
|
|
8
|
-
} from '../generics/PatternedFieldsVisitor.ts';
|
|
9
|
-
import MapVisitor, { MapVisitorOptions } from '../generics/MapVisitor.ts';
|
|
10
|
-
import AlternatingVisitor, { AlternatingVisitorOptions } from '../generics/AlternatingVisitor.ts';
|
|
11
|
-
import MixedFieldsVisitor, { MixedFieldsVisitorOptions } from '../generics/MixedFieldsVisitor.ts';
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Base class for visitors using Mixin(SpecificationVisitor, FallbackVisitor)
|
|
15
|
-
* @public
|
|
16
|
-
*/
|
|
17
|
-
export const BaseSpecificationVisitor = Mixin(SpecificationVisitor, FallbackVisitor);
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* @public
|
|
21
|
-
*/
|
|
22
|
-
export interface BaseSpecificationVisitorOptions
|
|
23
|
-
extends SpecificationVisitorOptions, FallbackVisitorOptions {}
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Base class for visitors using Mixin(FixedFieldsVisitor, FallbackVisitor)
|
|
27
|
-
* @public
|
|
28
|
-
*/
|
|
29
|
-
export const BaseFixedFieldsVisitor = Mixin(FixedFieldsVisitor, FallbackVisitor);
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* @public
|
|
33
|
-
*/
|
|
34
|
-
export interface BaseFixedFieldsVisitorOptions
|
|
35
|
-
extends FixedFieldsVisitorOptions, FallbackVisitorOptions {}
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* Base class for visitors using Mixin(PatternedFieldsVisitor, FallbackVisitor)
|
|
39
|
-
* @public
|
|
40
|
-
*/
|
|
41
|
-
export const BasePatternedFieldsVisitor = Mixin(PatternedFieldsVisitor, FallbackVisitor);
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* @public
|
|
45
|
-
*/
|
|
46
|
-
export interface BasePatternedFieldsVisitorOptions
|
|
47
|
-
extends PatternedFieldsVisitorOptions, FallbackVisitorOptions {}
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* Base class for visitors using Mixin(MapVisitor, FallbackVisitor)
|
|
51
|
-
* @public
|
|
52
|
-
*/
|
|
53
|
-
export const BaseMapVisitor = Mixin(MapVisitor, FallbackVisitor);
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* @public
|
|
57
|
-
*/
|
|
58
|
-
export interface BaseMapVisitorOptions extends MapVisitorOptions, FallbackVisitorOptions {}
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* Base class for visitors using Mixin(AlternatingVisitor, FallbackVisitor)
|
|
62
|
-
* @public
|
|
63
|
-
*/
|
|
64
|
-
export const BaseAlternatingVisitor = Mixin(AlternatingVisitor, FallbackVisitor);
|
|
65
|
-
|
|
66
|
-
/**
|
|
67
|
-
* @public
|
|
68
|
-
*/
|
|
69
|
-
export interface BaseAlternatingVisitorOptions
|
|
70
|
-
extends AlternatingVisitorOptions, FallbackVisitorOptions {}
|
|
71
|
-
|
|
72
|
-
/**
|
|
73
|
-
* Base class for visitors using Mixin(MixedFieldsVisitor, FallbackVisitor)
|
|
74
|
-
* @public
|
|
75
|
-
*/
|
|
76
|
-
export const BaseMixedFieldsVisitor = Mixin(MixedFieldsVisitor, FallbackVisitor);
|
|
77
|
-
|
|
78
|
-
/**
|
|
79
|
-
* @public
|
|
80
|
-
*/
|
|
81
|
-
export interface BaseMixedFieldsVisitorOptions
|
|
82
|
-
extends MixedFieldsVisitorOptions, FallbackVisitorOptions {}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { always } from 'ramda';
|
|
2
|
-
import { ObjectElement, StringElement } from '@speclynx/apidom-datamodel';
|
|
3
|
-
import { toValue } from '@speclynx/apidom-core';
|
|
4
|
-
import { Path } from '@speclynx/apidom-traverse';
|
|
5
|
-
|
|
6
|
-
import CallbackElement from '../../../../elements/Callback.ts';
|
|
7
|
-
import PathItemElement from '../../../../elements/PathItem.ts';
|
|
8
|
-
import { SpecPath } from '../../generics/PatternedFieldsVisitor.ts';
|
|
9
|
-
import MapVisitor from '../../generics/MapVisitor.ts';
|
|
10
|
-
import { isPathItemElement } from '../../../../predicates.ts';
|
|
11
|
-
import { BasePatternedFieldsVisitor, BasePatternedFieldsVisitorOptions } from '../bases.ts';
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* @public
|
|
15
|
-
*/
|
|
16
|
-
export type { BasePatternedFieldsVisitorOptions as CallbackVisitorOptions };
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* @public
|
|
20
|
-
*/
|
|
21
|
-
class CallbackVisitor extends BasePatternedFieldsVisitor {
|
|
22
|
-
declare public readonly element: CallbackElement;
|
|
23
|
-
|
|
24
|
-
declare protected readonly specPath: SpecPath;
|
|
25
|
-
|
|
26
|
-
declare protected readonly canSupportSpecificationExtensions: true;
|
|
27
|
-
|
|
28
|
-
constructor(options: BasePatternedFieldsVisitorOptions) {
|
|
29
|
-
super(options);
|
|
30
|
-
this.element = new CallbackElement();
|
|
31
|
-
this.specPath = always(['document', 'objects', 'PathItem']);
|
|
32
|
-
this.canSupportSpecificationExtensions = true;
|
|
33
|
-
this.fieldPatternPredicate = (value) => /{(?<expression>[^}]{1,2083})}/.test(String(value)); // 2,083 characters is the maximum length of a URL in Chrome
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
ObjectElement(path: Path<ObjectElement>) {
|
|
37
|
-
MapVisitor.prototype.ObjectElement.call(this, path);
|
|
38
|
-
|
|
39
|
-
// decorate every PathItemElement with Callback Object expression metadata
|
|
40
|
-
this.element
|
|
41
|
-
.filter(isPathItemElement)
|
|
42
|
-
// @ts-ignore
|
|
43
|
-
.forEach((pathItemElement: PathItemElement, key: StringElement) => {
|
|
44
|
-
pathItemElement.meta.set('runtime-expression', toValue(key));
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
export default CallbackVisitor;
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { ObjectElement } from '@speclynx/apidom-datamodel';
|
|
2
|
-
import { Path } from '@speclynx/apidom-traverse';
|
|
3
|
-
|
|
4
|
-
import ReferenceElement from '../../../../elements/Reference.ts';
|
|
5
|
-
import ComponentsCallbacksElement from '../../../../elements/nces/ComponentsCallbacks.ts';
|
|
6
|
-
import MapVisitor, { SpecPath } from '../../generics/MapVisitor.ts';
|
|
7
|
-
import { BaseMapVisitor, BaseMapVisitorOptions } from '../bases.ts';
|
|
8
|
-
import { isReferenceLikeElement } from '../../../predicates.ts';
|
|
9
|
-
import { isReferenceElement } from '../../../../predicates.ts';
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* @public
|
|
13
|
-
*/
|
|
14
|
-
export type { BaseMapVisitorOptions as CallbackVisitorOptions };
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* @public
|
|
18
|
-
*/
|
|
19
|
-
class CallbacksVisitor extends BaseMapVisitor {
|
|
20
|
-
declare public readonly element: ComponentsCallbacksElement;
|
|
21
|
-
|
|
22
|
-
declare protected readonly specPath: SpecPath<
|
|
23
|
-
['document', 'objects', 'Reference'] | ['document', 'objects', 'Callback']
|
|
24
|
-
>;
|
|
25
|
-
|
|
26
|
-
constructor(options: BaseMapVisitorOptions) {
|
|
27
|
-
super(options);
|
|
28
|
-
this.element = new ComponentsCallbacksElement();
|
|
29
|
-
this.specPath = (element: unknown) =>
|
|
30
|
-
isReferenceLikeElement(element)
|
|
31
|
-
? ['document', 'objects', 'Reference']
|
|
32
|
-
: ['document', 'objects', 'Callback'];
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
ObjectElement(path: Path<ObjectElement>) {
|
|
36
|
-
MapVisitor.prototype.ObjectElement.call(this, path);
|
|
37
|
-
|
|
38
|
-
// @ts-ignore
|
|
39
|
-
this.element.filter(isReferenceElement).forEach((referenceElement: ReferenceElement) => {
|
|
40
|
-
referenceElement.meta.set('referenced-element', 'callback');
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
export default CallbacksVisitor;
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { ObjectElement } from '@speclynx/apidom-datamodel';
|
|
2
|
-
import { Path } from '@speclynx/apidom-traverse';
|
|
3
|
-
|
|
4
|
-
import ReferenceElement from '../../../../elements/Reference.ts';
|
|
5
|
-
import ComponentsExamplesElement from '../../../../elements/nces/ComponentsExamples.ts';
|
|
6
|
-
import MapVisitor, { SpecPath } from '../../generics/MapVisitor.ts';
|
|
7
|
-
import { BaseMapVisitor, BaseMapVisitorOptions } from '../bases.ts';
|
|
8
|
-
import { isReferenceLikeElement } from '../../../predicates.ts';
|
|
9
|
-
import { isReferenceElement } from '../../../../predicates.ts';
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* @public
|
|
13
|
-
*/
|
|
14
|
-
export type { BaseMapVisitorOptions as ExamplesVisitorOptions };
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* @public
|
|
18
|
-
*/
|
|
19
|
-
class ExamplesVisitor extends BaseMapVisitor {
|
|
20
|
-
declare public readonly element: ComponentsExamplesElement;
|
|
21
|
-
|
|
22
|
-
declare protected readonly specPath: SpecPath<
|
|
23
|
-
['document', 'objects', 'Reference'] | ['document', 'objects', 'Example']
|
|
24
|
-
>;
|
|
25
|
-
|
|
26
|
-
constructor(options: BaseMapVisitorOptions) {
|
|
27
|
-
super(options);
|
|
28
|
-
this.element = new ComponentsExamplesElement();
|
|
29
|
-
this.specPath = (element: unknown) =>
|
|
30
|
-
isReferenceLikeElement(element)
|
|
31
|
-
? ['document', 'objects', 'Reference']
|
|
32
|
-
: ['document', 'objects', 'Example'];
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
ObjectElement(path: Path<ObjectElement>) {
|
|
36
|
-
MapVisitor.prototype.ObjectElement.call(this, path);
|
|
37
|
-
|
|
38
|
-
// decorate every ReferenceElement with metadata about their referencing type
|
|
39
|
-
// @ts-ignore
|
|
40
|
-
this.element.filter(isReferenceElement).forEach((referenceElement: ReferenceElement) => {
|
|
41
|
-
referenceElement.meta.set('referenced-element', 'example');
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
export default ExamplesVisitor;
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { ObjectElement, Element, StringElement } from '@speclynx/apidom-datamodel';
|
|
2
|
-
import { toValue } from '@speclynx/apidom-core';
|
|
3
|
-
import { Path } from '@speclynx/apidom-traverse';
|
|
4
|
-
|
|
5
|
-
import ReferenceElement from '../../../../elements/Reference.ts';
|
|
6
|
-
import ComponentsHeadersElement from '../../../../elements/nces/ComponentsHeaders.ts';
|
|
7
|
-
import MapVisitor, { SpecPath } from '../../generics/MapVisitor.ts';
|
|
8
|
-
import { BaseMapVisitor, BaseMapVisitorOptions } from '../bases.ts';
|
|
9
|
-
import { isReferenceLikeElement } from '../../../predicates.ts';
|
|
10
|
-
import { isReferenceElement, isHeaderElement } from '../../../../predicates.ts';
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* @public
|
|
14
|
-
*/
|
|
15
|
-
export type { BaseMapVisitorOptions as HeadersVisitorOptions };
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* @public
|
|
19
|
-
*/
|
|
20
|
-
class HeadersVisitor extends BaseMapVisitor {
|
|
21
|
-
declare public readonly element: ComponentsHeadersElement;
|
|
22
|
-
|
|
23
|
-
declare protected readonly specPath: SpecPath<
|
|
24
|
-
['document', 'objects', 'Reference'] | ['document', 'objects', 'Header']
|
|
25
|
-
>;
|
|
26
|
-
|
|
27
|
-
constructor(options: BaseMapVisitorOptions) {
|
|
28
|
-
super(options);
|
|
29
|
-
this.element = new ComponentsHeadersElement();
|
|
30
|
-
this.specPath = (element: unknown) =>
|
|
31
|
-
isReferenceLikeElement(element)
|
|
32
|
-
? ['document', 'objects', 'Reference']
|
|
33
|
-
: ['document', 'objects', 'Header'];
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
ObjectElement(path: Path<ObjectElement>) {
|
|
37
|
-
MapVisitor.prototype.ObjectElement.call(this, path);
|
|
38
|
-
|
|
39
|
-
// decorate every ReferenceElement with metadata about their referencing type
|
|
40
|
-
// @ts-ignore
|
|
41
|
-
this.element.filter(isReferenceElement).forEach((referenceElement: ReferenceElement) => {
|
|
42
|
-
referenceElement.meta.set('referenced-element', 'header');
|
|
43
|
-
});
|
|
44
|
-
|
|
45
|
-
// decorate every HeaderElement with metadata about their name
|
|
46
|
-
// @ts-ignore
|
|
47
|
-
this.element.filter(isHeaderElement).forEach((value: Element, key: StringElement) => {
|
|
48
|
-
value.meta.set('header-name', toValue(key));
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
export default HeadersVisitor;
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { ObjectElement } from '@speclynx/apidom-datamodel';
|
|
2
|
-
import { Path } from '@speclynx/apidom-traverse';
|
|
3
|
-
|
|
4
|
-
import ReferenceElement from '../../../../elements/Reference.ts';
|
|
5
|
-
import ComponentsLinksElement from '../../../../elements/nces/ComponentsLinks.ts';
|
|
6
|
-
import MapVisitor, { SpecPath } from '../../generics/MapVisitor.ts';
|
|
7
|
-
import { BaseMapVisitor, BaseMapVisitorOptions } from '../bases.ts';
|
|
8
|
-
import { isReferenceLikeElement } from '../../../predicates.ts';
|
|
9
|
-
import { isReferenceElement } from '../../../../predicates.ts';
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* @public
|
|
13
|
-
*/
|
|
14
|
-
export type { BaseMapVisitorOptions as LinksVisitorOptions };
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* @public
|
|
18
|
-
*/
|
|
19
|
-
class LinksVisitor extends BaseMapVisitor {
|
|
20
|
-
declare public readonly element: ComponentsLinksElement;
|
|
21
|
-
|
|
22
|
-
declare protected readonly specPath: SpecPath<
|
|
23
|
-
['document', 'objects', 'Reference'] | ['document', 'objects', 'Link']
|
|
24
|
-
>;
|
|
25
|
-
|
|
26
|
-
constructor(options: BaseMapVisitorOptions) {
|
|
27
|
-
super(options);
|
|
28
|
-
this.element = new ComponentsLinksElement();
|
|
29
|
-
this.specPath = (element: unknown) =>
|
|
30
|
-
isReferenceLikeElement(element)
|
|
31
|
-
? ['document', 'objects', 'Reference']
|
|
32
|
-
: ['document', 'objects', 'Link'];
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
ObjectElement(path: Path<ObjectElement>) {
|
|
36
|
-
MapVisitor.prototype.ObjectElement.call(this, path);
|
|
37
|
-
|
|
38
|
-
// @ts-ignore
|
|
39
|
-
this.element.filter(isReferenceElement).forEach((referenceElement: ReferenceElement) => {
|
|
40
|
-
referenceElement.meta.set('referenced-element', 'link');
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
export default LinksVisitor;
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { ObjectElement } from '@speclynx/apidom-datamodel';
|
|
2
|
-
import { Path } from '@speclynx/apidom-traverse';
|
|
3
|
-
|
|
4
|
-
import ReferenceElement from '../../../../elements/Reference.ts';
|
|
5
|
-
import ComponentsParametersElement from '../../../../elements/nces/ComponentsParameters.ts';
|
|
6
|
-
import MapVisitor, { SpecPath } from '../../generics/MapVisitor.ts';
|
|
7
|
-
import { BaseMapVisitor, BaseMapVisitorOptions } from '../bases.ts';
|
|
8
|
-
import { isReferenceLikeElement } from '../../../predicates.ts';
|
|
9
|
-
import { isReferenceElement } from '../../../../predicates.ts';
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* @public
|
|
13
|
-
*/
|
|
14
|
-
export type { BaseMapVisitorOptions as ParametersVisitorOptions };
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* @public
|
|
18
|
-
*/
|
|
19
|
-
class ParametersVisitor extends BaseMapVisitor {
|
|
20
|
-
declare public readonly element: ComponentsParametersElement;
|
|
21
|
-
|
|
22
|
-
declare protected readonly specPath: SpecPath<
|
|
23
|
-
['document', 'objects', 'Reference'] | ['document', 'objects', 'Parameter']
|
|
24
|
-
>;
|
|
25
|
-
|
|
26
|
-
constructor(options: BaseMapVisitorOptions) {
|
|
27
|
-
super(options);
|
|
28
|
-
this.element = new ComponentsParametersElement();
|
|
29
|
-
this.specPath = (element: unknown) =>
|
|
30
|
-
isReferenceLikeElement(element)
|
|
31
|
-
? ['document', 'objects', 'Reference']
|
|
32
|
-
: ['document', 'objects', 'Parameter'];
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
ObjectElement(path: Path<ObjectElement>) {
|
|
36
|
-
MapVisitor.prototype.ObjectElement.call(this, path);
|
|
37
|
-
|
|
38
|
-
// decorate every ReferenceElement with metadata about their referencing type
|
|
39
|
-
// @ts-ignore
|
|
40
|
-
this.element.filter(isReferenceElement).forEach((referenceElement: ReferenceElement) => {
|
|
41
|
-
referenceElement.meta.set('referenced-element', 'parameter');
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
export default ParametersVisitor;
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { ObjectElement } from '@speclynx/apidom-datamodel';
|
|
2
|
-
import { Path } from '@speclynx/apidom-traverse';
|
|
3
|
-
|
|
4
|
-
import ReferenceElement from '../../../../elements/Reference.ts';
|
|
5
|
-
import ComponentsRequestBodiesElement from '../../../../elements/nces/ComponentsRequestBodies.ts';
|
|
6
|
-
import MapVisitor, { SpecPath } from '../../generics/MapVisitor.ts';
|
|
7
|
-
import { BaseMapVisitor, BaseMapVisitorOptions } from '../bases.ts';
|
|
8
|
-
import { isReferenceLikeElement } from '../../../predicates.ts';
|
|
9
|
-
import { isReferenceElement } from '../../../../predicates.ts';
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* @public
|
|
13
|
-
*/
|
|
14
|
-
export type { BaseMapVisitorOptions as RequestBodiesVisitorOptions };
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* @public
|
|
18
|
-
*/
|
|
19
|
-
class RequestBodiesVisitor extends BaseMapVisitor {
|
|
20
|
-
declare public readonly element: ComponentsRequestBodiesElement;
|
|
21
|
-
|
|
22
|
-
declare protected readonly specPath: SpecPath<
|
|
23
|
-
['document', 'objects', 'Reference'] | ['document', 'objects', 'RequestBody']
|
|
24
|
-
>;
|
|
25
|
-
|
|
26
|
-
constructor(options: BaseMapVisitorOptions) {
|
|
27
|
-
super(options);
|
|
28
|
-
this.element = new ComponentsRequestBodiesElement();
|
|
29
|
-
this.specPath = (element: unknown) =>
|
|
30
|
-
isReferenceLikeElement(element)
|
|
31
|
-
? ['document', 'objects', 'Reference']
|
|
32
|
-
: ['document', 'objects', 'RequestBody'];
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
ObjectElement(path: Path<ObjectElement>) {
|
|
36
|
-
MapVisitor.prototype.ObjectElement.call(this, path);
|
|
37
|
-
|
|
38
|
-
// @ts-ignore
|
|
39
|
-
this.element.filter(isReferenceElement).forEach((referenceElement: ReferenceElement) => {
|
|
40
|
-
referenceElement.meta.set('referenced-element', 'requestBody');
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
export default RequestBodiesVisitor;
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { ObjectElement, Element, StringElement } from '@speclynx/apidom-datamodel';
|
|
2
|
-
import { toValue } from '@speclynx/apidom-core';
|
|
3
|
-
import { Path } from '@speclynx/apidom-traverse';
|
|
4
|
-
|
|
5
|
-
import ReferenceElement from '../../../../elements/Reference.ts';
|
|
6
|
-
import ComponentsResponsesElement from '../../../../elements/nces/ComponentsResponses.ts';
|
|
7
|
-
import MapVisitor, { SpecPath } from '../../generics/MapVisitor.ts';
|
|
8
|
-
import { BaseMapVisitor, BaseMapVisitorOptions } from '../bases.ts';
|
|
9
|
-
import { isReferenceLikeElement } from '../../../predicates.ts';
|
|
10
|
-
import { isReferenceElement, isResponseElement } from '../../../../predicates.ts';
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* @public
|
|
14
|
-
*/
|
|
15
|
-
export type { BaseMapVisitorOptions as ResponsesVisitorOptions };
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* @public
|
|
19
|
-
*/
|
|
20
|
-
class ResponsesVisitor extends BaseMapVisitor {
|
|
21
|
-
declare public readonly element: ComponentsResponsesElement;
|
|
22
|
-
|
|
23
|
-
declare protected readonly specPath: SpecPath<
|
|
24
|
-
['document', 'objects', 'Reference'] | ['document', 'objects', 'Response']
|
|
25
|
-
>;
|
|
26
|
-
|
|
27
|
-
constructor(options: BaseMapVisitorOptions) {
|
|
28
|
-
super(options);
|
|
29
|
-
this.element = new ComponentsResponsesElement();
|
|
30
|
-
this.specPath = (element: unknown) =>
|
|
31
|
-
isReferenceLikeElement(element)
|
|
32
|
-
? ['document', 'objects', 'Reference']
|
|
33
|
-
: ['document', 'objects', 'Response'];
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
ObjectElement(path: Path<ObjectElement>) {
|
|
37
|
-
MapVisitor.prototype.ObjectElement.call(this, path);
|
|
38
|
-
|
|
39
|
-
// decorate every ReferenceElement with metadata about their referencing type
|
|
40
|
-
// @ts-ignore
|
|
41
|
-
this.element.filter(isReferenceElement).forEach((referenceElement: ReferenceElement) => {
|
|
42
|
-
referenceElement.meta.set('referenced-element', 'response');
|
|
43
|
-
});
|
|
44
|
-
|
|
45
|
-
// decorate every ResponseElement with metadata about their status code
|
|
46
|
-
// @ts-ignore
|
|
47
|
-
this.element.filter(isResponseElement).forEach((value: Element, key: StringElement) => {
|
|
48
|
-
value.meta.set('http-status-code', toValue(key));
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
export default ResponsesVisitor;
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { ObjectElement } from '@speclynx/apidom-datamodel';
|
|
2
|
-
import { Path } from '@speclynx/apidom-traverse';
|
|
3
|
-
|
|
4
|
-
import ReferenceElement from '../../../../elements/Reference.ts';
|
|
5
|
-
import ComponentsSchemasElement from '../../../../elements/nces/ComponentsSchemas.ts';
|
|
6
|
-
import MapVisitor, { SpecPath } from '../../generics/MapVisitor.ts';
|
|
7
|
-
import { BaseMapVisitor, BaseMapVisitorOptions } from '../bases.ts';
|
|
8
|
-
import { isReferenceLikeElement } from '../../../predicates.ts';
|
|
9
|
-
import { isReferenceElement } from '../../../../predicates.ts';
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* @public
|
|
13
|
-
*/
|
|
14
|
-
export type { BaseMapVisitorOptions as SchemasVisitorOptions };
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* @public
|
|
18
|
-
*/
|
|
19
|
-
class SchemasVisitor extends BaseMapVisitor {
|
|
20
|
-
declare public readonly element: ComponentsSchemasElement;
|
|
21
|
-
|
|
22
|
-
declare protected readonly specPath: SpecPath<
|
|
23
|
-
['document', 'objects', 'Reference'] | ['document', 'objects', 'Schema']
|
|
24
|
-
>;
|
|
25
|
-
|
|
26
|
-
constructor(options: BaseMapVisitorOptions) {
|
|
27
|
-
super(options);
|
|
28
|
-
this.element = new ComponentsSchemasElement();
|
|
29
|
-
this.specPath = (element: unknown) =>
|
|
30
|
-
isReferenceLikeElement(element)
|
|
31
|
-
? ['document', 'objects', 'Reference']
|
|
32
|
-
: ['document', 'objects', 'Schema'];
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
ObjectElement(path: Path<ObjectElement>) {
|
|
36
|
-
MapVisitor.prototype.ObjectElement.call(this, path);
|
|
37
|
-
|
|
38
|
-
// decorate every ReferenceElement with metadata about their referencing type
|
|
39
|
-
// @ts-ignore
|
|
40
|
-
this.element.filter(isReferenceElement).forEach((referenceElement: ReferenceElement) => {
|
|
41
|
-
referenceElement.meta.set('referenced-element', 'schema');
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
export default SchemasVisitor;
|