@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,557 +0,0 @@
|
|
|
1
|
-
import { specificationObj as JSONSchemaDraft4Specification } from '@speclynx/apidom-ns-json-schema-draft-4';
|
|
2
|
-
|
|
3
|
-
import OpenApi3_0Visitor from './visitors/open-api-3-0/index.ts';
|
|
4
|
-
import OpenapiVisitor from './visitors/open-api-3-0/OpenapiVisitor.ts';
|
|
5
|
-
import SpecificationExtensionVisitor from './visitors/SpecificationExtensionVisitor.ts';
|
|
6
|
-
import InfoVisitor from './visitors/open-api-3-0/info/index.ts';
|
|
7
|
-
import InfoVersionVisitor from './visitors/open-api-3-0/info/VersionVisitor.ts';
|
|
8
|
-
import ContactVisitor from './visitors/open-api-3-0/contact/index.ts';
|
|
9
|
-
import LicenseVisitor from './visitors/open-api-3-0/license/index.ts';
|
|
10
|
-
import LinkVisitor from './visitors/open-api-3-0/link/index.ts';
|
|
11
|
-
import LinkOperationRefVisitor from './visitors/open-api-3-0/link/OperationRefVisitor.ts';
|
|
12
|
-
import LinkOperationIdVisitor from './visitors/open-api-3-0/link/OperationIdVisitor.ts';
|
|
13
|
-
import LinkParametersVisitor from './visitors/open-api-3-0/link/ParametersVisitor.ts';
|
|
14
|
-
import ServerVisitor from './visitors/open-api-3-0/server/index.ts';
|
|
15
|
-
import ServerUrlVisitor from './visitors/open-api-3-0/server/UrlVisitor.ts';
|
|
16
|
-
import ServersVisitor from './visitors/open-api-3-0/ServersVisitor.ts';
|
|
17
|
-
import ServerVariableVisitor from './visitors/open-api-3-0/server-variable/index.ts';
|
|
18
|
-
import ServerVariablesVisitor from './visitors/open-api-3-0/server/VariablesVisitor.ts';
|
|
19
|
-
import FallbackVisitor from './visitors/FallbackVisitor.ts';
|
|
20
|
-
import MediaTypeVisitor from './visitors/open-api-3-0/media-type/index.ts';
|
|
21
|
-
import MediaTypeSchemaVisitor from './visitors/open-api-3-0/media-type/SchemaVisitor.ts';
|
|
22
|
-
import MediaTypeExamplesVisitor from './visitors/open-api-3-0/media-type/ExamplesVisitor.ts';
|
|
23
|
-
import MediaTypeEncodingVisitor from './visitors/open-api-3-0/media-type/EncodingVisitor.ts';
|
|
24
|
-
import SecurityRequirementVisitor from './visitors/open-api-3-0/security-requirement/index.ts';
|
|
25
|
-
import SecurityVisitor from './visitors/open-api-3-0/SecurityVisitor.ts';
|
|
26
|
-
import ComponentsVisitor from './visitors/open-api-3-0/components/index.ts';
|
|
27
|
-
import TagVisitor from './visitors/open-api-3-0/tag/index.ts';
|
|
28
|
-
import ReferenceVisitor from './visitors/open-api-3-0/reference/index.ts';
|
|
29
|
-
import Reference$RefVisitor from './visitors/open-api-3-0/reference/$RefVisitor.ts';
|
|
30
|
-
import ParameterVisitor from './visitors/open-api-3-0/parameter/index.ts';
|
|
31
|
-
import ParameterSchemaVisitor from './visitors/open-api-3-0/parameter/SchemaVisitor.ts';
|
|
32
|
-
import HeaderVisitor from './visitors/open-api-3-0/header/index.ts';
|
|
33
|
-
import HeaderSchemaVisitor from './visitors/open-api-3-0/header/SchemaVisitor.ts';
|
|
34
|
-
import HeaderExamplesVisitor from './visitors/open-api-3-0/header/ExamplesVisitor.ts';
|
|
35
|
-
import HeaderContentVisitor from './visitors/open-api-3-0/header/ContentVisitor.ts';
|
|
36
|
-
import SchemaVisitor from './visitors/open-api-3-0/schema/index.ts';
|
|
37
|
-
import SchemaAllOfVisitor from './visitors/open-api-3-0/schema/AllOfVisitor.ts';
|
|
38
|
-
import SchemaAnyOfVisitor from './visitors/open-api-3-0/schema/AnyOfVisitor.ts';
|
|
39
|
-
import SchemaOneOfVisitor from './visitors/open-api-3-0/schema/OneOfVisitor.ts';
|
|
40
|
-
import SchemaItemsVisitor from './visitors/open-api-3-0/schema/ItemsVisitor.ts';
|
|
41
|
-
import SchemaPropertiesVisitor from './visitors/open-api-3-0/schema/PropertiesVisitor.ts';
|
|
42
|
-
import SchemaTypeVisitor from './visitors/open-api-3-0/schema/TypeVisitor.ts';
|
|
43
|
-
import SchemaOrReferenceVisitor from './visitors/open-api-3-0/schema/SchemaOrReferenceVisitor.ts';
|
|
44
|
-
import DiscriminatorVisitor from './visitors/open-api-3-0/distriminator/index.ts';
|
|
45
|
-
import DiscriminatorMappingVisitor from './visitors/open-api-3-0/distriminator/MappingVisitor.ts';
|
|
46
|
-
import XmlVisitor from './visitors/open-api-3-0/xml/index.ts';
|
|
47
|
-
import ParameterExamplesVisitor from './visitors/open-api-3-0/parameter/ExamplesVisitor.ts';
|
|
48
|
-
import ParameterContentVisitor from './visitors/open-api-3-0/parameter/ContentVisitor.ts';
|
|
49
|
-
import ComponentsSchemasVisitor from './visitors/open-api-3-0/components/SchemasVisitor.ts';
|
|
50
|
-
import ComponentsResponsesVisitor from './visitors/open-api-3-0/components/ResponsesVisitor.ts';
|
|
51
|
-
import ComponentsParametersVisitor from './visitors/open-api-3-0/components/ParametersVisitor.ts';
|
|
52
|
-
import ComponentsExamplesVisitor from './visitors/open-api-3-0/components/ExamplesVisitor.ts';
|
|
53
|
-
import ComponentsRequestBodiesVisitor from './visitors/open-api-3-0/components/RequestBodiesVisitor.ts';
|
|
54
|
-
import ComponentsHeadersVisitor from './visitors/open-api-3-0/components/HeadersVisitor.ts';
|
|
55
|
-
import ComponentsSecuritySchemesVisitor from './visitors/open-api-3-0/components/SecuritySchemesVisitor.ts';
|
|
56
|
-
import ComponentsLinksVisitor from './visitors/open-api-3-0/components/LinksVisitor.ts';
|
|
57
|
-
import ComponentsCallbacksVisitor from './visitors/open-api-3-0/components/CallbacksVisitor.ts';
|
|
58
|
-
import ExampleVisitor from './visitors/open-api-3-0/example/index.ts';
|
|
59
|
-
import ExampleExternalValueVisitor from './visitors/open-api-3-0/example/ExternalValueVisitor.ts';
|
|
60
|
-
import ExternalDocumentationVisitor from './visitors/open-api-3-0/external-documentation/index.ts';
|
|
61
|
-
import EncodingVisitor from './visitors/open-api-3-0/encoding/index.ts';
|
|
62
|
-
import EncodingHeadersVisitor from './visitors/open-api-3-0/encoding/HeadersVisitor.ts';
|
|
63
|
-
import PathsVisitor from './visitors/open-api-3-0/paths/index.ts';
|
|
64
|
-
import RequestBodyVisitor from './visitors/open-api-3-0/request-body/index.ts';
|
|
65
|
-
import RequestBodyContentVisitor from './visitors/open-api-3-0/request-body/ContentVisitor.ts';
|
|
66
|
-
import CallbackVisitor from './visitors/open-api-3-0/callback/index.ts';
|
|
67
|
-
import ResponseVisitor from './visitors/open-api-3-0/response/index.ts';
|
|
68
|
-
import ResponseHeadersVisitor from './visitors/open-api-3-0/response/HeadersVisitor.ts';
|
|
69
|
-
import ResponseContentVisitor from './visitors/open-api-3-0/response/ContentVisitor.ts';
|
|
70
|
-
import ResponseLinksVisitor from './visitors/open-api-3-0/response/LinksVisitor.ts';
|
|
71
|
-
import ResponsesVisitor from './visitors/open-api-3-0/responses/index.ts';
|
|
72
|
-
import ResponsesDefaultVisitor from './visitors/open-api-3-0/responses/DefaultVisitor.ts';
|
|
73
|
-
import OperationVisitor from './visitors/open-api-3-0/operation/index.ts';
|
|
74
|
-
import OperationTagsVisitor from './visitors/open-api-3-0/operation/TagsVisitor.ts';
|
|
75
|
-
import OperationParametersVisitor from './visitors/open-api-3-0/operation/ParametersVisitor.ts';
|
|
76
|
-
import OperationRequestBodyVisitor from './visitors/open-api-3-0/operation/RequestBodyVisitor.ts';
|
|
77
|
-
import OperationCallbacksVisitor from './visitors/open-api-3-0/operation/CallbacksVisitor.ts';
|
|
78
|
-
import OperationSecurityVisitor from './visitors/open-api-3-0/operation/SecurityVisitor.ts';
|
|
79
|
-
import OperationServersVisitor from './visitors/open-api-3-0/operation/ServersVisitor.ts';
|
|
80
|
-
import PathItemVisitor from './visitors/open-api-3-0/path-item/index.ts';
|
|
81
|
-
import PathItem$RefVisitor from './visitors/open-api-3-0/path-item/$RefVisitor.ts';
|
|
82
|
-
import PathItemServersVisitor from './visitors/open-api-3-0/path-item/ServersVisitor.ts';
|
|
83
|
-
import PathItemParametersVisitor from './visitors/open-api-3-0/path-item/ParametersVisitor.ts';
|
|
84
|
-
import SecuritySchemeVisitor from './visitors/open-api-3-0/security-scheme/index.ts';
|
|
85
|
-
import OAuthFlowsVisitor from './visitors/open-api-3-0/oauth-flows/index.ts';
|
|
86
|
-
import OAuthFlowVisitor from './visitors/open-api-3-0/oauth-flow/index.ts';
|
|
87
|
-
import OAuthFlowScopesVisitor from './visitors/open-api-3-0/oauth-flow/ScopesVisitor.ts';
|
|
88
|
-
import TagsVisitor from './visitors/open-api-3-0/TagsVisitor.ts';
|
|
89
|
-
|
|
90
|
-
/**
|
|
91
|
-
* Specification object allows us to have complete control over visitors
|
|
92
|
-
* when traversing the ApiDOM.
|
|
93
|
-
* Specification also allows us to create amended refractors from
|
|
94
|
-
* existing ones by manipulating it.
|
|
95
|
-
*
|
|
96
|
-
* Note: Specification object allows to use absolute internal JSON pointers.
|
|
97
|
-
*/
|
|
98
|
-
const { fixedFields: jsonSchemaFixedFields } =
|
|
99
|
-
JSONSchemaDraft4Specification.visitors.document.objects.JSONSchema;
|
|
100
|
-
|
|
101
|
-
/**
|
|
102
|
-
* @public
|
|
103
|
-
*/
|
|
104
|
-
const specification = {
|
|
105
|
-
visitors: {
|
|
106
|
-
value: FallbackVisitor,
|
|
107
|
-
document: {
|
|
108
|
-
objects: {
|
|
109
|
-
OpenApi: {
|
|
110
|
-
$visitor: OpenApi3_0Visitor,
|
|
111
|
-
element: 'openApi3_0',
|
|
112
|
-
fixedFields: {
|
|
113
|
-
openapi: OpenapiVisitor,
|
|
114
|
-
info: {
|
|
115
|
-
$ref: '#/visitors/document/objects/Info',
|
|
116
|
-
},
|
|
117
|
-
servers: ServersVisitor,
|
|
118
|
-
paths: {
|
|
119
|
-
$ref: '#/visitors/document/objects/Paths',
|
|
120
|
-
},
|
|
121
|
-
components: {
|
|
122
|
-
$ref: '#/visitors/document/objects/Components',
|
|
123
|
-
},
|
|
124
|
-
security: SecurityVisitor,
|
|
125
|
-
tags: TagsVisitor,
|
|
126
|
-
externalDocs: {
|
|
127
|
-
$ref: '#/visitors/document/objects/ExternalDocumentation',
|
|
128
|
-
},
|
|
129
|
-
},
|
|
130
|
-
},
|
|
131
|
-
Info: {
|
|
132
|
-
$visitor: InfoVisitor,
|
|
133
|
-
element: 'info',
|
|
134
|
-
fixedFields: {
|
|
135
|
-
title: { $ref: '#/visitors/value' },
|
|
136
|
-
description: { $ref: '#/visitors/value' },
|
|
137
|
-
termsOfService: { $ref: '#/visitors/value' },
|
|
138
|
-
contact: {
|
|
139
|
-
$ref: '#/visitors/document/objects/Contact',
|
|
140
|
-
},
|
|
141
|
-
license: {
|
|
142
|
-
$ref: '#/visitors/document/objects/License',
|
|
143
|
-
},
|
|
144
|
-
version: InfoVersionVisitor,
|
|
145
|
-
},
|
|
146
|
-
},
|
|
147
|
-
Contact: {
|
|
148
|
-
$visitor: ContactVisitor,
|
|
149
|
-
element: 'contact',
|
|
150
|
-
fixedFields: {
|
|
151
|
-
name: { $ref: '#/visitors/value' },
|
|
152
|
-
url: { $ref: '#/visitors/value' },
|
|
153
|
-
email: { $ref: '#/visitors/value' },
|
|
154
|
-
},
|
|
155
|
-
},
|
|
156
|
-
License: {
|
|
157
|
-
$visitor: LicenseVisitor,
|
|
158
|
-
element: 'license',
|
|
159
|
-
fixedFields: {
|
|
160
|
-
name: { $ref: '#/visitors/value' },
|
|
161
|
-
url: { $ref: '#/visitors/value' },
|
|
162
|
-
},
|
|
163
|
-
},
|
|
164
|
-
Server: {
|
|
165
|
-
$visitor: ServerVisitor,
|
|
166
|
-
element: 'server',
|
|
167
|
-
fixedFields: {
|
|
168
|
-
url: ServerUrlVisitor,
|
|
169
|
-
description: { $ref: '#/visitors/value' },
|
|
170
|
-
variables: ServerVariablesVisitor,
|
|
171
|
-
},
|
|
172
|
-
},
|
|
173
|
-
ServerVariable: {
|
|
174
|
-
$visitor: ServerVariableVisitor,
|
|
175
|
-
element: 'serverVariable',
|
|
176
|
-
fixedFields: {
|
|
177
|
-
enum: { $ref: '#/visitors/value' },
|
|
178
|
-
default: { $ref: '#/visitors/value' },
|
|
179
|
-
description: { $ref: '#/visitors/value' },
|
|
180
|
-
},
|
|
181
|
-
},
|
|
182
|
-
Components: {
|
|
183
|
-
$visitor: ComponentsVisitor,
|
|
184
|
-
element: 'components',
|
|
185
|
-
fixedFields: {
|
|
186
|
-
schemas: ComponentsSchemasVisitor,
|
|
187
|
-
responses: ComponentsResponsesVisitor,
|
|
188
|
-
parameters: ComponentsParametersVisitor,
|
|
189
|
-
examples: ComponentsExamplesVisitor,
|
|
190
|
-
requestBodies: ComponentsRequestBodiesVisitor,
|
|
191
|
-
headers: ComponentsHeadersVisitor,
|
|
192
|
-
securitySchemes: ComponentsSecuritySchemesVisitor,
|
|
193
|
-
links: {
|
|
194
|
-
$visitor: ComponentsLinksVisitor,
|
|
195
|
-
alias: 'linksField',
|
|
196
|
-
},
|
|
197
|
-
callbacks: ComponentsCallbacksVisitor,
|
|
198
|
-
},
|
|
199
|
-
},
|
|
200
|
-
Paths: {
|
|
201
|
-
$visitor: PathsVisitor,
|
|
202
|
-
element: 'paths',
|
|
203
|
-
},
|
|
204
|
-
PathItem: {
|
|
205
|
-
$visitor: PathItemVisitor,
|
|
206
|
-
element: 'pathItem',
|
|
207
|
-
fixedFields: {
|
|
208
|
-
$ref: PathItem$RefVisitor,
|
|
209
|
-
summary: { $ref: '#/visitors/value' },
|
|
210
|
-
description: { $ref: '#/visitors/value' },
|
|
211
|
-
get: {
|
|
212
|
-
$ref: '#/visitors/document/objects/Operation',
|
|
213
|
-
alias: 'getField',
|
|
214
|
-
},
|
|
215
|
-
put: {
|
|
216
|
-
$ref: '#/visitors/document/objects/Operation',
|
|
217
|
-
},
|
|
218
|
-
post: {
|
|
219
|
-
$ref: '#/visitors/document/objects/Operation',
|
|
220
|
-
},
|
|
221
|
-
delete: {
|
|
222
|
-
$ref: '#/visitors/document/objects/Operation',
|
|
223
|
-
alias: 'deleteField',
|
|
224
|
-
},
|
|
225
|
-
options: {
|
|
226
|
-
$ref: '#/visitors/document/objects/Operation',
|
|
227
|
-
},
|
|
228
|
-
head: {
|
|
229
|
-
$ref: '#/visitors/document/objects/Operation',
|
|
230
|
-
},
|
|
231
|
-
patch: {
|
|
232
|
-
$ref: '#/visitors/document/objects/Operation',
|
|
233
|
-
},
|
|
234
|
-
trace: {
|
|
235
|
-
$ref: '#/visitors/document/objects/Operation',
|
|
236
|
-
},
|
|
237
|
-
servers: PathItemServersVisitor,
|
|
238
|
-
parameters: PathItemParametersVisitor,
|
|
239
|
-
},
|
|
240
|
-
},
|
|
241
|
-
Operation: {
|
|
242
|
-
$visitor: OperationVisitor,
|
|
243
|
-
element: 'operation',
|
|
244
|
-
fixedFields: {
|
|
245
|
-
tags: OperationTagsVisitor,
|
|
246
|
-
summary: { $ref: '#/visitors/value' },
|
|
247
|
-
description: { $ref: '#/visitors/value' },
|
|
248
|
-
externalDocs: {
|
|
249
|
-
$ref: '#/visitors/document/objects/ExternalDocumentation',
|
|
250
|
-
},
|
|
251
|
-
operationId: { $ref: '#/visitors/value' },
|
|
252
|
-
parameters: OperationParametersVisitor,
|
|
253
|
-
requestBody: OperationRequestBodyVisitor,
|
|
254
|
-
responses: {
|
|
255
|
-
$ref: '#/visitors/document/objects/Responses',
|
|
256
|
-
},
|
|
257
|
-
callbacks: OperationCallbacksVisitor,
|
|
258
|
-
deprecated: { $ref: '#/visitors/value' },
|
|
259
|
-
security: OperationSecurityVisitor,
|
|
260
|
-
servers: OperationServersVisitor,
|
|
261
|
-
},
|
|
262
|
-
},
|
|
263
|
-
ExternalDocumentation: {
|
|
264
|
-
$visitor: ExternalDocumentationVisitor,
|
|
265
|
-
element: 'externalDocumentation',
|
|
266
|
-
fixedFields: {
|
|
267
|
-
description: { $ref: '#/visitors/value' },
|
|
268
|
-
url: { $ref: '#/visitors/value' },
|
|
269
|
-
},
|
|
270
|
-
},
|
|
271
|
-
Parameter: {
|
|
272
|
-
$visitor: ParameterVisitor,
|
|
273
|
-
element: 'parameter',
|
|
274
|
-
fixedFields: {
|
|
275
|
-
name: { $ref: '#/visitors/value' },
|
|
276
|
-
in: { $ref: '#/visitors/value' },
|
|
277
|
-
description: { $ref: '#/visitors/value' },
|
|
278
|
-
required: { $ref: '#/visitors/value' },
|
|
279
|
-
deprecated: { $ref: '#/visitors/value' },
|
|
280
|
-
allowEmptyValue: { $ref: '#/visitors/value' },
|
|
281
|
-
style: {
|
|
282
|
-
$ref: '#/visitors/value',
|
|
283
|
-
alias: 'styleField',
|
|
284
|
-
},
|
|
285
|
-
explode: { $ref: '#/visitors/value' },
|
|
286
|
-
allowReserved: { $ref: '#/visitors/value' },
|
|
287
|
-
schema: ParameterSchemaVisitor,
|
|
288
|
-
example: { $ref: '#/visitors/value' },
|
|
289
|
-
examples: ParameterExamplesVisitor,
|
|
290
|
-
content: {
|
|
291
|
-
$visitor: ParameterContentVisitor,
|
|
292
|
-
alias: 'contentField',
|
|
293
|
-
},
|
|
294
|
-
},
|
|
295
|
-
},
|
|
296
|
-
RequestBody: {
|
|
297
|
-
$visitor: RequestBodyVisitor,
|
|
298
|
-
element: 'requestBody',
|
|
299
|
-
fixedFields: {
|
|
300
|
-
description: { $ref: '#/visitors/value' },
|
|
301
|
-
content: {
|
|
302
|
-
$visitor: RequestBodyContentVisitor,
|
|
303
|
-
alias: 'contentField',
|
|
304
|
-
},
|
|
305
|
-
required: { $ref: '#/visitors/value' },
|
|
306
|
-
},
|
|
307
|
-
},
|
|
308
|
-
MediaType: {
|
|
309
|
-
$visitor: MediaTypeVisitor,
|
|
310
|
-
element: 'mediaType',
|
|
311
|
-
fixedFields: {
|
|
312
|
-
schema: MediaTypeSchemaVisitor,
|
|
313
|
-
example: { $ref: '#/visitors/value' },
|
|
314
|
-
examples: MediaTypeExamplesVisitor,
|
|
315
|
-
encoding: MediaTypeEncodingVisitor,
|
|
316
|
-
},
|
|
317
|
-
},
|
|
318
|
-
Encoding: {
|
|
319
|
-
$visitor: EncodingVisitor,
|
|
320
|
-
element: 'encoding',
|
|
321
|
-
fixedFields: {
|
|
322
|
-
contentType: { $ref: '#/visitors/value' },
|
|
323
|
-
headers: EncodingHeadersVisitor,
|
|
324
|
-
style: {
|
|
325
|
-
$ref: '#/visitors/value',
|
|
326
|
-
alias: 'styleField',
|
|
327
|
-
},
|
|
328
|
-
explode: { $ref: '#/visitors/value' },
|
|
329
|
-
allowReserved: { $ref: '#/visitors/value' },
|
|
330
|
-
},
|
|
331
|
-
},
|
|
332
|
-
Responses: {
|
|
333
|
-
$visitor: ResponsesVisitor,
|
|
334
|
-
element: 'responses',
|
|
335
|
-
fixedFields: {
|
|
336
|
-
default: ResponsesDefaultVisitor,
|
|
337
|
-
},
|
|
338
|
-
},
|
|
339
|
-
Response: {
|
|
340
|
-
$visitor: ResponseVisitor,
|
|
341
|
-
element: 'response',
|
|
342
|
-
fixedFields: {
|
|
343
|
-
description: { $ref: '#/visitors/value' },
|
|
344
|
-
headers: ResponseHeadersVisitor,
|
|
345
|
-
content: {
|
|
346
|
-
$visitor: ResponseContentVisitor,
|
|
347
|
-
alias: 'contentField',
|
|
348
|
-
},
|
|
349
|
-
links: {
|
|
350
|
-
$visitor: ResponseLinksVisitor,
|
|
351
|
-
alias: 'linksField',
|
|
352
|
-
},
|
|
353
|
-
},
|
|
354
|
-
},
|
|
355
|
-
Callback: {
|
|
356
|
-
$visitor: CallbackVisitor,
|
|
357
|
-
element: 'callback',
|
|
358
|
-
},
|
|
359
|
-
Example: {
|
|
360
|
-
$visitor: ExampleVisitor,
|
|
361
|
-
element: 'example',
|
|
362
|
-
fixedFields: {
|
|
363
|
-
summary: { $ref: '#/visitors/value' },
|
|
364
|
-
description: { $ref: '#/visitors/value' },
|
|
365
|
-
value: { $ref: '#/visitors/value' },
|
|
366
|
-
externalValue: ExampleExternalValueVisitor,
|
|
367
|
-
},
|
|
368
|
-
},
|
|
369
|
-
Link: {
|
|
370
|
-
$visitor: LinkVisitor,
|
|
371
|
-
element: 'link',
|
|
372
|
-
fixedFields: {
|
|
373
|
-
operationRef: LinkOperationRefVisitor,
|
|
374
|
-
operationId: LinkOperationIdVisitor,
|
|
375
|
-
parameters: LinkParametersVisitor,
|
|
376
|
-
requestBody: { $ref: '#/visitors/value' },
|
|
377
|
-
description: { $ref: '#/visitors/value' },
|
|
378
|
-
server: {
|
|
379
|
-
$ref: '#/visitors/document/objects/Server',
|
|
380
|
-
},
|
|
381
|
-
},
|
|
382
|
-
},
|
|
383
|
-
Header: {
|
|
384
|
-
$visitor: HeaderVisitor,
|
|
385
|
-
element: 'header',
|
|
386
|
-
fixedFields: {
|
|
387
|
-
description: { $ref: '#/visitors/value' },
|
|
388
|
-
required: { $ref: '#/visitors/value' },
|
|
389
|
-
deprecated: { $ref: '#/visitors/value' },
|
|
390
|
-
allowEmptyValue: { $ref: '#/visitors/value' },
|
|
391
|
-
style: {
|
|
392
|
-
$ref: '#/visitors/value',
|
|
393
|
-
alias: 'styleField',
|
|
394
|
-
},
|
|
395
|
-
explode: { $ref: '#/visitors/value' },
|
|
396
|
-
allowReserved: { $ref: '#/visitors/value' },
|
|
397
|
-
schema: HeaderSchemaVisitor,
|
|
398
|
-
example: { $ref: '#/visitors/value' },
|
|
399
|
-
examples: HeaderExamplesVisitor,
|
|
400
|
-
content: {
|
|
401
|
-
$visitor: HeaderContentVisitor,
|
|
402
|
-
alias: 'contentField',
|
|
403
|
-
},
|
|
404
|
-
},
|
|
405
|
-
},
|
|
406
|
-
Tag: {
|
|
407
|
-
$visitor: TagVisitor,
|
|
408
|
-
element: 'tag',
|
|
409
|
-
fixedFields: {
|
|
410
|
-
name: { $ref: '#/visitors/value' },
|
|
411
|
-
description: { $ref: '#/visitors/value' },
|
|
412
|
-
externalDocs: {
|
|
413
|
-
$ref: '#/visitors/document/objects/ExternalDocumentation',
|
|
414
|
-
},
|
|
415
|
-
},
|
|
416
|
-
},
|
|
417
|
-
Reference: {
|
|
418
|
-
$visitor: ReferenceVisitor,
|
|
419
|
-
element: 'reference',
|
|
420
|
-
fixedFields: {
|
|
421
|
-
$ref: Reference$RefVisitor,
|
|
422
|
-
},
|
|
423
|
-
},
|
|
424
|
-
JSONSchema: {
|
|
425
|
-
$ref: '#/visitors/document/objects/Schema',
|
|
426
|
-
},
|
|
427
|
-
JSONReference: {
|
|
428
|
-
$ref: '#/visitors/document/objects/Reference',
|
|
429
|
-
},
|
|
430
|
-
Schema: {
|
|
431
|
-
$visitor: SchemaVisitor,
|
|
432
|
-
element: 'schema',
|
|
433
|
-
fixedFields: {
|
|
434
|
-
// the following properties are taken directly from the JSON Schema definition and follow the same specifications
|
|
435
|
-
title: jsonSchemaFixedFields.title,
|
|
436
|
-
multipleOf: jsonSchemaFixedFields.multipleOf,
|
|
437
|
-
maximum: jsonSchemaFixedFields.maximum,
|
|
438
|
-
exclusiveMaximum: jsonSchemaFixedFields.exclusiveMaximum,
|
|
439
|
-
minimum: jsonSchemaFixedFields.minimum,
|
|
440
|
-
exclusiveMinimum: jsonSchemaFixedFields.exclusiveMinimum,
|
|
441
|
-
maxLength: jsonSchemaFixedFields.maxLength,
|
|
442
|
-
minLength: jsonSchemaFixedFields.minLength,
|
|
443
|
-
pattern: jsonSchemaFixedFields.pattern,
|
|
444
|
-
maxItems: jsonSchemaFixedFields.maxItems,
|
|
445
|
-
minItems: jsonSchemaFixedFields.minItems,
|
|
446
|
-
uniqueItems: jsonSchemaFixedFields.uniqueItems,
|
|
447
|
-
maxProperties: jsonSchemaFixedFields.maxProperties,
|
|
448
|
-
minProperties: jsonSchemaFixedFields.minProperties,
|
|
449
|
-
required: jsonSchemaFixedFields.required,
|
|
450
|
-
enum: jsonSchemaFixedFields.enum,
|
|
451
|
-
// the following properties are taken from the JSON Schema definition but their definitions were adjusted to the OpenAPI Specification
|
|
452
|
-
type: SchemaTypeVisitor,
|
|
453
|
-
allOf: SchemaAllOfVisitor,
|
|
454
|
-
anyOf: SchemaAnyOfVisitor,
|
|
455
|
-
oneOf: SchemaOneOfVisitor,
|
|
456
|
-
not: SchemaOrReferenceVisitor,
|
|
457
|
-
items: {
|
|
458
|
-
$visitor: SchemaItemsVisitor,
|
|
459
|
-
alias: 'itemsField',
|
|
460
|
-
},
|
|
461
|
-
properties: SchemaPropertiesVisitor,
|
|
462
|
-
additionalProperties: SchemaOrReferenceVisitor,
|
|
463
|
-
description: jsonSchemaFixedFields.description,
|
|
464
|
-
format: jsonSchemaFixedFields.format,
|
|
465
|
-
default: jsonSchemaFixedFields.default,
|
|
466
|
-
// OpenAPI vocabulary
|
|
467
|
-
nullable: { $ref: '#/visitors/value' },
|
|
468
|
-
discriminator: {
|
|
469
|
-
$ref: '#/visitors/document/objects/Discriminator',
|
|
470
|
-
},
|
|
471
|
-
writeOnly: { $ref: '#/visitors/value' },
|
|
472
|
-
xml: {
|
|
473
|
-
$ref: '#/visitors/document/objects/XML',
|
|
474
|
-
},
|
|
475
|
-
externalDocs: {
|
|
476
|
-
$ref: '#/visitors/document/objects/ExternalDocumentation',
|
|
477
|
-
},
|
|
478
|
-
example: { $ref: '#/visitors/value' },
|
|
479
|
-
deprecated: { $ref: '#/visitors/value' },
|
|
480
|
-
},
|
|
481
|
-
},
|
|
482
|
-
Discriminator: {
|
|
483
|
-
$visitor: DiscriminatorVisitor,
|
|
484
|
-
element: 'discriminator',
|
|
485
|
-
fixedFields: {
|
|
486
|
-
propertyName: { $ref: '#/visitors/value' },
|
|
487
|
-
mapping: DiscriminatorMappingVisitor,
|
|
488
|
-
},
|
|
489
|
-
},
|
|
490
|
-
XML: {
|
|
491
|
-
$visitor: XmlVisitor,
|
|
492
|
-
element: 'xml',
|
|
493
|
-
fixedFields: {
|
|
494
|
-
name: { $ref: '#/visitors/value' },
|
|
495
|
-
namespace: { $ref: '#/visitors/value' },
|
|
496
|
-
prefix: { $ref: '#/visitors/value' },
|
|
497
|
-
attribute: { $ref: '#/visitors/value' },
|
|
498
|
-
wrapped: { $ref: '#/visitors/value' },
|
|
499
|
-
},
|
|
500
|
-
},
|
|
501
|
-
SecurityScheme: {
|
|
502
|
-
$visitor: SecuritySchemeVisitor,
|
|
503
|
-
element: 'securityScheme',
|
|
504
|
-
fixedFields: {
|
|
505
|
-
type: { $ref: '#/visitors/value' },
|
|
506
|
-
description: { $ref: '#/visitors/value' },
|
|
507
|
-
name: { $ref: '#/visitors/value' },
|
|
508
|
-
in: { $ref: '#/visitors/value' },
|
|
509
|
-
scheme: { $ref: '#/visitors/value' },
|
|
510
|
-
bearerFormat: { $ref: '#/visitors/value' },
|
|
511
|
-
flows: {
|
|
512
|
-
$ref: '#/visitors/document/objects/OAuthFlows',
|
|
513
|
-
},
|
|
514
|
-
openIdConnectUrl: { $ref: '#/visitors/value' },
|
|
515
|
-
},
|
|
516
|
-
},
|
|
517
|
-
OAuthFlows: {
|
|
518
|
-
$visitor: OAuthFlowsVisitor,
|
|
519
|
-
element: 'oAuthFlows',
|
|
520
|
-
fixedFields: {
|
|
521
|
-
implicit: {
|
|
522
|
-
$ref: '#/visitors/document/objects/OAuthFlow',
|
|
523
|
-
},
|
|
524
|
-
password: {
|
|
525
|
-
$ref: '#/visitors/document/objects/OAuthFlow',
|
|
526
|
-
},
|
|
527
|
-
clientCredentials: {
|
|
528
|
-
$ref: '#/visitors/document/objects/OAuthFlow',
|
|
529
|
-
},
|
|
530
|
-
authorizationCode: {
|
|
531
|
-
$ref: '#/visitors/document/objects/OAuthFlow',
|
|
532
|
-
},
|
|
533
|
-
},
|
|
534
|
-
},
|
|
535
|
-
OAuthFlow: {
|
|
536
|
-
$visitor: OAuthFlowVisitor,
|
|
537
|
-
element: 'oAuthFlow',
|
|
538
|
-
fixedFields: {
|
|
539
|
-
authorizationUrl: { $ref: '#/visitors/value' },
|
|
540
|
-
tokenUrl: { $ref: '#/visitors/value' },
|
|
541
|
-
refreshUrl: { $ref: '#/visitors/value' },
|
|
542
|
-
scopes: OAuthFlowScopesVisitor,
|
|
543
|
-
},
|
|
544
|
-
},
|
|
545
|
-
SecurityRequirement: {
|
|
546
|
-
$visitor: SecurityRequirementVisitor,
|
|
547
|
-
element: 'securityRequirement',
|
|
548
|
-
},
|
|
549
|
-
},
|
|
550
|
-
extension: {
|
|
551
|
-
$visitor: SpecificationExtensionVisitor,
|
|
552
|
-
},
|
|
553
|
-
},
|
|
554
|
-
},
|
|
555
|
-
} as const;
|
|
556
|
-
|
|
557
|
-
export default specification;
|
package/src/refractor/toolbox.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { isStringElement, Namespace } from '@speclynx/apidom-datamodel';
|
|
2
|
-
|
|
3
|
-
import * as openApi3_0Predicates from '../predicates.ts';
|
|
4
|
-
import * as refractorPredicates from './predicates.ts';
|
|
5
|
-
import openApi3_0Namespace from '../namespace.ts';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* @public
|
|
9
|
-
*/
|
|
10
|
-
export interface Toolbox {
|
|
11
|
-
predicates: Record<string, (...args: any[]) => boolean>;
|
|
12
|
-
namespace: Namespace;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
const createToolbox = (): Toolbox => {
|
|
16
|
-
const namespace = new Namespace();
|
|
17
|
-
const predicates = { ...refractorPredicates, ...openApi3_0Predicates, isStringElement };
|
|
18
|
-
|
|
19
|
-
namespace.use(openApi3_0Namespace);
|
|
20
|
-
|
|
21
|
-
return { predicates, namespace };
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
export default createToolbox;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { Element, cloneDeep } from '@speclynx/apidom-datamodel';
|
|
2
|
-
import { Path } from '@speclynx/apidom-traverse';
|
|
3
|
-
|
|
4
|
-
import Visitor, { VisitorOptions } from './Visitor.ts';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* This visitor is responsible for falling back to current traversed element
|
|
8
|
-
* Given OpenApi3_0Visitor expects ObjectElement to be traversed. If
|
|
9
|
-
* different Element is provided FallBackVisitor is responsible to assigning
|
|
10
|
-
* this Element as current element.
|
|
11
|
-
*/
|
|
12
|
-
export type { VisitorOptions as FallbackVisitorOptions };
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* @public
|
|
16
|
-
*/
|
|
17
|
-
class FallbackVisitor extends Visitor {
|
|
18
|
-
enter(path: Path<Element>) {
|
|
19
|
-
this.element = this.consume ? path.node : cloneDeep(path.node);
|
|
20
|
-
path.stop();
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export default FallbackVisitor;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { MemberElement, cloneDeep } from '@speclynx/apidom-datamodel';
|
|
2
|
-
import { Path } from '@speclynx/apidom-traverse';
|
|
3
|
-
|
|
4
|
-
import SpecificationVisitor, { SpecificationVisitorOptions } from './SpecificationVisitor.ts';
|
|
5
|
-
|
|
6
|
-
export type { SpecificationVisitorOptions as SpecificationExtensionVisitorOptions };
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* @public
|
|
10
|
-
*/
|
|
11
|
-
class SpecificationExtensionVisitor extends SpecificationVisitor {
|
|
12
|
-
declare public element: MemberElement;
|
|
13
|
-
|
|
14
|
-
MemberElement(path: Path<MemberElement>) {
|
|
15
|
-
this.element = cloneDeep(path.node);
|
|
16
|
-
this.element.classes.push('specification-extension');
|
|
17
|
-
|
|
18
|
-
path.stop();
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export default SpecificationExtensionVisitor;
|