@speclynx/apidom-ns-openapi-3-1 1.12.2 → 2.0.1
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 +21 -0
- package/NOTICE +16 -7
- package/README.md +16 -29
- package/dist/apidom-ns-openapi-3-1.browser.js +11148 -16196
- package/dist/apidom-ns-openapi-3-1.browser.min.js +1 -1
- package/package.json +11 -11
- package/src/elements/JsonSchemaDialect.cjs +2 -2
- package/src/elements/JsonSchemaDialect.mjs +1 -1
- package/src/elements/OpenApi3-1.cjs +2 -2
- package/src/elements/OpenApi3-1.mjs +1 -1
- package/src/elements/PathItem.cjs +24 -24
- package/src/elements/PathItem.mjs +24 -24
- package/src/elements/nces/ComponentsPathItems.cjs +2 -2
- package/src/elements/nces/ComponentsPathItems.mjs +1 -1
- package/src/elements/nces/Webhooks.cjs +2 -2
- package/src/elements/nces/Webhooks.mjs +1 -1
- package/src/index.cjs +73 -49
- package/src/index.mjs +6 -3
- package/src/namespace.cjs +0 -1
- package/src/predicates.cjs +56 -187
- package/src/predicates.mjs +29 -186
- package/src/refractor/index.cjs +338 -17
- package/src/refractor/index.mjs +305 -16
- package/src/refractor/inspect.cjs +207 -0
- package/src/refractor/inspect.mjs +171 -0
- package/src/refractor/plugins/normalize-header-examples/NormalizeStorage.cjs +5 -5
- package/src/refractor/plugins/normalize-header-examples/NormalizeStorage.mjs +1 -1
- package/src/refractor/plugins/normalize-header-examples/index.cjs +11 -7
- package/src/refractor/plugins/normalize-header-examples/index.mjs +8 -4
- package/src/refractor/plugins/normalize-operation-ids.cjs +13 -6
- package/src/refractor/plugins/normalize-operation-ids.mjs +13 -6
- package/src/refractor/plugins/normalize-parameter-examples.cjs +11 -7
- package/src/refractor/plugins/normalize-parameter-examples.mjs +8 -4
- package/src/refractor/plugins/normalize-parameters.cjs +11 -5
- package/src/refractor/plugins/normalize-parameters.mjs +11 -5
- package/src/refractor/plugins/normalize-security-requirements.cjs +8 -4
- package/src/refractor/plugins/normalize-security-requirements.mjs +8 -4
- package/src/refractor/plugins/normalize-servers.cjs +15 -9
- package/src/refractor/plugins/normalize-servers.mjs +15 -9
- package/src/refractor/plugins/replace-empty-element.cjs +32 -30
- package/src/refractor/plugins/replace-empty-element.mjs +16 -15
- package/src/refractor/predicates.cjs +36 -0
- package/src/refractor/predicates.mjs +31 -0
- package/src/refractor/specification.cjs +43 -4
- package/src/refractor/specification.mjs +43 -4
- package/src/refractor/toolbox.cjs +12 -21
- package/src/refractor/toolbox.mjs +9 -16
- package/src/refractor/visitors/open-api-3-1/JsonSchemaDialectVisitor.cjs +5 -5
- package/src/refractor/visitors/open-api-3-1/JsonSchemaDialectVisitor.mjs +6 -6
- package/src/refractor/visitors/open-api-3-1/OpenapiVisitor.cjs +25 -0
- package/src/refractor/visitors/open-api-3-1/OpenapiVisitor.mjs +19 -0
- package/src/refractor/visitors/open-api-3-1/WebhooksVisitor.cjs +4 -5
- package/src/refractor/visitors/open-api-3-1/WebhooksVisitor.mjs +5 -6
- package/src/refractor/visitors/open-api-3-1/bases.cjs +46 -0
- package/src/refractor/visitors/open-api-3-1/bases.mjs +43 -0
- package/src/refractor/visitors/open-api-3-1/callback/index.cjs +2 -3
- package/src/refractor/visitors/open-api-3-1/callback/index.mjs +2 -3
- package/src/refractor/visitors/open-api-3-1/components/PathItemsVisitor.cjs +4 -5
- package/src/refractor/visitors/open-api-3-1/components/PathItemsVisitor.mjs +5 -6
- package/src/refractor/visitors/open-api-3-1/components/SchemasVisitor.cjs +2 -2
- package/src/refractor/visitors/open-api-3-1/components/SchemasVisitor.mjs +3 -5
- package/src/refractor/visitors/open-api-3-1/index.cjs +5 -4
- package/src/refractor/visitors/open-api-3-1/index.mjs +6 -5
- package/src/refractor/visitors/open-api-3-1/schema/index.cjs +11 -10
- package/src/refractor/visitors/open-api-3-1/schema/index.mjs +12 -11
- package/types/apidom-ns-openapi-3-1.d.ts +435 -274
- package/src/refractor/registration.cjs +0 -102
- package/src/refractor/registration.mjs +0 -66
- package/src/traversal/visitor.cjs +0 -57
- package/src/traversal/visitor.mjs +0 -54
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import { ArrayElement, ObjectElement, cloneDeep,
|
|
1
|
+
import { ArrayElement, ObjectElement, isStringElement, isArrayElement, isMemberElement, includesClasses, cloneDeep, SourceMapElement } from '@speclynx/apidom-datamodel';
|
|
2
|
+
import { toValue } from '@speclynx/apidom-core';
|
|
3
|
+
import { getNodeType } from '@speclynx/apidom-traverse';
|
|
2
4
|
import { ServersElement, SecurityElement, TagsElement, ServerVariablesElement, ComponentsSchemasElement, ComponentsResponsesElement, ComponentsParametersElement, ComponentsExamplesElement, ComponentsRequestBodiesElement, ComponentsHeadersElement, ComponentsSecuritySchemesElement, ComponentsLinksElement, ComponentsCallbacksElement, PathItemServersElement, PathItemParametersElement, OperationParametersElement, ParameterExamplesElement, ParameterContentElement, HeaderExamplesElement, HeaderContentElement, OperationTagsElement, OperationCallbacksElement, OperationSecurityElement, OperationServersElement, RequestBodyContentElement, MediaTypeExamplesElement, MediaTypeEncodingElement, EncodingHeadersElement, ResponseHeadersElement, ResponseContentElement, ResponseLinksElement, DiscriminatorMappingElement, OAuthFlowScopesElement } from '@speclynx/apidom-ns-openapi-3-0';
|
|
3
5
|
|
|
4
6
|
/**
|
|
@@ -34,7 +36,6 @@ import SecurityRequirementElement from "../../elements/SecurityRequirement.mjs";
|
|
|
34
36
|
import TagElement from "../../elements/Tag.mjs"; // non-concrete Elements (NCEs)
|
|
35
37
|
import ComponentsPathItemsElement from "../../elements/nces/ComponentsPathItems.mjs";
|
|
36
38
|
import WebhooksElement from "../../elements/nces/Webhooks.mjs";
|
|
37
|
-
import { getNodeType } from "../../traversal/visitor.mjs";
|
|
38
39
|
/**
|
|
39
40
|
* This plugin is specific to YAML 1.2 format, which allows defining key-value pairs
|
|
40
41
|
* with empty key, empty value, or both. If the value is not provided in YAML format,
|
|
@@ -68,7 +69,6 @@ import { getNodeType } from "../../traversal/visitor.mjs";
|
|
|
68
69
|
* (StringElement)
|
|
69
70
|
* (InfoElement))
|
|
70
71
|
*/
|
|
71
|
-
|
|
72
72
|
const schema = {
|
|
73
73
|
// concrete types handling (CTs)
|
|
74
74
|
OpenApi3_1Element: {
|
|
@@ -618,7 +618,7 @@ const schema = {
|
|
|
618
618
|
}
|
|
619
619
|
};
|
|
620
620
|
const findElementFactory = (ancestor, keyName) => {
|
|
621
|
-
const elementType = getNodeType(ancestor);
|
|
621
|
+
const elementType = getNodeType(ancestor);
|
|
622
622
|
const keyMapping = schema[elementType] || schema[toValue(ancestor.classes.first)];
|
|
623
623
|
return typeof keyMapping === 'undefined' ? undefined : Object.hasOwn(keyMapping, '[key: *]') ? keyMapping['[key: *]'] : keyMapping[keyName];
|
|
624
624
|
};
|
|
@@ -626,31 +626,32 @@ const findElementFactory = (ancestor, keyName) => {
|
|
|
626
626
|
/**
|
|
627
627
|
* @public
|
|
628
628
|
*/
|
|
629
|
-
const plugin = () => ({
|
|
630
|
-
|
|
631
|
-
}) => {
|
|
632
|
-
const isEmptyElement = element => predicates.isStringElement(element) && predicates.includesClasses(['yaml-e-node', 'yaml-e-scalar'], element);
|
|
629
|
+
const plugin = () => () => {
|
|
630
|
+
const isEmptyElement = element => isStringElement(element) && includesClasses(element, ['yaml-e-node', 'yaml-e-scalar']);
|
|
633
631
|
return {
|
|
634
632
|
visitor: {
|
|
635
|
-
StringElement(
|
|
636
|
-
|
|
637
|
-
|
|
633
|
+
StringElement(path) {
|
|
634
|
+
const element = path.node;
|
|
635
|
+
if (!isEmptyElement(element)) return;
|
|
636
|
+
const lineage = path.getAncestorNodes().reverse(); // root to parent
|
|
638
637
|
const parentElement = lineage.at(-1);
|
|
639
638
|
let elementFactory;
|
|
640
639
|
let context;
|
|
641
|
-
if (
|
|
640
|
+
if (isArrayElement(parentElement)) {
|
|
642
641
|
context = element;
|
|
643
642
|
elementFactory = findElementFactory(parentElement, '<*>');
|
|
644
|
-
} else if (
|
|
643
|
+
} else if (isMemberElement(parentElement)) {
|
|
645
644
|
context = lineage.at(-2);
|
|
646
645
|
elementFactory = findElementFactory(context, toValue(parentElement.key));
|
|
647
646
|
}
|
|
648
647
|
|
|
649
648
|
// no element factory found
|
|
650
|
-
if (typeof elementFactory !== 'function') return
|
|
651
|
-
|
|
649
|
+
if (typeof elementFactory !== 'function') return;
|
|
650
|
+
const newElement = elementFactory.call({
|
|
652
651
|
context
|
|
653
652
|
}, undefined, cloneDeep(element.meta), cloneDeep(element.attributes));
|
|
653
|
+
SourceMapElement.transfer(element, newElement);
|
|
654
|
+
path.replaceWith(newElement);
|
|
654
655
|
}
|
|
655
656
|
}
|
|
656
657
|
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.isTagLikeElement = exports.isServerLikeElement = exports.isReferenceLikeElement = exports.isOpenApiExtension = void 0;
|
|
5
|
+
var _ramda = require("ramda");
|
|
6
|
+
var _apidomDatamodel = require("@speclynx/apidom-datamodel");
|
|
7
|
+
var _apidomCore = require("@speclynx/apidom-core");
|
|
8
|
+
/**
|
|
9
|
+
* @public
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* @public
|
|
14
|
+
*/
|
|
15
|
+
const isReferenceLikeElement = element => {
|
|
16
|
+
return (0, _apidomDatamodel.isObjectElement)(element) && element.hasKey('$ref');
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* @public
|
|
21
|
+
*/
|
|
22
|
+
exports.isReferenceLikeElement = isReferenceLikeElement;
|
|
23
|
+
const isServerLikeElement = exports.isServerLikeElement = _apidomDatamodel.isObjectElement;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* @public
|
|
27
|
+
*/
|
|
28
|
+
const isTagLikeElement = exports.isTagLikeElement = _apidomDatamodel.isObjectElement;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* @public
|
|
32
|
+
*/
|
|
33
|
+
const isOpenApiExtension = element => {
|
|
34
|
+
return (0, _apidomDatamodel.isStringElement)(element.key) && (0, _ramda.startsWith)('x-', (0, _apidomCore.toValue)(element.key));
|
|
35
|
+
};
|
|
36
|
+
exports.isOpenApiExtension = isOpenApiExtension;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { startsWith } from 'ramda';
|
|
2
|
+
import { isStringElement, isObjectElement } from '@speclynx/apidom-datamodel';
|
|
3
|
+
import { toValue } from '@speclynx/apidom-core';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @public
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* @public
|
|
11
|
+
*/
|
|
12
|
+
export const isReferenceLikeElement = element => {
|
|
13
|
+
return isObjectElement(element) && element.hasKey('$ref');
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* @public
|
|
18
|
+
*/
|
|
19
|
+
export const isServerLikeElement = isObjectElement;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* @public
|
|
23
|
+
*/
|
|
24
|
+
export const isTagLikeElement = isObjectElement;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* @public
|
|
28
|
+
*/
|
|
29
|
+
export const isOpenApiExtension = element => {
|
|
30
|
+
return isStringElement(element.key) && startsWith('x-', toValue(element.key));
|
|
31
|
+
};
|
|
@@ -11,6 +11,7 @@ var _index3 = _interopRequireDefault(require("./visitors/open-api-3-1/contact/in
|
|
|
11
11
|
var _index4 = _interopRequireDefault(require("./visitors/open-api-3-1/license/index.cjs"));
|
|
12
12
|
var _index5 = _interopRequireDefault(require("./visitors/open-api-3-1/link/index.cjs"));
|
|
13
13
|
var _JsonSchemaDialectVisitor = _interopRequireDefault(require("./visitors/open-api-3-1/JsonSchemaDialectVisitor.cjs"));
|
|
14
|
+
var _OpenapiVisitor = _interopRequireDefault(require("./visitors/open-api-3-1/OpenapiVisitor.cjs"));
|
|
14
15
|
var _index6 = _interopRequireDefault(require("./visitors/open-api-3-1/server/index.cjs"));
|
|
15
16
|
var _index7 = _interopRequireDefault(require("./visitors/open-api-3-1/server-variable/index.cjs"));
|
|
16
17
|
var _index8 = _interopRequireDefault(require("./visitors/open-api-3-1/media-type/index.cjs"));
|
|
@@ -67,13 +68,20 @@ const specification = {
|
|
|
67
68
|
document: {
|
|
68
69
|
objects: {
|
|
69
70
|
OpenApi: {
|
|
71
|
+
element: 'openApi3_1',
|
|
70
72
|
$visitor: _index.default,
|
|
71
73
|
fixedFields: {
|
|
72
|
-
openapi:
|
|
74
|
+
openapi: {
|
|
75
|
+
element: 'openapi',
|
|
76
|
+
$visitor: _OpenapiVisitor.default
|
|
77
|
+
},
|
|
73
78
|
info: {
|
|
74
79
|
$ref: '#/visitors/document/objects/Info'
|
|
75
80
|
},
|
|
76
|
-
jsonSchemaDialect:
|
|
81
|
+
jsonSchemaDialect: {
|
|
82
|
+
element: 'jsonSchemaDialect',
|
|
83
|
+
$visitor: _JsonSchemaDialectVisitor.default
|
|
84
|
+
},
|
|
77
85
|
servers: _apidomNsOpenapi.specificationObj.visitors.document.objects.OpenApi.fixedFields.servers,
|
|
78
86
|
paths: {
|
|
79
87
|
$ref: '#/visitors/document/objects/Paths'
|
|
@@ -90,6 +98,7 @@ const specification = {
|
|
|
90
98
|
}
|
|
91
99
|
},
|
|
92
100
|
Info: {
|
|
101
|
+
element: 'info',
|
|
93
102
|
$visitor: _index2.default,
|
|
94
103
|
fixedFields: {
|
|
95
104
|
title: _apidomNsOpenapi.specificationObj.visitors.document.objects.Info.fixedFields.title,
|
|
@@ -108,6 +117,7 @@ const specification = {
|
|
|
108
117
|
}
|
|
109
118
|
},
|
|
110
119
|
Contact: {
|
|
120
|
+
element: 'contact',
|
|
111
121
|
$visitor: _index3.default,
|
|
112
122
|
fixedFields: {
|
|
113
123
|
name: _apidomNsOpenapi.specificationObj.visitors.document.objects.Contact.fixedFields.name,
|
|
@@ -116,6 +126,7 @@ const specification = {
|
|
|
116
126
|
}
|
|
117
127
|
},
|
|
118
128
|
License: {
|
|
129
|
+
element: 'license',
|
|
119
130
|
$visitor: _index4.default,
|
|
120
131
|
fixedFields: {
|
|
121
132
|
name: _apidomNsOpenapi.specificationObj.visitors.document.objects.License.fixedFields.name,
|
|
@@ -126,6 +137,7 @@ const specification = {
|
|
|
126
137
|
}
|
|
127
138
|
},
|
|
128
139
|
Server: {
|
|
140
|
+
element: 'server',
|
|
129
141
|
$visitor: _index6.default,
|
|
130
142
|
fixedFields: {
|
|
131
143
|
url: _apidomNsOpenapi.specificationObj.visitors.document.objects.Server.fixedFields.url,
|
|
@@ -134,6 +146,7 @@ const specification = {
|
|
|
134
146
|
}
|
|
135
147
|
},
|
|
136
148
|
ServerVariable: {
|
|
149
|
+
element: 'serverVariable',
|
|
137
150
|
$visitor: _index7.default,
|
|
138
151
|
fixedFields: {
|
|
139
152
|
enum: _apidomNsOpenapi.specificationObj.visitors.document.objects.ServerVariable.fixedFields.enum,
|
|
@@ -142,6 +155,7 @@ const specification = {
|
|
|
142
155
|
}
|
|
143
156
|
},
|
|
144
157
|
Components: {
|
|
158
|
+
element: 'components',
|
|
145
159
|
$visitor: _index0.default,
|
|
146
160
|
fixedFields: {
|
|
147
161
|
schemas: _SchemasVisitor.default,
|
|
@@ -157,16 +171,19 @@ const specification = {
|
|
|
157
171
|
}
|
|
158
172
|
},
|
|
159
173
|
Paths: {
|
|
174
|
+
element: 'paths',
|
|
160
175
|
$visitor: _index19.default
|
|
161
176
|
},
|
|
162
177
|
PathItem: {
|
|
178
|
+
element: 'pathItem',
|
|
163
179
|
$visitor: _index25.default,
|
|
164
180
|
fixedFields: {
|
|
165
181
|
$ref: _apidomNsOpenapi.specificationObj.visitors.document.objects.PathItem.fixedFields.$ref,
|
|
166
182
|
summary: _apidomNsOpenapi.specificationObj.visitors.document.objects.PathItem.fixedFields.summary,
|
|
167
183
|
description: _apidomNsOpenapi.specificationObj.visitors.document.objects.PathItem.fixedFields.description,
|
|
168
184
|
get: {
|
|
169
|
-
$ref: '#/visitors/document/objects/Operation'
|
|
185
|
+
$ref: '#/visitors/document/objects/Operation',
|
|
186
|
+
alias: 'getField'
|
|
170
187
|
},
|
|
171
188
|
put: {
|
|
172
189
|
$ref: '#/visitors/document/objects/Operation'
|
|
@@ -175,7 +192,8 @@ const specification = {
|
|
|
175
192
|
$ref: '#/visitors/document/objects/Operation'
|
|
176
193
|
},
|
|
177
194
|
delete: {
|
|
178
|
-
$ref: '#/visitors/document/objects/Operation'
|
|
195
|
+
$ref: '#/visitors/document/objects/Operation',
|
|
196
|
+
alias: 'deleteField'
|
|
179
197
|
},
|
|
180
198
|
options: {
|
|
181
199
|
$ref: '#/visitors/document/objects/Operation'
|
|
@@ -194,6 +212,7 @@ const specification = {
|
|
|
194
212
|
}
|
|
195
213
|
},
|
|
196
214
|
Operation: {
|
|
215
|
+
element: 'operation',
|
|
197
216
|
$visitor: _index24.default,
|
|
198
217
|
fixedFields: {
|
|
199
218
|
tags: _apidomNsOpenapi.specificationObj.visitors.document.objects.Operation.fixedFields.tags,
|
|
@@ -215,6 +234,7 @@ const specification = {
|
|
|
215
234
|
}
|
|
216
235
|
},
|
|
217
236
|
ExternalDocumentation: {
|
|
237
|
+
element: 'externalDocumentation',
|
|
218
238
|
$visitor: _index17.default,
|
|
219
239
|
fixedFields: {
|
|
220
240
|
description: _apidomNsOpenapi.specificationObj.visitors.document.objects.ExternalDocumentation.fixedFields.description,
|
|
@@ -222,6 +242,7 @@ const specification = {
|
|
|
222
242
|
}
|
|
223
243
|
},
|
|
224
244
|
Parameter: {
|
|
245
|
+
element: 'parameter',
|
|
225
246
|
$visitor: _index11.default,
|
|
226
247
|
fixedFields: {
|
|
227
248
|
name: _apidomNsOpenapi.specificationObj.visitors.document.objects.Parameter.fixedFields.name,
|
|
@@ -242,6 +263,7 @@ const specification = {
|
|
|
242
263
|
}
|
|
243
264
|
},
|
|
244
265
|
RequestBody: {
|
|
266
|
+
element: 'requestBody',
|
|
245
267
|
$visitor: _index20.default,
|
|
246
268
|
fixedFields: {
|
|
247
269
|
description: _apidomNsOpenapi.specificationObj.visitors.document.objects.RequestBody.fixedFields.description,
|
|
@@ -250,6 +272,7 @@ const specification = {
|
|
|
250
272
|
}
|
|
251
273
|
},
|
|
252
274
|
MediaType: {
|
|
275
|
+
element: 'mediaType',
|
|
253
276
|
$visitor: _index8.default,
|
|
254
277
|
fixedFields: {
|
|
255
278
|
schema: {
|
|
@@ -261,6 +284,7 @@ const specification = {
|
|
|
261
284
|
}
|
|
262
285
|
},
|
|
263
286
|
Encoding: {
|
|
287
|
+
element: 'encoding',
|
|
264
288
|
$visitor: _index18.default,
|
|
265
289
|
fixedFields: {
|
|
266
290
|
contentType: _apidomNsOpenapi.specificationObj.visitors.document.objects.Encoding.fixedFields.contentType,
|
|
@@ -271,12 +295,14 @@ const specification = {
|
|
|
271
295
|
}
|
|
272
296
|
},
|
|
273
297
|
Responses: {
|
|
298
|
+
element: 'responses',
|
|
274
299
|
$visitor: _index23.default,
|
|
275
300
|
fixedFields: {
|
|
276
301
|
default: _apidomNsOpenapi.specificationObj.visitors.document.objects.Responses.fixedFields.default
|
|
277
302
|
}
|
|
278
303
|
},
|
|
279
304
|
Response: {
|
|
305
|
+
element: 'response',
|
|
280
306
|
$visitor: _index22.default,
|
|
281
307
|
fixedFields: {
|
|
282
308
|
description: _apidomNsOpenapi.specificationObj.visitors.document.objects.Response.fixedFields.description,
|
|
@@ -286,9 +312,11 @@ const specification = {
|
|
|
286
312
|
}
|
|
287
313
|
},
|
|
288
314
|
Callback: {
|
|
315
|
+
element: 'callback',
|
|
289
316
|
$visitor: _index21.default
|
|
290
317
|
},
|
|
291
318
|
Example: {
|
|
319
|
+
element: 'example',
|
|
292
320
|
$visitor: _index16.default,
|
|
293
321
|
fixedFields: {
|
|
294
322
|
summary: _apidomNsOpenapi.specificationObj.visitors.document.objects.Example.fixedFields.summary,
|
|
@@ -298,6 +326,7 @@ const specification = {
|
|
|
298
326
|
}
|
|
299
327
|
},
|
|
300
328
|
Link: {
|
|
329
|
+
element: 'link',
|
|
301
330
|
$visitor: _index5.default,
|
|
302
331
|
fixedFields: {
|
|
303
332
|
operationRef: _apidomNsOpenapi.specificationObj.visitors.document.objects.Link.fixedFields.operationRef,
|
|
@@ -311,6 +340,7 @@ const specification = {
|
|
|
311
340
|
}
|
|
312
341
|
},
|
|
313
342
|
Header: {
|
|
343
|
+
element: 'header',
|
|
314
344
|
$visitor: _index12.default,
|
|
315
345
|
fixedFields: {
|
|
316
346
|
description: _apidomNsOpenapi.specificationObj.visitors.document.objects.Header.fixedFields.description,
|
|
@@ -329,6 +359,7 @@ const specification = {
|
|
|
329
359
|
}
|
|
330
360
|
},
|
|
331
361
|
Tag: {
|
|
362
|
+
element: 'tag',
|
|
332
363
|
$visitor: _index1.default,
|
|
333
364
|
fixedFields: {
|
|
334
365
|
name: _apidomNsOpenapi.specificationObj.visitors.document.objects.Tag.fixedFields.name,
|
|
@@ -339,6 +370,7 @@ const specification = {
|
|
|
339
370
|
}
|
|
340
371
|
},
|
|
341
372
|
Reference: {
|
|
373
|
+
element: 'reference',
|
|
342
374
|
$visitor: _index10.default,
|
|
343
375
|
fixedFields: {
|
|
344
376
|
$ref: _apidomNsOpenapi.specificationObj.visitors.document.objects.Reference.fixedFields.$ref,
|
|
@@ -357,6 +389,7 @@ const specification = {
|
|
|
357
389
|
...LinkDescriptionVisitor
|
|
358
390
|
},
|
|
359
391
|
Schema: {
|
|
392
|
+
element: 'schema',
|
|
360
393
|
$visitor: _index13.default,
|
|
361
394
|
fixedFields: {
|
|
362
395
|
...JSONSchemaVisitor.fixedFields,
|
|
@@ -422,6 +455,7 @@ const specification = {
|
|
|
422
455
|
}
|
|
423
456
|
},
|
|
424
457
|
Discriminator: {
|
|
458
|
+
element: 'discriminator',
|
|
425
459
|
$visitor: _index14.default,
|
|
426
460
|
fixedFields: {
|
|
427
461
|
propertyName: _apidomNsOpenapi.specificationObj.visitors.document.objects.Discriminator.fixedFields.propertyName,
|
|
@@ -429,6 +463,7 @@ const specification = {
|
|
|
429
463
|
}
|
|
430
464
|
},
|
|
431
465
|
XML: {
|
|
466
|
+
element: 'xml',
|
|
432
467
|
$visitor: _index15.default,
|
|
433
468
|
fixedFields: {
|
|
434
469
|
name: _apidomNsOpenapi.specificationObj.visitors.document.objects.XML.fixedFields.name,
|
|
@@ -439,6 +474,7 @@ const specification = {
|
|
|
439
474
|
}
|
|
440
475
|
},
|
|
441
476
|
SecurityScheme: {
|
|
477
|
+
element: 'securityScheme',
|
|
442
478
|
$visitor: _index26.default,
|
|
443
479
|
fixedFields: {
|
|
444
480
|
type: _apidomNsOpenapi.specificationObj.visitors.document.objects.SecurityScheme.fixedFields.type,
|
|
@@ -454,6 +490,7 @@ const specification = {
|
|
|
454
490
|
}
|
|
455
491
|
},
|
|
456
492
|
OAuthFlows: {
|
|
493
|
+
element: 'oAuthFlows',
|
|
457
494
|
$visitor: _index27.default,
|
|
458
495
|
fixedFields: {
|
|
459
496
|
implicit: {
|
|
@@ -471,6 +508,7 @@ const specification = {
|
|
|
471
508
|
}
|
|
472
509
|
},
|
|
473
510
|
OAuthFlow: {
|
|
511
|
+
element: 'oAuthFlow',
|
|
474
512
|
$visitor: _index28.default,
|
|
475
513
|
fixedFields: {
|
|
476
514
|
authorizationUrl: _apidomNsOpenapi.specificationObj.visitors.document.objects.OAuthFlow.fixedFields.authorizationUrl,
|
|
@@ -480,6 +518,7 @@ const specification = {
|
|
|
480
518
|
}
|
|
481
519
|
},
|
|
482
520
|
SecurityRequirement: {
|
|
521
|
+
element: 'securityRequirement',
|
|
483
522
|
$visitor: _index9.default
|
|
484
523
|
}
|
|
485
524
|
},
|
|
@@ -6,6 +6,7 @@ import ContactVisitor from "./visitors/open-api-3-1/contact/index.mjs";
|
|
|
6
6
|
import LicenseVisitor from "./visitors/open-api-3-1/license/index.mjs";
|
|
7
7
|
import LinkVisitor from "./visitors/open-api-3-1/link/index.mjs";
|
|
8
8
|
import JsonSchemaDialectVisitor from "./visitors/open-api-3-1/JsonSchemaDialectVisitor.mjs";
|
|
9
|
+
import OpenapiVisitor from "./visitors/open-api-3-1/OpenapiVisitor.mjs";
|
|
9
10
|
import ServerVisitor from "./visitors/open-api-3-1/server/index.mjs";
|
|
10
11
|
import ServerVariableVisitor from "./visitors/open-api-3-1/server-variable/index.mjs";
|
|
11
12
|
import MediaTypeVisitor from "./visitors/open-api-3-1/media-type/index.mjs";
|
|
@@ -62,13 +63,20 @@ const specification = {
|
|
|
62
63
|
document: {
|
|
63
64
|
objects: {
|
|
64
65
|
OpenApi: {
|
|
66
|
+
element: 'openApi3_1',
|
|
65
67
|
$visitor: OpenApi3_1Visitor,
|
|
66
68
|
fixedFields: {
|
|
67
|
-
openapi:
|
|
69
|
+
openapi: {
|
|
70
|
+
element: 'openapi',
|
|
71
|
+
$visitor: OpenapiVisitor
|
|
72
|
+
},
|
|
68
73
|
info: {
|
|
69
74
|
$ref: '#/visitors/document/objects/Info'
|
|
70
75
|
},
|
|
71
|
-
jsonSchemaDialect:
|
|
76
|
+
jsonSchemaDialect: {
|
|
77
|
+
element: 'jsonSchemaDialect',
|
|
78
|
+
$visitor: JsonSchemaDialectVisitor
|
|
79
|
+
},
|
|
72
80
|
servers: OpenApi3_0Specification.visitors.document.objects.OpenApi.fixedFields.servers,
|
|
73
81
|
paths: {
|
|
74
82
|
$ref: '#/visitors/document/objects/Paths'
|
|
@@ -85,6 +93,7 @@ const specification = {
|
|
|
85
93
|
}
|
|
86
94
|
},
|
|
87
95
|
Info: {
|
|
96
|
+
element: 'info',
|
|
88
97
|
$visitor: InfoVisitor,
|
|
89
98
|
fixedFields: {
|
|
90
99
|
title: OpenApi3_0Specification.visitors.document.objects.Info.fixedFields.title,
|
|
@@ -103,6 +112,7 @@ const specification = {
|
|
|
103
112
|
}
|
|
104
113
|
},
|
|
105
114
|
Contact: {
|
|
115
|
+
element: 'contact',
|
|
106
116
|
$visitor: ContactVisitor,
|
|
107
117
|
fixedFields: {
|
|
108
118
|
name: OpenApi3_0Specification.visitors.document.objects.Contact.fixedFields.name,
|
|
@@ -111,6 +121,7 @@ const specification = {
|
|
|
111
121
|
}
|
|
112
122
|
},
|
|
113
123
|
License: {
|
|
124
|
+
element: 'license',
|
|
114
125
|
$visitor: LicenseVisitor,
|
|
115
126
|
fixedFields: {
|
|
116
127
|
name: OpenApi3_0Specification.visitors.document.objects.License.fixedFields.name,
|
|
@@ -121,6 +132,7 @@ const specification = {
|
|
|
121
132
|
}
|
|
122
133
|
},
|
|
123
134
|
Server: {
|
|
135
|
+
element: 'server',
|
|
124
136
|
$visitor: ServerVisitor,
|
|
125
137
|
fixedFields: {
|
|
126
138
|
url: OpenApi3_0Specification.visitors.document.objects.Server.fixedFields.url,
|
|
@@ -129,6 +141,7 @@ const specification = {
|
|
|
129
141
|
}
|
|
130
142
|
},
|
|
131
143
|
ServerVariable: {
|
|
144
|
+
element: 'serverVariable',
|
|
132
145
|
$visitor: ServerVariableVisitor,
|
|
133
146
|
fixedFields: {
|
|
134
147
|
enum: OpenApi3_0Specification.visitors.document.objects.ServerVariable.fixedFields.enum,
|
|
@@ -137,6 +150,7 @@ const specification = {
|
|
|
137
150
|
}
|
|
138
151
|
},
|
|
139
152
|
Components: {
|
|
153
|
+
element: 'components',
|
|
140
154
|
$visitor: ComponentsVisitor,
|
|
141
155
|
fixedFields: {
|
|
142
156
|
schemas: ComponentsSchemasVisitor,
|
|
@@ -152,16 +166,19 @@ const specification = {
|
|
|
152
166
|
}
|
|
153
167
|
},
|
|
154
168
|
Paths: {
|
|
169
|
+
element: 'paths',
|
|
155
170
|
$visitor: PathsVisitor
|
|
156
171
|
},
|
|
157
172
|
PathItem: {
|
|
173
|
+
element: 'pathItem',
|
|
158
174
|
$visitor: PathItemVisitor,
|
|
159
175
|
fixedFields: {
|
|
160
176
|
$ref: OpenApi3_0Specification.visitors.document.objects.PathItem.fixedFields.$ref,
|
|
161
177
|
summary: OpenApi3_0Specification.visitors.document.objects.PathItem.fixedFields.summary,
|
|
162
178
|
description: OpenApi3_0Specification.visitors.document.objects.PathItem.fixedFields.description,
|
|
163
179
|
get: {
|
|
164
|
-
$ref: '#/visitors/document/objects/Operation'
|
|
180
|
+
$ref: '#/visitors/document/objects/Operation',
|
|
181
|
+
alias: 'getField'
|
|
165
182
|
},
|
|
166
183
|
put: {
|
|
167
184
|
$ref: '#/visitors/document/objects/Operation'
|
|
@@ -170,7 +187,8 @@ const specification = {
|
|
|
170
187
|
$ref: '#/visitors/document/objects/Operation'
|
|
171
188
|
},
|
|
172
189
|
delete: {
|
|
173
|
-
$ref: '#/visitors/document/objects/Operation'
|
|
190
|
+
$ref: '#/visitors/document/objects/Operation',
|
|
191
|
+
alias: 'deleteField'
|
|
174
192
|
},
|
|
175
193
|
options: {
|
|
176
194
|
$ref: '#/visitors/document/objects/Operation'
|
|
@@ -189,6 +207,7 @@ const specification = {
|
|
|
189
207
|
}
|
|
190
208
|
},
|
|
191
209
|
Operation: {
|
|
210
|
+
element: 'operation',
|
|
192
211
|
$visitor: OperationVisitor,
|
|
193
212
|
fixedFields: {
|
|
194
213
|
tags: OpenApi3_0Specification.visitors.document.objects.Operation.fixedFields.tags,
|
|
@@ -210,6 +229,7 @@ const specification = {
|
|
|
210
229
|
}
|
|
211
230
|
},
|
|
212
231
|
ExternalDocumentation: {
|
|
232
|
+
element: 'externalDocumentation',
|
|
213
233
|
$visitor: ExternalDocumentationVisitor,
|
|
214
234
|
fixedFields: {
|
|
215
235
|
description: OpenApi3_0Specification.visitors.document.objects.ExternalDocumentation.fixedFields.description,
|
|
@@ -217,6 +237,7 @@ const specification = {
|
|
|
217
237
|
}
|
|
218
238
|
},
|
|
219
239
|
Parameter: {
|
|
240
|
+
element: 'parameter',
|
|
220
241
|
$visitor: ParameterVisitor,
|
|
221
242
|
fixedFields: {
|
|
222
243
|
name: OpenApi3_0Specification.visitors.document.objects.Parameter.fixedFields.name,
|
|
@@ -237,6 +258,7 @@ const specification = {
|
|
|
237
258
|
}
|
|
238
259
|
},
|
|
239
260
|
RequestBody: {
|
|
261
|
+
element: 'requestBody',
|
|
240
262
|
$visitor: RequestBodyVisitor,
|
|
241
263
|
fixedFields: {
|
|
242
264
|
description: OpenApi3_0Specification.visitors.document.objects.RequestBody.fixedFields.description,
|
|
@@ -245,6 +267,7 @@ const specification = {
|
|
|
245
267
|
}
|
|
246
268
|
},
|
|
247
269
|
MediaType: {
|
|
270
|
+
element: 'mediaType',
|
|
248
271
|
$visitor: MediaTypeVisitor,
|
|
249
272
|
fixedFields: {
|
|
250
273
|
schema: {
|
|
@@ -256,6 +279,7 @@ const specification = {
|
|
|
256
279
|
}
|
|
257
280
|
},
|
|
258
281
|
Encoding: {
|
|
282
|
+
element: 'encoding',
|
|
259
283
|
$visitor: EncodingVisitor,
|
|
260
284
|
fixedFields: {
|
|
261
285
|
contentType: OpenApi3_0Specification.visitors.document.objects.Encoding.fixedFields.contentType,
|
|
@@ -266,12 +290,14 @@ const specification = {
|
|
|
266
290
|
}
|
|
267
291
|
},
|
|
268
292
|
Responses: {
|
|
293
|
+
element: 'responses',
|
|
269
294
|
$visitor: ResponsesVisitor,
|
|
270
295
|
fixedFields: {
|
|
271
296
|
default: OpenApi3_0Specification.visitors.document.objects.Responses.fixedFields.default
|
|
272
297
|
}
|
|
273
298
|
},
|
|
274
299
|
Response: {
|
|
300
|
+
element: 'response',
|
|
275
301
|
$visitor: ResponseVisitor,
|
|
276
302
|
fixedFields: {
|
|
277
303
|
description: OpenApi3_0Specification.visitors.document.objects.Response.fixedFields.description,
|
|
@@ -281,9 +307,11 @@ const specification = {
|
|
|
281
307
|
}
|
|
282
308
|
},
|
|
283
309
|
Callback: {
|
|
310
|
+
element: 'callback',
|
|
284
311
|
$visitor: CallbackVisitor
|
|
285
312
|
},
|
|
286
313
|
Example: {
|
|
314
|
+
element: 'example',
|
|
287
315
|
$visitor: ExampleVisitor,
|
|
288
316
|
fixedFields: {
|
|
289
317
|
summary: OpenApi3_0Specification.visitors.document.objects.Example.fixedFields.summary,
|
|
@@ -293,6 +321,7 @@ const specification = {
|
|
|
293
321
|
}
|
|
294
322
|
},
|
|
295
323
|
Link: {
|
|
324
|
+
element: 'link',
|
|
296
325
|
$visitor: LinkVisitor,
|
|
297
326
|
fixedFields: {
|
|
298
327
|
operationRef: OpenApi3_0Specification.visitors.document.objects.Link.fixedFields.operationRef,
|
|
@@ -306,6 +335,7 @@ const specification = {
|
|
|
306
335
|
}
|
|
307
336
|
},
|
|
308
337
|
Header: {
|
|
338
|
+
element: 'header',
|
|
309
339
|
$visitor: HeaderVisitor,
|
|
310
340
|
fixedFields: {
|
|
311
341
|
description: OpenApi3_0Specification.visitors.document.objects.Header.fixedFields.description,
|
|
@@ -324,6 +354,7 @@ const specification = {
|
|
|
324
354
|
}
|
|
325
355
|
},
|
|
326
356
|
Tag: {
|
|
357
|
+
element: 'tag',
|
|
327
358
|
$visitor: TagVisitor,
|
|
328
359
|
fixedFields: {
|
|
329
360
|
name: OpenApi3_0Specification.visitors.document.objects.Tag.fixedFields.name,
|
|
@@ -334,6 +365,7 @@ const specification = {
|
|
|
334
365
|
}
|
|
335
366
|
},
|
|
336
367
|
Reference: {
|
|
368
|
+
element: 'reference',
|
|
337
369
|
$visitor: ReferenceVisitor,
|
|
338
370
|
fixedFields: {
|
|
339
371
|
$ref: OpenApi3_0Specification.visitors.document.objects.Reference.fixedFields.$ref,
|
|
@@ -352,6 +384,7 @@ const specification = {
|
|
|
352
384
|
...LinkDescriptionVisitor
|
|
353
385
|
},
|
|
354
386
|
Schema: {
|
|
387
|
+
element: 'schema',
|
|
355
388
|
$visitor: SchemaVisitor,
|
|
356
389
|
fixedFields: {
|
|
357
390
|
...JSONSchemaVisitor.fixedFields,
|
|
@@ -417,6 +450,7 @@ const specification = {
|
|
|
417
450
|
}
|
|
418
451
|
},
|
|
419
452
|
Discriminator: {
|
|
453
|
+
element: 'discriminator',
|
|
420
454
|
$visitor: DiscriminatorVisitor,
|
|
421
455
|
fixedFields: {
|
|
422
456
|
propertyName: OpenApi3_0Specification.visitors.document.objects.Discriminator.fixedFields.propertyName,
|
|
@@ -424,6 +458,7 @@ const specification = {
|
|
|
424
458
|
}
|
|
425
459
|
},
|
|
426
460
|
XML: {
|
|
461
|
+
element: 'xml',
|
|
427
462
|
$visitor: XmlVisitor,
|
|
428
463
|
fixedFields: {
|
|
429
464
|
name: OpenApi3_0Specification.visitors.document.objects.XML.fixedFields.name,
|
|
@@ -434,6 +469,7 @@ const specification = {
|
|
|
434
469
|
}
|
|
435
470
|
},
|
|
436
471
|
SecurityScheme: {
|
|
472
|
+
element: 'securityScheme',
|
|
437
473
|
$visitor: SecuritySchemeVisitor,
|
|
438
474
|
fixedFields: {
|
|
439
475
|
type: OpenApi3_0Specification.visitors.document.objects.SecurityScheme.fixedFields.type,
|
|
@@ -449,6 +485,7 @@ const specification = {
|
|
|
449
485
|
}
|
|
450
486
|
},
|
|
451
487
|
OAuthFlows: {
|
|
488
|
+
element: 'oAuthFlows',
|
|
452
489
|
$visitor: OAuthFlowsVisitor,
|
|
453
490
|
fixedFields: {
|
|
454
491
|
implicit: {
|
|
@@ -466,6 +503,7 @@ const specification = {
|
|
|
466
503
|
}
|
|
467
504
|
},
|
|
468
505
|
OAuthFlow: {
|
|
506
|
+
element: 'oAuthFlow',
|
|
469
507
|
$visitor: OAuthFlowVisitor,
|
|
470
508
|
fixedFields: {
|
|
471
509
|
authorizationUrl: OpenApi3_0Specification.visitors.document.objects.OAuthFlow.fixedFields.authorizationUrl,
|
|
@@ -475,6 +513,7 @@ const specification = {
|
|
|
475
513
|
}
|
|
476
514
|
},
|
|
477
515
|
SecurityRequirement: {
|
|
516
|
+
element: 'securityRequirement',
|
|
478
517
|
$visitor: SecurityRequirementVisitor
|
|
479
518
|
}
|
|
480
519
|
},
|