oas 34.0.1 → 34.0.2
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/dist/analyzer/index.cjs +4 -4
- package/dist/analyzer/index.cjs.map +1 -1
- package/dist/analyzer/index.js +2 -2
- package/dist/{chunk-OJJWGF3Y.js → chunk-66Z3SYJH.js} +2 -2
- package/dist/{chunk-A4FUA2VC.cjs → chunk-GXLENSTM.cjs} +4 -4
- package/dist/{chunk-A4FUA2VC.cjs.map → chunk-GXLENSTM.cjs.map} +1 -1
- package/dist/{chunk-GIGPEUAX.cjs → chunk-HZ7LCMAM.cjs} +56 -73
- package/dist/chunk-HZ7LCMAM.cjs.map +1 -0
- package/dist/{chunk-HNSSBMDJ.js → chunk-KYSWFHUO.js} +6 -23
- package/dist/chunk-KYSWFHUO.js.map +1 -0
- package/dist/index.cjs +3 -3
- package/dist/index.js +2 -2
- package/dist/operation/index.cjs +2 -2
- package/dist/operation/index.js +1 -1
- package/package.json +3 -3
- package/dist/chunk-GIGPEUAX.cjs.map +0 -1
- package/dist/chunk-HNSSBMDJ.js.map +0 -1
- /package/dist/{chunk-OJJWGF3Y.js.map → chunk-66Z3SYJH.js.map} +0 -0
|
@@ -70,20 +70,6 @@ function normalizeArray(arr) {
|
|
|
70
70
|
function isFunc(thing) {
|
|
71
71
|
return typeof thing === "function";
|
|
72
72
|
}
|
|
73
|
-
function deeplyStripKey(input, keyToStrip, predicate) {
|
|
74
|
-
if (typeof input !== "object" || Array.isArray(input) || input === null || !keyToStrip) {
|
|
75
|
-
return input;
|
|
76
|
-
}
|
|
77
|
-
const obj = { ...input };
|
|
78
|
-
Object.keys(obj).forEach((k) => {
|
|
79
|
-
if (k === keyToStrip && _optionalChain([predicate, 'optionalCall', _2 => _2(obj[k], k)])) {
|
|
80
|
-
delete obj[k];
|
|
81
|
-
return;
|
|
82
|
-
}
|
|
83
|
-
obj[k] = deeplyStripKey(obj[k], keyToStrip, predicate);
|
|
84
|
-
});
|
|
85
|
-
return obj;
|
|
86
|
-
}
|
|
87
73
|
|
|
88
74
|
// src/samples/index.ts
|
|
89
75
|
var sampleDefaults = (genericSample) => {
|
|
@@ -150,6 +136,11 @@ function sampleFromSchema(schema, opts = {}) {
|
|
|
150
136
|
}
|
|
151
137
|
function sampleFromResolvedSchema(schema, opts, seenRefs) {
|
|
152
138
|
let { type } = schema;
|
|
139
|
+
const { example, additionalProperties, properties, items } = schema;
|
|
140
|
+
const { includeReadOnly, includeWriteOnly } = opts;
|
|
141
|
+
if (example !== void 0) {
|
|
142
|
+
return _chunkV4IQC5XFcjs.dereferenceRefDeep.call(void 0, example, opts.definition, seenRefs);
|
|
143
|
+
}
|
|
153
144
|
const hasPolymorphism = usesPolymorphism(schema);
|
|
154
145
|
if (hasPolymorphism === "allOf") {
|
|
155
146
|
try {
|
|
@@ -194,14 +185,6 @@ function sampleFromResolvedSchema(schema, opts, seenRefs) {
|
|
|
194
185
|
}
|
|
195
186
|
return samples[0];
|
|
196
187
|
}
|
|
197
|
-
const { example, additionalProperties, properties, items } = schema;
|
|
198
|
-
const { includeReadOnly, includeWriteOnly } = opts;
|
|
199
|
-
if (example !== void 0) {
|
|
200
|
-
const cleanedExample = deeplyStripKey(example, "$$ref", (val) => {
|
|
201
|
-
return typeof val === "string" && val.indexOf("#") > -1;
|
|
202
|
-
});
|
|
203
|
-
return _chunkV4IQC5XFcjs.dereferenceRefDeep.call(void 0, cleanedExample, opts.definition, seenRefs);
|
|
204
|
-
}
|
|
205
188
|
if (!type) {
|
|
206
189
|
if (properties || additionalProperties) {
|
|
207
190
|
type = "object";
|
|
@@ -215,16 +198,16 @@ function sampleFromResolvedSchema(schema, opts, seenRefs) {
|
|
|
215
198
|
const props = objectify(properties);
|
|
216
199
|
const obj = {};
|
|
217
200
|
for (const name in props) {
|
|
218
|
-
if (_optionalChain([props, 'optionalAccess',
|
|
201
|
+
if (_optionalChain([props, 'optionalAccess', _2 => _2[name], 'access', _3 => _3.deprecated])) {
|
|
219
202
|
continue;
|
|
220
203
|
}
|
|
221
|
-
if (_optionalChain([props, 'optionalAccess',
|
|
204
|
+
if (_optionalChain([props, 'optionalAccess', _4 => _4[name], 'access', _5 => _5.readOnly]) && !includeReadOnly) {
|
|
222
205
|
continue;
|
|
223
206
|
}
|
|
224
|
-
if (_optionalChain([props, 'optionalAccess',
|
|
207
|
+
if (_optionalChain([props, 'optionalAccess', _6 => _6[name], 'access', _7 => _7.writeOnly]) && !includeWriteOnly) {
|
|
225
208
|
continue;
|
|
226
209
|
}
|
|
227
|
-
if (_optionalChain([props, 'access',
|
|
210
|
+
if (_optionalChain([props, 'access', _8 => _8[name], 'access', _9 => _9.examples, 'optionalAccess', _10 => _10.length])) {
|
|
228
211
|
obj[name] = props[name].examples[0];
|
|
229
212
|
continue;
|
|
230
213
|
}
|
|
@@ -342,7 +325,7 @@ function getMediaTypeExamples(mediaType, mediaTypeObject, definition, opts = {})
|
|
|
342
325
|
// src/operation/lib/get-response-examples.ts
|
|
343
326
|
function getResponseExamples(operation, definition) {
|
|
344
327
|
return Object.keys(operation.responses || {}).map((status) => {
|
|
345
|
-
let response = _optionalChain([operation, 'access',
|
|
328
|
+
let response = _optionalChain([operation, 'access', _11 => _11.responses, 'optionalAccess', _12 => _12[status]]);
|
|
346
329
|
let onlyHeaders = false;
|
|
347
330
|
if (!response) return false;
|
|
348
331
|
if (_chunk3MTU2ESPcjs.isRef.call(void 0, response)) {
|
|
@@ -350,9 +333,9 @@ function getResponseExamples(operation, definition) {
|
|
|
350
333
|
if (!response || _chunk3MTU2ESPcjs.isRef.call(void 0, response)) return false;
|
|
351
334
|
}
|
|
352
335
|
const mediaTypes = {};
|
|
353
|
-
(_optionalChain([response, 'optionalAccess',
|
|
336
|
+
(_optionalChain([response, 'optionalAccess', _13 => _13.content]) ? Object.keys(response.content) : []).forEach((mediaType) => {
|
|
354
337
|
if (!mediaType) return;
|
|
355
|
-
const mediaTypeObject = _optionalChain([response, 'access',
|
|
338
|
+
const mediaTypeObject = _optionalChain([response, 'access', _14 => _14.content, 'optionalAccess', _15 => _15[mediaType]]);
|
|
356
339
|
if (!mediaTypeObject) return;
|
|
357
340
|
const examples = getMediaTypeExamples(mediaType, mediaTypeObject, definition, {
|
|
358
341
|
includeReadOnly: true,
|
|
@@ -383,7 +366,7 @@ function getCallbackExamples(operation, definition) {
|
|
|
383
366
|
return [];
|
|
384
367
|
}
|
|
385
368
|
const examples = Object.keys(operation.callbacks).map((identifier) => {
|
|
386
|
-
let callback = _optionalChain([operation, 'access',
|
|
369
|
+
let callback = _optionalChain([operation, 'access', _16 => _16.callbacks, 'optionalAccess', _17 => _17[identifier]]);
|
|
387
370
|
if (!callback) return [];
|
|
388
371
|
if (_chunk3MTU2ESPcjs.isRef.call(void 0, callback)) {
|
|
389
372
|
callback = _chunkV4IQC5XFcjs.dereferenceRef.call(void 0, callback, definition);
|
|
@@ -443,7 +426,7 @@ function getExampleGroups(operation) {
|
|
|
443
426
|
const namelessCodeSampleCounts = {};
|
|
444
427
|
const groups = {};
|
|
445
428
|
const codeSamples = _chunkAYA3UT4Lcjs.getExtension.call(void 0, "code-samples", operation.api, operation);
|
|
446
|
-
_optionalChain([codeSamples, 'optionalAccess',
|
|
429
|
+
_optionalChain([codeSamples, 'optionalAccess', _18 => _18.forEach, 'call', _19 => _19((sample, i) => {
|
|
447
430
|
if (namelessCodeSampleCounts[sample.language]) {
|
|
448
431
|
namelessCodeSampleCounts[sample.language] += 1;
|
|
449
432
|
} else {
|
|
@@ -451,7 +434,7 @@ function getExampleGroups(operation) {
|
|
|
451
434
|
}
|
|
452
435
|
const name = getDefaultName(sample, namelessCodeSampleCounts);
|
|
453
436
|
if (sample.correspondingExample) {
|
|
454
|
-
if (_optionalChain([groups, 'access',
|
|
437
|
+
if (_optionalChain([groups, 'access', _20 => _20[sample.correspondingExample], 'optionalAccess', _21 => _21.customCodeSamples, 'optionalAccess', _22 => _22.length])) {
|
|
455
438
|
groups[sample.correspondingExample].customCodeSamples.push({ ...sample, name, originalIndex: i });
|
|
456
439
|
} else if (sample.correspondingExample) {
|
|
457
440
|
groups[sample.correspondingExample] = {
|
|
@@ -459,7 +442,7 @@ function getExampleGroups(operation) {
|
|
|
459
442
|
customCodeSamples: [{ ...sample, name, originalIndex: i }]
|
|
460
443
|
};
|
|
461
444
|
}
|
|
462
|
-
} else if (_optionalChain([groups, 'access',
|
|
445
|
+
} else if (_optionalChain([groups, 'access', _23 => _23[noCorrespondingResponseKey], 'optionalAccess', _24 => _24.customCodeSamples, 'optionalAccess', _25 => _25.length])) {
|
|
463
446
|
groups[noCorrespondingResponseKey].customCodeSamples.push({ ...sample, name, originalIndex: i });
|
|
464
447
|
} else {
|
|
465
448
|
groups[noCorrespondingResponseKey] = {
|
|
@@ -481,11 +464,11 @@ function getExampleGroups(operation) {
|
|
|
481
464
|
}
|
|
482
465
|
groups[exampleKey] = {
|
|
483
466
|
...groups[exampleKey],
|
|
484
|
-
name: _optionalChain([groups, 'access',
|
|
467
|
+
name: _optionalChain([groups, 'access', _26 => _26[exampleKey], 'optionalAccess', _27 => _27.name]) || example.summary || exampleKey,
|
|
485
468
|
request: {
|
|
486
|
-
..._optionalChain([groups, 'access',
|
|
469
|
+
..._optionalChain([groups, 'access', _28 => _28[exampleKey], 'optionalAccess', _29 => _29.request]),
|
|
487
470
|
[param.in]: {
|
|
488
|
-
..._optionalChain([groups, 'access',
|
|
471
|
+
..._optionalChain([groups, 'access', _30 => _30[exampleKey], 'optionalAccess', _31 => _31.request, 'optionalAccess', _32 => _32[param.in]]),
|
|
489
472
|
[param.name]: example.value
|
|
490
473
|
}
|
|
491
474
|
}
|
|
@@ -498,9 +481,9 @@ function getExampleGroups(operation) {
|
|
|
498
481
|
const mediaType = requestExample.mediaType === "application/x-www-form-urlencoded" ? "formData" : "body";
|
|
499
482
|
groups[mediaTypeExample.title] = {
|
|
500
483
|
...groups[mediaTypeExample.title],
|
|
501
|
-
name: _optionalChain([groups, 'access',
|
|
484
|
+
name: _optionalChain([groups, 'access', _33 => _33[mediaTypeExample.title], 'optionalAccess', _34 => _34.name]) || mediaTypeExample.summary || mediaTypeExample.title,
|
|
502
485
|
request: {
|
|
503
|
-
..._optionalChain([groups, 'access',
|
|
486
|
+
..._optionalChain([groups, 'access', _35 => _35[mediaTypeExample.title], 'optionalAccess', _36 => _36.request]),
|
|
504
487
|
[mediaType]: mediaTypeExample.value
|
|
505
488
|
}
|
|
506
489
|
};
|
|
@@ -547,11 +530,11 @@ function getRequestBodyExamples(operation, definition) {
|
|
|
547
530
|
|
|
548
531
|
// src/operation/lib/operationId.ts
|
|
549
532
|
function hasOperationId(operation) {
|
|
550
|
-
return Boolean("operationId" in operation && _optionalChain([operation, 'access',
|
|
533
|
+
return Boolean("operationId" in operation && _optionalChain([operation, 'access', _37 => _37.operationId, 'optionalAccess', _38 => _38.length]));
|
|
551
534
|
}
|
|
552
535
|
function getOperationId(path, method, operation, opts = {}) {
|
|
553
536
|
function sanitize(id) {
|
|
554
|
-
return id.replace(_optionalChain([opts, 'optionalAccess',
|
|
537
|
+
return id.replace(_optionalChain([opts, 'optionalAccess', _39 => _39.camelCase]) || _optionalChain([opts, 'optionalAccess', _40 => _40.friendlyCase]) ? /[^a-zA-Z0-9_]/g : /[^a-zA-Z0-9]/g, "-").replace(/--+/g, "-").replace(/^-|-$/g, "");
|
|
555
538
|
}
|
|
556
539
|
const operationIdExists = hasOperationId(operation);
|
|
557
540
|
let operationId;
|
|
@@ -561,8 +544,8 @@ function getOperationId(path, method, operation, opts = {}) {
|
|
|
561
544
|
operationId = sanitize(path).toLowerCase();
|
|
562
545
|
}
|
|
563
546
|
const currMethod = method.toLowerCase();
|
|
564
|
-
if (_optionalChain([opts, 'optionalAccess',
|
|
565
|
-
if (_optionalChain([opts, 'optionalAccess',
|
|
547
|
+
if (_optionalChain([opts, 'optionalAccess', _41 => _41.camelCase]) || _optionalChain([opts, 'optionalAccess', _42 => _42.friendlyCase])) {
|
|
548
|
+
if (_optionalChain([opts, 'optionalAccess', _43 => _43.friendlyCase])) {
|
|
566
549
|
operationId = operationId.replaceAll("_", " ");
|
|
567
550
|
if (!operationIdExists) {
|
|
568
551
|
operationId = operationId.replace(/[^a-zA-Z0-9_]+(.)/g, (_, chr) => ` ${chr}`).split(" ").filter((word, i, arr) => word !== arr[i - 1]).join(" ");
|
|
@@ -599,7 +582,7 @@ function buildHeadersSchema(response, schemaOptions) {
|
|
|
599
582
|
const seenRefs = _nullishCoalesce(schemaOptions.seenRefs, () => ( /* @__PURE__ */ new Set()));
|
|
600
583
|
if (response.headers) {
|
|
601
584
|
Object.keys(response.headers).forEach((key) => {
|
|
602
|
-
let headerEntry = _optionalChain([response, 'access',
|
|
585
|
+
let headerEntry = _optionalChain([response, 'access', _44 => _44.headers, 'optionalAccess', _45 => _45[key]]);
|
|
603
586
|
if (!headerEntry) return;
|
|
604
587
|
if (_chunk3MTU2ESPcjs.isRef.call(void 0, headerEntry)) {
|
|
605
588
|
headerEntry = _chunkV4IQC5XFcjs.dereferenceRef.call(void 0, headerEntry, api, seenRefs);
|
|
@@ -694,8 +677,8 @@ function getResponseAsJSONSchema(operation, api, statusCode, opts) {
|
|
|
694
677
|
}
|
|
695
678
|
return _chunkV4IQC5XFcjs.toJSONSchema.call(void 0, schema, baseSchemaOptions);
|
|
696
679
|
}
|
|
697
|
-
const foundSchema = getPreferredSchema(response.content, _optionalChain([opts, 'optionalAccess',
|
|
698
|
-
if (_optionalChain([opts, 'optionalAccess',
|
|
680
|
+
const foundSchema = getPreferredSchema(response.content, _optionalChain([opts, 'optionalAccess', _46 => _46.contentType]));
|
|
681
|
+
if (_optionalChain([opts, 'optionalAccess', _47 => _47.contentType]) && !foundSchema) {
|
|
699
682
|
return null;
|
|
700
683
|
}
|
|
701
684
|
if (foundSchema) {
|
|
@@ -857,11 +840,11 @@ var Operation = (_class = class {
|
|
|
857
840
|
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.2.md#user-content-operation-summary}
|
|
858
841
|
*/
|
|
859
842
|
getSummary() {
|
|
860
|
-
if (_optionalChain([this, 'access',
|
|
843
|
+
if (_optionalChain([this, 'access', _48 => _48.schema, 'optionalAccess', _49 => _49.summary]) && typeof this.schema.summary === "string") {
|
|
861
844
|
return this.schema.summary;
|
|
862
845
|
}
|
|
863
|
-
const pathItem = _optionalChain([this, 'access',
|
|
864
|
-
if (_optionalChain([pathItem, 'optionalAccess',
|
|
846
|
+
const pathItem = _optionalChain([this, 'access', _50 => _50.api, 'access', _51 => _51.paths, 'optionalAccess', _52 => _52[this.path]]);
|
|
847
|
+
if (_optionalChain([pathItem, 'optionalAccess', _53 => _53.summary]) && typeof pathItem.summary === "string") {
|
|
865
848
|
return pathItem.summary;
|
|
866
849
|
}
|
|
867
850
|
return void 0;
|
|
@@ -873,11 +856,11 @@ var Operation = (_class = class {
|
|
|
873
856
|
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.2.md#user-content-operation-description}
|
|
874
857
|
*/
|
|
875
858
|
getDescription() {
|
|
876
|
-
if (_optionalChain([this, 'access',
|
|
859
|
+
if (_optionalChain([this, 'access', _54 => _54.schema, 'optionalAccess', _55 => _55.description]) && typeof this.schema.description === "string") {
|
|
877
860
|
return this.schema.description;
|
|
878
861
|
}
|
|
879
|
-
const pathItem = _optionalChain([this, 'access',
|
|
880
|
-
if (_optionalChain([pathItem, 'optionalAccess',
|
|
862
|
+
const pathItem = _optionalChain([this, 'access', _56 => _56.api, 'access', _57 => _57.paths, 'optionalAccess', _58 => _58[this.path]]);
|
|
863
|
+
if (_optionalChain([pathItem, 'optionalAccess', _59 => _59.description]) && typeof pathItem.description === "string") {
|
|
881
864
|
return pathItem.description;
|
|
882
865
|
}
|
|
883
866
|
return void 0;
|
|
@@ -903,7 +886,7 @@ var Operation = (_class = class {
|
|
|
903
886
|
}
|
|
904
887
|
}
|
|
905
888
|
this.contentType = "application/json";
|
|
906
|
-
if (_optionalChain([types, 'optionalAccess',
|
|
889
|
+
if (_optionalChain([types, 'optionalAccess', _60 => _60.length])) {
|
|
907
890
|
this.contentType = types[0];
|
|
908
891
|
}
|
|
909
892
|
types.forEach((t) => {
|
|
@@ -966,7 +949,7 @@ var Operation = (_class = class {
|
|
|
966
949
|
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.2.md#security-requirement-object}
|
|
967
950
|
*/
|
|
968
951
|
getSecurity() {
|
|
969
|
-
if (!_optionalChain([this, 'access',
|
|
952
|
+
if (!_optionalChain([this, 'access', _61 => _61.api, 'optionalAccess', _62 => _62.components, 'optionalAccess', _63 => _63.securitySchemes]) || !Object.keys(this.api.components.securitySchemes).length) {
|
|
970
953
|
return [];
|
|
971
954
|
}
|
|
972
955
|
return this.schema.security || this.api.security || [];
|
|
@@ -992,7 +975,7 @@ var Operation = (_class = class {
|
|
|
992
975
|
const keysWithTypes = keys.map((key) => {
|
|
993
976
|
let security;
|
|
994
977
|
try {
|
|
995
|
-
security = _optionalChain([this, 'access',
|
|
978
|
+
security = _optionalChain([this, 'access', _64 => _64.api, 'optionalAccess', _65 => _65.components, 'optionalAccess', _66 => _66.securitySchemes, 'optionalAccess', _67 => _67[key]]);
|
|
996
979
|
if (!security) return false;
|
|
997
980
|
if (_chunk3MTU2ESPcjs.isRef.call(void 0, security)) {
|
|
998
981
|
security = _chunkV4IQC5XFcjs.dereferenceRef.call(void 0, security, this.api);
|
|
@@ -1044,7 +1027,7 @@ var Operation = (_class = class {
|
|
|
1044
1027
|
if (!prev[security.type]) prev[security.type] = [];
|
|
1045
1028
|
const exists = prev[security.type].some((sec) => sec._key === security.security._key);
|
|
1046
1029
|
if (!exists) {
|
|
1047
|
-
if (_optionalChain([security, 'access',
|
|
1030
|
+
if (_optionalChain([security, 'access', _68 => _68.security, 'optionalAccess', _69 => _69._requirements])) delete security.security._requirements;
|
|
1048
1031
|
prev[security.type].push(security.security);
|
|
1049
1032
|
}
|
|
1050
1033
|
});
|
|
@@ -1095,7 +1078,7 @@ var Operation = (_class = class {
|
|
|
1095
1078
|
return [];
|
|
1096
1079
|
}
|
|
1097
1080
|
}
|
|
1098
|
-
return _optionalChain([response, 'optionalAccess',
|
|
1081
|
+
return _optionalChain([response, 'optionalAccess', _70 => _70.headers]) ? Object.keys(response.headers) : [];
|
|
1099
1082
|
}).reduce((a, b) => a.concat(b), []);
|
|
1100
1083
|
}
|
|
1101
1084
|
if (!this.headers.request.includes("Content-Type") && this.schema.requestBody) {
|
|
@@ -1112,7 +1095,7 @@ var Operation = (_class = class {
|
|
|
1112
1095
|
}
|
|
1113
1096
|
if (this.schema.responses) {
|
|
1114
1097
|
const hasResponseContent = Object.keys(this.schema.responses).some((r) => {
|
|
1115
|
-
let response = _optionalChain([this, 'access',
|
|
1098
|
+
let response = _optionalChain([this, 'access', _71 => _71.schema, 'access', _72 => _72.responses, 'optionalAccess', _73 => _73[r]]);
|
|
1116
1099
|
if (!response) return false;
|
|
1117
1100
|
if (_chunk3MTU2ESPcjs.isRef.call(void 0, response)) {
|
|
1118
1101
|
this.schema.responses[r] = _chunkV4IQC5XFcjs.dereferenceRef.call(void 0, response, this.api);
|
|
@@ -1179,7 +1162,7 @@ var Operation = (_class = class {
|
|
|
1179
1162
|
return [];
|
|
1180
1163
|
}
|
|
1181
1164
|
const oasTagMap = /* @__PURE__ */ new Map();
|
|
1182
|
-
if (Array.isArray(_optionalChain([this, 'access',
|
|
1165
|
+
if (Array.isArray(_optionalChain([this, 'access', _74 => _74.api, 'optionalAccess', _75 => _75.tags]))) {
|
|
1183
1166
|
this.api.tags.forEach((tag) => {
|
|
1184
1167
|
oasTagMap.set(tag.name, tag);
|
|
1185
1168
|
});
|
|
@@ -1222,7 +1205,7 @@ var Operation = (_class = class {
|
|
|
1222
1205
|
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.2.md#user-content-operation-parameters}
|
|
1223
1206
|
*/
|
|
1224
1207
|
getParameters() {
|
|
1225
|
-
let parameters = (_optionalChain([this, 'access',
|
|
1208
|
+
let parameters = (_optionalChain([this, 'access', _76 => _76.schema, 'optionalAccess', _77 => _77.parameters]) || []).map((p) => {
|
|
1226
1209
|
let param = p;
|
|
1227
1210
|
if (_chunk3MTU2ESPcjs.isRef.call(void 0, param)) {
|
|
1228
1211
|
param = _chunkV4IQC5XFcjs.dereferenceRef.call(void 0, param, this.api);
|
|
@@ -1230,7 +1213,7 @@ var Operation = (_class = class {
|
|
|
1230
1213
|
}
|
|
1231
1214
|
return param;
|
|
1232
1215
|
}).filter((param) => param !== void 0);
|
|
1233
|
-
const commonParams = (_optionalChain([this, 'access',
|
|
1216
|
+
const commonParams = (_optionalChain([this, 'access', _78 => _78.api, 'optionalAccess', _79 => _79.paths, 'optionalAccess', _80 => _80[this.path], 'optionalAccess', _81 => _81.parameters]) || []).map((p) => {
|
|
1234
1217
|
let param = p;
|
|
1235
1218
|
if (_chunk3MTU2ESPcjs.isRef.call(void 0, param)) {
|
|
1236
1219
|
param = _chunkV4IQC5XFcjs.dereferenceRef.call(void 0, param, this.api);
|
|
@@ -1323,7 +1306,7 @@ var Operation = (_class = class {
|
|
|
1323
1306
|
if (key.startsWith("x-")) {
|
|
1324
1307
|
return false;
|
|
1325
1308
|
}
|
|
1326
|
-
const response = _optionalChain([this, 'access',
|
|
1309
|
+
const response = _optionalChain([this, 'access', _82 => _82.schema, 'access', _83 => _83.responses, 'optionalAccess', _84 => _84[key]]);
|
|
1327
1310
|
return response && typeof response === "object";
|
|
1328
1311
|
});
|
|
1329
1312
|
}
|
|
@@ -1470,7 +1453,7 @@ var Operation = (_class = class {
|
|
|
1470
1453
|
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.2.md#request-body-examples}
|
|
1471
1454
|
*/
|
|
1472
1455
|
getRequestBodyExamples() {
|
|
1473
|
-
const isRequestExampleValueDefined = typeof _optionalChain([this, 'access',
|
|
1456
|
+
const isRequestExampleValueDefined = typeof _optionalChain([this, 'access', _85 => _85.requestBodyExamples, 'optionalAccess', _86 => _86[0], 'optionalAccess', _87 => _87.examples, 'optionalAccess', _88 => _88[0], 'access', _89 => _89.value]) !== "undefined";
|
|
1474
1457
|
if (this.requestBodyExamples && isRequestExampleValueDefined) {
|
|
1475
1458
|
return this.requestBodyExamples;
|
|
1476
1459
|
}
|
|
@@ -1565,7 +1548,7 @@ var Operation = (_class = class {
|
|
|
1565
1548
|
if (!this.hasCallbacks()) return [];
|
|
1566
1549
|
const callbacks = [];
|
|
1567
1550
|
Object.keys(this.schema.callbacks).forEach((callback) => {
|
|
1568
|
-
let cb = _optionalChain([this, 'access',
|
|
1551
|
+
let cb = _optionalChain([this, 'access', _90 => _90.schema, 'access', _91 => _91.callbacks, 'optionalAccess', _92 => _92[callback]]);
|
|
1569
1552
|
if (!cb) return;
|
|
1570
1553
|
if (_chunk3MTU2ESPcjs.isRef.call(void 0, cb)) {
|
|
1571
1554
|
this.schema.callbacks[callback] = _chunkV4IQC5XFcjs.dereferenceRef.call(void 0, cb, this.api);
|
|
@@ -1628,7 +1611,7 @@ var Operation = (_class = class {
|
|
|
1628
1611
|
* @deprecated Use `oas.getExtension(extension, operation)` instead.
|
|
1629
1612
|
*/
|
|
1630
1613
|
getExtension(extension) {
|
|
1631
|
-
return _optionalChain([this, 'access',
|
|
1614
|
+
return _optionalChain([this, 'access', _93 => _93.schema, 'optionalAccess', _94 => _94[extension]]);
|
|
1632
1615
|
}
|
|
1633
1616
|
/**
|
|
1634
1617
|
* Returns an object with groups of all example definitions (body/header/query/path/response/etc.).
|
|
@@ -1715,7 +1698,7 @@ var Operation = (_class = class {
|
|
|
1715
1698
|
// We need to convert our `Set` to an array in order to match the typings.
|
|
1716
1699
|
circularRefs: [...circularRefs]
|
|
1717
1700
|
};
|
|
1718
|
-
if (_optionalChain([opts, 'optionalAccess',
|
|
1701
|
+
if (_optionalChain([opts, 'optionalAccess', _95 => _95.cb])) {
|
|
1719
1702
|
opts.cb();
|
|
1720
1703
|
}
|
|
1721
1704
|
}).then(() => {
|
|
@@ -1779,7 +1762,7 @@ var Callback = class extends Operation {
|
|
|
1779
1762
|
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.2.md#user-content-operation-summary}
|
|
1780
1763
|
*/
|
|
1781
1764
|
getSummary() {
|
|
1782
|
-
if (_optionalChain([this, 'access',
|
|
1765
|
+
if (_optionalChain([this, 'access', _96 => _96.schema, 'optionalAccess', _97 => _97.summary]) && typeof this.schema.summary === "string") {
|
|
1783
1766
|
return this.schema.summary;
|
|
1784
1767
|
} else if (this.parentSchema.summary && typeof this.parentSchema.summary === "string") {
|
|
1785
1768
|
return this.parentSchema.summary;
|
|
@@ -1793,7 +1776,7 @@ var Callback = class extends Operation {
|
|
|
1793
1776
|
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.2.md#user-content-operation-description}
|
|
1794
1777
|
*/
|
|
1795
1778
|
getDescription() {
|
|
1796
|
-
if (_optionalChain([this, 'access',
|
|
1779
|
+
if (_optionalChain([this, 'access', _98 => _98.schema, 'optionalAccess', _99 => _99.description]) && typeof this.schema.description === "string") {
|
|
1797
1780
|
return this.schema.description;
|
|
1798
1781
|
} else if (this.parentSchema.description && typeof this.parentSchema.description === "string") {
|
|
1799
1782
|
return this.parentSchema.description;
|
|
@@ -1807,7 +1790,7 @@ var Callback = class extends Operation {
|
|
|
1807
1790
|
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.2.md#user-content-operation-parameters}
|
|
1808
1791
|
*/
|
|
1809
1792
|
getParameters() {
|
|
1810
|
-
let parameters = (_optionalChain([this, 'access',
|
|
1793
|
+
let parameters = (_optionalChain([this, 'access', _100 => _100.schema, 'optionalAccess', _101 => _101.parameters]) || []).map((p) => {
|
|
1811
1794
|
let param = p;
|
|
1812
1795
|
if (_chunk3MTU2ESPcjs.isRef.call(void 0, param)) {
|
|
1813
1796
|
param = _chunkV4IQC5XFcjs.dereferenceRef.call(void 0, param, this.api);
|
|
@@ -1837,7 +1820,7 @@ var Webhook = class extends Operation {
|
|
|
1837
1820
|
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.2.md#user-content-operation-summary}
|
|
1838
1821
|
*/
|
|
1839
1822
|
getSummary() {
|
|
1840
|
-
if (_optionalChain([this, 'access',
|
|
1823
|
+
if (_optionalChain([this, 'access', _102 => _102.schema, 'optionalAccess', _103 => _103.summary]) && typeof this.schema.summary === "string") {
|
|
1841
1824
|
return this.schema.summary;
|
|
1842
1825
|
} else if (!this.api.webhooks) {
|
|
1843
1826
|
return void 0;
|
|
@@ -1847,7 +1830,7 @@ var Webhook = class extends Operation {
|
|
|
1847
1830
|
this.api.webhooks[this.path] = _chunkV4IQC5XFcjs.dereferenceRef.call(void 0, webhookPath, this.api);
|
|
1848
1831
|
webhookPath = this.api.webhooks[this.path];
|
|
1849
1832
|
}
|
|
1850
|
-
return _optionalChain([webhookPath, 'optionalAccess',
|
|
1833
|
+
return _optionalChain([webhookPath, 'optionalAccess', _104 => _104.summary]);
|
|
1851
1834
|
}
|
|
1852
1835
|
/**
|
|
1853
1836
|
* Retrieve the `description` for this operation.
|
|
@@ -1856,7 +1839,7 @@ var Webhook = class extends Operation {
|
|
|
1856
1839
|
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.2.md#user-content-operation-description}
|
|
1857
1840
|
*/
|
|
1858
1841
|
getDescription() {
|
|
1859
|
-
if (_optionalChain([this, 'access',
|
|
1842
|
+
if (_optionalChain([this, 'access', _105 => _105.schema, 'optionalAccess', _106 => _106.description]) && typeof this.schema.description === "string") {
|
|
1860
1843
|
return this.schema.description;
|
|
1861
1844
|
} else if (!this.api.webhooks) {
|
|
1862
1845
|
return void 0;
|
|
@@ -1866,7 +1849,7 @@ var Webhook = class extends Operation {
|
|
|
1866
1849
|
this.api.webhooks[this.path] = _chunkV4IQC5XFcjs.dereferenceRef.call(void 0, webhookPath, this.api);
|
|
1867
1850
|
webhookPath = this.api.webhooks[this.path];
|
|
1868
1851
|
}
|
|
1869
|
-
return _optionalChain([webhookPath, 'optionalAccess',
|
|
1852
|
+
return _optionalChain([webhookPath, 'optionalAccess', _107 => _107.description]);
|
|
1870
1853
|
}
|
|
1871
1854
|
};
|
|
1872
1855
|
|
|
@@ -1887,4 +1870,4 @@ exports.Operation = Operation; exports.Callback = Callback; exports.Webhook = We
|
|
|
1887
1870
|
* @license Apache-2.0
|
|
1888
1871
|
* @see {@link https://github.com/swagger-api/swagger-ui/blob/master/src/core/plugins/samples/fn.js}
|
|
1889
1872
|
*/
|
|
1890
|
-
//# sourceMappingURL=chunk-
|
|
1873
|
+
//# sourceMappingURL=chunk-HZ7LCMAM.cjs.map
|