oas 32.1.11 → 32.1.13
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 +5 -5
- package/dist/analyzer/index.js +3 -3
- package/dist/{chunk-2J4VKLIT.js → chunk-2EISA7HB.js} +4 -4
- package/dist/chunk-2EISA7HB.js.map +1 -0
- package/dist/{chunk-DNLCD3K6.cjs → chunk-7BWVOLZR.cjs} +131 -130
- package/dist/chunk-7BWVOLZR.cjs.map +1 -0
- package/dist/{chunk-FGPV2UXT.cjs → chunk-BJEFIYTO.cjs} +20 -20
- package/dist/chunk-BJEFIYTO.cjs.map +1 -0
- package/dist/{chunk-JCBISKOK.js → chunk-GIFUTDD5.js} +18 -17
- package/dist/chunk-GIFUTDD5.js.map +1 -0
- package/dist/{chunk-QINBUHP2.js → chunk-K5WNB3M7.js} +10 -7
- package/dist/chunk-K5WNB3M7.js.map +1 -0
- package/dist/{chunk-X7KOY66H.cjs → chunk-SAB2PGCD.cjs} +10 -7
- package/dist/chunk-SAB2PGCD.cjs.map +1 -0
- package/dist/index.cjs +4 -4
- package/dist/index.js +3 -3
- package/dist/operation/index.cjs +3 -3
- package/dist/operation/index.js +2 -2
- package/dist/reducer/index.cjs +7 -7
- package/dist/reducer/index.cjs.map +1 -1
- package/dist/reducer/index.js +1 -1
- package/dist/reducer/index.js.map +1 -1
- package/dist/utils.cjs +2 -2
- package/dist/utils.js +1 -1
- package/package.json +6 -8
- package/dist/chunk-2J4VKLIT.js.map +0 -1
- package/dist/chunk-DNLCD3K6.cjs.map +0 -1
- package/dist/chunk-FGPV2UXT.cjs.map +0 -1
- package/dist/chunk-JCBISKOK.js.map +0 -1
- package/dist/chunk-QINBUHP2.js.map +0 -1
- package/dist/chunk-X7KOY66H.cjs.map +0 -1
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
|
|
18
|
-
var
|
|
18
|
+
var _chunkSAB2PGCDcjs = require('./chunk-SAB2PGCD.cjs');
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
var _chunkAYA3UT4Lcjs = require('./chunk-AYA3UT4L.cjs');
|
|
@@ -56,7 +56,7 @@ function usesPolymorphism(schema) {
|
|
|
56
56
|
return false;
|
|
57
57
|
}
|
|
58
58
|
function objectify(thing) {
|
|
59
|
-
if (!
|
|
59
|
+
if (!_chunkSAB2PGCDcjs.isObject.call(void 0, thing)) {
|
|
60
60
|
return {};
|
|
61
61
|
}
|
|
62
62
|
return thing;
|
|
@@ -70,13 +70,13 @@ function normalizeArray(arr) {
|
|
|
70
70
|
function isFunc(thing) {
|
|
71
71
|
return typeof thing === "function";
|
|
72
72
|
}
|
|
73
|
-
function deeplyStripKey(input, keyToStrip, predicate
|
|
73
|
+
function deeplyStripKey(input, keyToStrip, predicate) {
|
|
74
74
|
if (typeof input !== "object" || Array.isArray(input) || input === null || !keyToStrip) {
|
|
75
75
|
return input;
|
|
76
76
|
}
|
|
77
77
|
const obj = { ...input };
|
|
78
78
|
Object.keys(obj).forEach((k) => {
|
|
79
|
-
if (k === keyToStrip && predicate(obj[k], k)) {
|
|
79
|
+
if (k === keyToStrip && _optionalChain([predicate, 'optionalCall', _2 => _2(obj[k], k)])) {
|
|
80
80
|
delete obj[k];
|
|
81
81
|
return;
|
|
82
82
|
}
|
|
@@ -135,7 +135,7 @@ function sampleFromSchema(schema, opts = {}) {
|
|
|
135
135
|
if (seenRefs.has(refToRelease)) {
|
|
136
136
|
return void 0;
|
|
137
137
|
}
|
|
138
|
-
objectifySchema =
|
|
138
|
+
objectifySchema = _chunkSAB2PGCDcjs.dereferenceRef.call(void 0, objectifySchema, opts.definition, seenRefs);
|
|
139
139
|
if (!objectifySchema || _chunk3MTU2ESPcjs.isRef.call(void 0, objectifySchema)) {
|
|
140
140
|
return void 0;
|
|
141
141
|
}
|
|
@@ -157,7 +157,7 @@ function sampleFromResolvedSchema(schema, opts, seenRefs) {
|
|
|
157
157
|
const resolvedAllOf = schema.allOf.map((subSchema) => {
|
|
158
158
|
let sub = objectify(subSchema);
|
|
159
159
|
if (definition && _chunk3MTU2ESPcjs.isRef.call(void 0, sub)) {
|
|
160
|
-
const resolved =
|
|
160
|
+
const resolved = _chunkSAB2PGCDcjs.dereferenceRef.call(void 0, sub, definition, /* @__PURE__ */ new Set());
|
|
161
161
|
if (resolved && !_chunk3MTU2ESPcjs.isRef.call(void 0, resolved)) {
|
|
162
162
|
sub = resolved;
|
|
163
163
|
}
|
|
@@ -181,7 +181,7 @@ function sampleFromResolvedSchema(schema, opts, seenRefs) {
|
|
|
181
181
|
}
|
|
182
182
|
);
|
|
183
183
|
} catch (e) {
|
|
184
|
-
return
|
|
184
|
+
return;
|
|
185
185
|
}
|
|
186
186
|
} else if (hasPolymorphism) {
|
|
187
187
|
const samples = schema[hasPolymorphism].map((s) => {
|
|
@@ -207,23 +207,23 @@ function sampleFromResolvedSchema(schema, opts, seenRefs) {
|
|
|
207
207
|
} else if (items) {
|
|
208
208
|
type = "array";
|
|
209
209
|
} else {
|
|
210
|
-
return
|
|
210
|
+
return;
|
|
211
211
|
}
|
|
212
212
|
}
|
|
213
213
|
if (type === "object" || Array.isArray(type) && type.includes("object")) {
|
|
214
214
|
const props = objectify(properties);
|
|
215
215
|
const obj = {};
|
|
216
216
|
for (const name in props) {
|
|
217
|
-
if (_optionalChain([props, 'optionalAccess',
|
|
217
|
+
if (_optionalChain([props, 'optionalAccess', _3 => _3[name], 'access', _4 => _4.deprecated])) {
|
|
218
218
|
continue;
|
|
219
219
|
}
|
|
220
|
-
if (_optionalChain([props, 'optionalAccess',
|
|
220
|
+
if (_optionalChain([props, 'optionalAccess', _5 => _5[name], 'access', _6 => _6.readOnly]) && !includeReadOnly) {
|
|
221
221
|
continue;
|
|
222
222
|
}
|
|
223
|
-
if (_optionalChain([props, 'optionalAccess',
|
|
223
|
+
if (_optionalChain([props, 'optionalAccess', _7 => _7[name], 'access', _8 => _8.writeOnly]) && !includeWriteOnly) {
|
|
224
224
|
continue;
|
|
225
225
|
}
|
|
226
|
-
if (_optionalChain([props, 'access',
|
|
226
|
+
if (_optionalChain([props, 'access', _9 => _9[name], 'access', _10 => _10.examples, 'optionalAccess', _11 => _11.length])) {
|
|
227
227
|
obj[name] = props[name].examples[0];
|
|
228
228
|
continue;
|
|
229
229
|
}
|
|
@@ -267,7 +267,7 @@ function sampleFromResolvedSchema(schema, opts, seenRefs) {
|
|
|
267
267
|
return normalizeArray(schema.enum)[0];
|
|
268
268
|
}
|
|
269
269
|
if (type === "file") {
|
|
270
|
-
return
|
|
270
|
+
return;
|
|
271
271
|
}
|
|
272
272
|
return primitive(schema);
|
|
273
273
|
}
|
|
@@ -277,8 +277,8 @@ var samples_default = memo;
|
|
|
277
277
|
// src/operation/lib/get-mediatype-examples.ts
|
|
278
278
|
function getMediaTypeExamples(mediaType, mediaTypeObject, definition, opts = {}) {
|
|
279
279
|
if (mediaTypeObject.example) {
|
|
280
|
-
mediaTypeObject.example =
|
|
281
|
-
if (mediaTypeObject.example === void 0 ||
|
|
280
|
+
mediaTypeObject.example = _chunkSAB2PGCDcjs.dereferenceRefDeep.call(void 0, mediaTypeObject.example, definition);
|
|
281
|
+
if (mediaTypeObject.example === void 0 || _chunkSAB2PGCDcjs.collectRefsInSchema.call(void 0, mediaTypeObject.example).size > 0) {
|
|
282
282
|
return [];
|
|
283
283
|
}
|
|
284
284
|
return [
|
|
@@ -294,7 +294,7 @@ function getMediaTypeExamples(mediaType, mediaTypeObject, definition, opts = {})
|
|
|
294
294
|
let example = examples[key];
|
|
295
295
|
if (example !== null && typeof example === "object") {
|
|
296
296
|
if (_chunk3MTU2ESPcjs.isRef.call(void 0, example)) {
|
|
297
|
-
example =
|
|
297
|
+
example = _chunkSAB2PGCDcjs.dereferenceRef.call(void 0, example, definition);
|
|
298
298
|
if (!example || _chunk3MTU2ESPcjs.isRef.call(void 0, example)) {
|
|
299
299
|
return false;
|
|
300
300
|
}
|
|
@@ -306,8 +306,8 @@ function getMediaTypeExamples(mediaType, mediaTypeObject, definition, opts = {})
|
|
|
306
306
|
description = example.description;
|
|
307
307
|
}
|
|
308
308
|
if ("value" in example) {
|
|
309
|
-
example.value =
|
|
310
|
-
if (example.value === void 0 ||
|
|
309
|
+
example.value = _chunkSAB2PGCDcjs.dereferenceRefDeep.call(void 0, example.value, definition);
|
|
310
|
+
if (example.value === void 0 || _chunkSAB2PGCDcjs.collectRefsInSchema.call(void 0, example.value).size > 0) {
|
|
311
311
|
return false;
|
|
312
312
|
}
|
|
313
313
|
example = example.value;
|
|
@@ -324,7 +324,7 @@ function getMediaTypeExamples(mediaType, mediaTypeObject, definition, opts = {})
|
|
|
324
324
|
}
|
|
325
325
|
}
|
|
326
326
|
if (mediaTypeObject.schema) {
|
|
327
|
-
if (!
|
|
327
|
+
if (!_chunkSAB2PGCDcjs.matches_mimetype_default.xml(mediaType)) {
|
|
328
328
|
return [
|
|
329
329
|
{
|
|
330
330
|
value: samples_default(structuredClone(mediaTypeObject.schema), {
|
|
@@ -341,17 +341,17 @@ function getMediaTypeExamples(mediaType, mediaTypeObject, definition, opts = {})
|
|
|
341
341
|
// src/operation/lib/get-response-examples.ts
|
|
342
342
|
function getResponseExamples(operation, definition) {
|
|
343
343
|
return Object.keys(operation.responses || {}).map((status) => {
|
|
344
|
-
let response = _optionalChain([operation, 'access',
|
|
344
|
+
let response = _optionalChain([operation, 'access', _12 => _12.responses, 'optionalAccess', _13 => _13[status]]);
|
|
345
345
|
let onlyHeaders = false;
|
|
346
346
|
if (!response) return false;
|
|
347
347
|
if (_chunk3MTU2ESPcjs.isRef.call(void 0, response)) {
|
|
348
|
-
response =
|
|
348
|
+
response = _chunkSAB2PGCDcjs.dereferenceRef.call(void 0, response, definition);
|
|
349
349
|
if (!response || _chunk3MTU2ESPcjs.isRef.call(void 0, response)) return false;
|
|
350
350
|
}
|
|
351
351
|
const mediaTypes = {};
|
|
352
|
-
(_optionalChain([response, 'optionalAccess',
|
|
352
|
+
(_optionalChain([response, 'optionalAccess', _14 => _14.content]) ? Object.keys(response.content) : []).forEach((mediaType) => {
|
|
353
353
|
if (!mediaType) return;
|
|
354
|
-
const mediaTypeObject = _optionalChain([response, 'access',
|
|
354
|
+
const mediaTypeObject = _optionalChain([response, 'access', _15 => _15.content, 'optionalAccess', _16 => _16[mediaType]]);
|
|
355
355
|
if (!mediaTypeObject) return;
|
|
356
356
|
const examples = getMediaTypeExamples(mediaType, mediaTypeObject, definition, {
|
|
357
357
|
includeReadOnly: true,
|
|
@@ -382,17 +382,17 @@ function getCallbackExamples(operation, definition) {
|
|
|
382
382
|
return [];
|
|
383
383
|
}
|
|
384
384
|
const examples = Object.keys(operation.callbacks).map((identifier) => {
|
|
385
|
-
let callback = _optionalChain([operation, 'access',
|
|
385
|
+
let callback = _optionalChain([operation, 'access', _17 => _17.callbacks, 'optionalAccess', _18 => _18[identifier]]);
|
|
386
386
|
if (!callback) return [];
|
|
387
387
|
if (_chunk3MTU2ESPcjs.isRef.call(void 0, callback)) {
|
|
388
|
-
callback =
|
|
388
|
+
callback = _chunkSAB2PGCDcjs.dereferenceRef.call(void 0, callback, definition);
|
|
389
389
|
if (!callback || _chunk3MTU2ESPcjs.isRef.call(void 0, callback)) return [];
|
|
390
390
|
}
|
|
391
391
|
const items = Object.keys(callback).map((expression) => {
|
|
392
392
|
let callbackPath = callback[expression];
|
|
393
393
|
if (!callbackPath) return [];
|
|
394
394
|
if (_chunk3MTU2ESPcjs.isRef.call(void 0, callbackPath)) {
|
|
395
|
-
callbackPath =
|
|
395
|
+
callbackPath = _chunkSAB2PGCDcjs.dereferenceRef.call(void 0, callbackPath, definition);
|
|
396
396
|
if (!callbackPath || _chunk3MTU2ESPcjs.isRef.call(void 0, callbackPath)) return [];
|
|
397
397
|
}
|
|
398
398
|
return Object.keys(callbackPath).map((method) => {
|
|
@@ -442,7 +442,7 @@ function getExampleGroups(operation) {
|
|
|
442
442
|
const namelessCodeSampleCounts = {};
|
|
443
443
|
const groups = {};
|
|
444
444
|
const codeSamples = _chunkAYA3UT4Lcjs.getExtension.call(void 0, "code-samples", operation.api, operation);
|
|
445
|
-
_optionalChain([codeSamples, 'optionalAccess',
|
|
445
|
+
_optionalChain([codeSamples, 'optionalAccess', _19 => _19.forEach, 'call', _20 => _20((sample, i) => {
|
|
446
446
|
if (namelessCodeSampleCounts[sample.language]) {
|
|
447
447
|
namelessCodeSampleCounts[sample.language] += 1;
|
|
448
448
|
} else {
|
|
@@ -450,7 +450,7 @@ function getExampleGroups(operation) {
|
|
|
450
450
|
}
|
|
451
451
|
const name = getDefaultName(sample, namelessCodeSampleCounts);
|
|
452
452
|
if (sample.correspondingExample) {
|
|
453
|
-
if (_optionalChain([groups, 'access',
|
|
453
|
+
if (_optionalChain([groups, 'access', _21 => _21[sample.correspondingExample], 'optionalAccess', _22 => _22.customCodeSamples, 'optionalAccess', _23 => _23.length])) {
|
|
454
454
|
groups[sample.correspondingExample].customCodeSamples.push({ ...sample, name, originalIndex: i });
|
|
455
455
|
} else if (sample.correspondingExample) {
|
|
456
456
|
groups[sample.correspondingExample] = {
|
|
@@ -458,7 +458,7 @@ function getExampleGroups(operation) {
|
|
|
458
458
|
customCodeSamples: [{ ...sample, name, originalIndex: i }]
|
|
459
459
|
};
|
|
460
460
|
}
|
|
461
|
-
} else if (_optionalChain([groups, 'access',
|
|
461
|
+
} else if (_optionalChain([groups, 'access', _24 => _24[noCorrespondingResponseKey], 'optionalAccess', _25 => _25.customCodeSamples, 'optionalAccess', _26 => _26.length])) {
|
|
462
462
|
groups[noCorrespondingResponseKey].customCodeSamples.push({ ...sample, name, originalIndex: i });
|
|
463
463
|
} else {
|
|
464
464
|
groups[noCorrespondingResponseKey] = {
|
|
@@ -475,16 +475,16 @@ function getExampleGroups(operation) {
|
|
|
475
475
|
Object.entries(param.examples || {}).forEach(([exampleKey, paramExample]) => {
|
|
476
476
|
let example = paramExample;
|
|
477
477
|
if (_chunk3MTU2ESPcjs.isRef.call(void 0, example)) {
|
|
478
|
-
example =
|
|
478
|
+
example = _chunkSAB2PGCDcjs.dereferenceRef.call(void 0, example, operation.api);
|
|
479
479
|
if (!example || _chunk3MTU2ESPcjs.isRef.call(void 0, example)) return;
|
|
480
480
|
}
|
|
481
481
|
groups[exampleKey] = {
|
|
482
482
|
...groups[exampleKey],
|
|
483
|
-
name: _optionalChain([groups, 'access',
|
|
483
|
+
name: _optionalChain([groups, 'access', _27 => _27[exampleKey], 'optionalAccess', _28 => _28.name]) || example.summary || exampleKey,
|
|
484
484
|
request: {
|
|
485
|
-
..._optionalChain([groups, 'access',
|
|
485
|
+
..._optionalChain([groups, 'access', _29 => _29[exampleKey], 'optionalAccess', _30 => _30.request]),
|
|
486
486
|
[param.in]: {
|
|
487
|
-
..._optionalChain([groups, 'access',
|
|
487
|
+
..._optionalChain([groups, 'access', _31 => _31[exampleKey], 'optionalAccess', _32 => _32.request, 'optionalAccess', _33 => _33[param.in]]),
|
|
488
488
|
[param.name]: example.value
|
|
489
489
|
}
|
|
490
490
|
}
|
|
@@ -497,9 +497,9 @@ function getExampleGroups(operation) {
|
|
|
497
497
|
const mediaType = requestExample.mediaType === "application/x-www-form-urlencoded" ? "formData" : "body";
|
|
498
498
|
groups[mediaTypeExample.title] = {
|
|
499
499
|
...groups[mediaTypeExample.title],
|
|
500
|
-
name: _optionalChain([groups, 'access',
|
|
500
|
+
name: _optionalChain([groups, 'access', _34 => _34[mediaTypeExample.title], 'optionalAccess', _35 => _35.name]) || mediaTypeExample.summary || mediaTypeExample.title,
|
|
501
501
|
request: {
|
|
502
|
-
..._optionalChain([groups, 'access',
|
|
502
|
+
..._optionalChain([groups, 'access', _36 => _36[mediaTypeExample.title], 'optionalAccess', _37 => _37.request]),
|
|
503
503
|
[mediaType]: mediaTypeExample.value
|
|
504
504
|
}
|
|
505
505
|
};
|
|
@@ -523,7 +523,7 @@ function getRequestBodyExamples(operation, definition) {
|
|
|
523
523
|
if (!requestBody) {
|
|
524
524
|
return [];
|
|
525
525
|
} else if (_chunk3MTU2ESPcjs.isRef.call(void 0, requestBody)) {
|
|
526
|
-
requestBody =
|
|
526
|
+
requestBody = _chunkSAB2PGCDcjs.dereferenceRef.call(void 0, requestBody, definition);
|
|
527
527
|
}
|
|
528
528
|
if (!requestBody || _chunk3MTU2ESPcjs.isRef.call(void 0, requestBody) || !requestBody.content) {
|
|
529
529
|
return [];
|
|
@@ -546,11 +546,11 @@ function getRequestBodyExamples(operation, definition) {
|
|
|
546
546
|
|
|
547
547
|
// src/operation/lib/operationId.ts
|
|
548
548
|
function hasOperationId(operation) {
|
|
549
|
-
return Boolean("operationId" in operation && _optionalChain([operation, 'access',
|
|
549
|
+
return Boolean("operationId" in operation && _optionalChain([operation, 'access', _38 => _38.operationId, 'optionalAccess', _39 => _39.length]));
|
|
550
550
|
}
|
|
551
551
|
function getOperationId(path, method, operation, opts = {}) {
|
|
552
552
|
function sanitize(id) {
|
|
553
|
-
return id.replace(_optionalChain([opts, 'optionalAccess',
|
|
553
|
+
return id.replace(_optionalChain([opts, 'optionalAccess', _40 => _40.camelCase]) || _optionalChain([opts, 'optionalAccess', _41 => _41.friendlyCase]) ? /[^a-zA-Z0-9_]/g : /[^a-zA-Z0-9]/g, "-").replace(/--+/g, "-").replace(/^-|-$/g, "");
|
|
554
554
|
}
|
|
555
555
|
const operationIdExists = hasOperationId(operation);
|
|
556
556
|
let operationId;
|
|
@@ -560,8 +560,8 @@ function getOperationId(path, method, operation, opts = {}) {
|
|
|
560
560
|
operationId = sanitize(path).toLowerCase();
|
|
561
561
|
}
|
|
562
562
|
const currMethod = method.toLowerCase();
|
|
563
|
-
if (_optionalChain([opts, 'optionalAccess',
|
|
564
|
-
if (_optionalChain([opts, 'optionalAccess',
|
|
563
|
+
if (_optionalChain([opts, 'optionalAccess', _42 => _42.camelCase]) || _optionalChain([opts, 'optionalAccess', _43 => _43.friendlyCase])) {
|
|
564
|
+
if (_optionalChain([opts, 'optionalAccess', _44 => _44.friendlyCase])) {
|
|
565
565
|
operationId = operationId.replaceAll("_", " ");
|
|
566
566
|
if (!operationIdExists) {
|
|
567
567
|
operationId = operationId.replace(/[^a-zA-Z0-9_]+(.)/g, (_, chr) => ` ${chr}`).split(" ").filter((word, i, arr) => word !== arr[i - 1]).join(" ");
|
|
@@ -588,7 +588,7 @@ function getOperationId(path, method, operation, opts = {}) {
|
|
|
588
588
|
}
|
|
589
589
|
|
|
590
590
|
// src/operation/transformers/get-response-as-json-schema.ts
|
|
591
|
-
var isJSON =
|
|
591
|
+
var isJSON = _chunkSAB2PGCDcjs.matches_mimetype_default.json;
|
|
592
592
|
function buildHeadersSchema(response, schemaOptions) {
|
|
593
593
|
const headersSchema = {
|
|
594
594
|
type: "object",
|
|
@@ -598,10 +598,10 @@ function buildHeadersSchema(response, schemaOptions) {
|
|
|
598
598
|
const seenRefs = _nullishCoalesce(schemaOptions.seenRefs, () => ( /* @__PURE__ */ new Set()));
|
|
599
599
|
if (response.headers) {
|
|
600
600
|
Object.keys(response.headers).forEach((key) => {
|
|
601
|
-
let headerEntry = _optionalChain([response, 'access',
|
|
601
|
+
let headerEntry = _optionalChain([response, 'access', _45 => _45.headers, 'optionalAccess', _46 => _46[key]]);
|
|
602
602
|
if (!headerEntry) return;
|
|
603
603
|
if (_chunk3MTU2ESPcjs.isRef.call(void 0, headerEntry)) {
|
|
604
|
-
headerEntry =
|
|
604
|
+
headerEntry = _chunkSAB2PGCDcjs.dereferenceRef.call(void 0, headerEntry, api, seenRefs);
|
|
605
605
|
if (!headerEntry || _chunk3MTU2ESPcjs.isRef.call(void 0, headerEntry)) return;
|
|
606
606
|
}
|
|
607
607
|
if (headerEntry.schema) {
|
|
@@ -609,10 +609,10 @@ function buildHeadersSchema(response, schemaOptions) {
|
|
|
609
609
|
let headerSchema = header.schema;
|
|
610
610
|
if (!headerSchema) return;
|
|
611
611
|
if (_chunk3MTU2ESPcjs.isRef.call(void 0, headerSchema)) {
|
|
612
|
-
headerSchema =
|
|
612
|
+
headerSchema = _chunkSAB2PGCDcjs.dereferenceRef.call(void 0, headerSchema, api, seenRefs);
|
|
613
613
|
if (!headerSchema || _chunk3MTU2ESPcjs.isRef.call(void 0, headerSchema)) return;
|
|
614
614
|
}
|
|
615
|
-
headersSchema.properties[key] =
|
|
615
|
+
headersSchema.properties[key] = _chunkSAB2PGCDcjs.toJSONSchema.call(void 0, _chunkSAB2PGCDcjs.cloneObject.call(void 0, headerSchema), {
|
|
616
616
|
addEnumsToDescriptions: true,
|
|
617
617
|
...schemaOptions
|
|
618
618
|
});
|
|
@@ -666,35 +666,35 @@ function getResponseAsJSONSchema(operation, api, statusCode, opts) {
|
|
|
666
666
|
}
|
|
667
667
|
if (preferredContentType) {
|
|
668
668
|
if (contentTypes.includes(preferredContentType)) {
|
|
669
|
-
const schema2 =
|
|
669
|
+
const schema2 = _chunkSAB2PGCDcjs.cloneObject.call(void 0, content[preferredContentType].schema);
|
|
670
670
|
if (!schema2) {
|
|
671
671
|
return null;
|
|
672
672
|
}
|
|
673
|
-
return
|
|
673
|
+
return _chunkSAB2PGCDcjs.toJSONSchema.call(void 0, schema2, baseSchemaOptions);
|
|
674
674
|
}
|
|
675
675
|
return null;
|
|
676
676
|
}
|
|
677
677
|
for (let i = 0; i < contentTypes.length; i++) {
|
|
678
678
|
if (isJSON(contentTypes[i])) {
|
|
679
|
-
const schema2 =
|
|
679
|
+
const schema2 = _chunkSAB2PGCDcjs.cloneObject.call(void 0, content[contentTypes[i]].schema);
|
|
680
680
|
if (!schema2) {
|
|
681
681
|
return {};
|
|
682
682
|
}
|
|
683
|
-
return
|
|
683
|
+
return _chunkSAB2PGCDcjs.toJSONSchema.call(void 0, schema2, baseSchemaOptions);
|
|
684
684
|
}
|
|
685
685
|
}
|
|
686
686
|
const contentType = contentTypes.shift();
|
|
687
687
|
if (!contentType) {
|
|
688
688
|
return {};
|
|
689
689
|
}
|
|
690
|
-
const schema =
|
|
690
|
+
const schema = _chunkSAB2PGCDcjs.cloneObject.call(void 0, content[contentType].schema);
|
|
691
691
|
if (!schema) {
|
|
692
692
|
return {};
|
|
693
693
|
}
|
|
694
|
-
return
|
|
694
|
+
return _chunkSAB2PGCDcjs.toJSONSchema.call(void 0, schema, baseSchemaOptions);
|
|
695
695
|
}
|
|
696
|
-
const foundSchema = getPreferredSchema(response.content, _optionalChain([opts, 'optionalAccess',
|
|
697
|
-
if (_optionalChain([opts, 'optionalAccess',
|
|
696
|
+
const foundSchema = getPreferredSchema(response.content, _optionalChain([opts, 'optionalAccess', _47 => _47.contentType]));
|
|
697
|
+
if (_optionalChain([opts, 'optionalAccess', _48 => _48.contentType]) && !foundSchema) {
|
|
698
698
|
return null;
|
|
699
699
|
}
|
|
700
700
|
if (foundSchema) {
|
|
@@ -710,37 +710,37 @@ function getResponseAsJSONSchema(operation, api, statusCode, opts) {
|
|
|
710
710
|
// able to render so instead of generating a JSON Schema with an `undefined` type we should
|
|
711
711
|
// default to `string` so there's at least *something* the end-user can interact with.
|
|
712
712
|
type: _nullishCoalesce(schemaType, () => ( "string")),
|
|
713
|
-
schema:
|
|
713
|
+
schema: _chunkSAB2PGCDcjs.isPrimitive.call(void 0, schema) ? schema : {
|
|
714
714
|
...schema,
|
|
715
|
-
$schema:
|
|
715
|
+
$schema: _chunkSAB2PGCDcjs.getSchemaVersionString.call(void 0, schema, api)
|
|
716
716
|
},
|
|
717
717
|
label: "Response body"
|
|
718
718
|
};
|
|
719
719
|
if (response.description && schemaWrapper.schema) {
|
|
720
720
|
schemaWrapper.description = response.description;
|
|
721
721
|
}
|
|
722
|
-
|
|
722
|
+
_chunkSAB2PGCDcjs.applyDiscriminatorOneOfToUsedSchemas.call(void 0, api, usedSchemas, (ref) => {
|
|
723
723
|
if (usedSchemas.has(ref)) {
|
|
724
724
|
return usedSchemas.get(ref);
|
|
725
725
|
}
|
|
726
726
|
try {
|
|
727
|
-
const resolved =
|
|
728
|
-
if (_chunk3MTU2ESPcjs.isRef.call(void 0, resolved)) return
|
|
729
|
-
const converted =
|
|
727
|
+
const resolved = _chunkSAB2PGCDcjs.dereferenceRef.call(void 0, { $ref: ref }, api, seenRefs);
|
|
728
|
+
if (_chunk3MTU2ESPcjs.isRef.call(void 0, resolved)) return;
|
|
729
|
+
const converted = _chunkSAB2PGCDcjs.toJSONSchema.call(void 0, structuredClone(resolved), {
|
|
730
730
|
...baseSchemaOptions,
|
|
731
731
|
seenRefs
|
|
732
732
|
});
|
|
733
733
|
usedSchemas.set(ref, converted);
|
|
734
734
|
return converted;
|
|
735
735
|
} catch (e2) {
|
|
736
|
-
return void 0;
|
|
737
736
|
}
|
|
738
737
|
});
|
|
739
738
|
if (schemaWrapper.schema && usedSchemas.size > 0) {
|
|
739
|
+
const refsInOutput = _chunkSAB2PGCDcjs.collectRefsInSchema.call(void 0, schemaWrapper.schema);
|
|
740
740
|
const refsInGroup = _nullishCoalesce(refsByGroup.get("body"), () => ( /* @__PURE__ */ new Set()));
|
|
741
|
-
const referencedSchemas =
|
|
741
|
+
const referencedSchemas = _chunkSAB2PGCDcjs.filterRequiredRefsToReferenced.call(void 0, /* @__PURE__ */ new Set([...refsInGroup, ...refsInOutput]), usedSchemas);
|
|
742
742
|
if (referencedSchemas.size > 0) {
|
|
743
|
-
|
|
743
|
+
_chunkSAB2PGCDcjs.mergeReferencedSchemasIntoRoot.call(void 0, schemaWrapper.schema, referencedSchemas);
|
|
744
744
|
}
|
|
745
745
|
}
|
|
746
746
|
jsonSchema.push(schemaWrapper);
|
|
@@ -752,9 +752,10 @@ function getResponseAsJSONSchema(operation, api, statusCode, opts) {
|
|
|
752
752
|
});
|
|
753
753
|
if (headersWrapper.schema && usedSchemas.size > 0) {
|
|
754
754
|
const refsInGroup = _nullishCoalesce(refsByGroup.get("headers"), () => ( /* @__PURE__ */ new Set()));
|
|
755
|
-
const
|
|
755
|
+
const refsInOutput = _chunkSAB2PGCDcjs.collectRefsInSchema.call(void 0, headersWrapper.schema);
|
|
756
|
+
const referencedSchemas = _chunkSAB2PGCDcjs.filterRequiredRefsToReferenced.call(void 0, /* @__PURE__ */ new Set([...refsInGroup, ...refsInOutput]), usedSchemas);
|
|
756
757
|
if (referencedSchemas.size > 0) {
|
|
757
|
-
|
|
758
|
+
_chunkSAB2PGCDcjs.mergeReferencedSchemasIntoRoot.call(void 0, headersWrapper.schema, referencedSchemas);
|
|
758
759
|
}
|
|
759
760
|
}
|
|
760
761
|
jsonSchema.push(headersWrapper);
|
|
@@ -855,11 +856,11 @@ var Operation = (_class = class {
|
|
|
855
856
|
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.2.md#user-content-operation-summary}
|
|
856
857
|
*/
|
|
857
858
|
getSummary() {
|
|
858
|
-
if (_optionalChain([this, 'access',
|
|
859
|
+
if (_optionalChain([this, 'access', _49 => _49.schema, 'optionalAccess', _50 => _50.summary]) && typeof this.schema.summary === "string") {
|
|
859
860
|
return this.schema.summary;
|
|
860
861
|
}
|
|
861
|
-
const pathItem = _optionalChain([this, 'access',
|
|
862
|
-
if (_optionalChain([pathItem, 'optionalAccess',
|
|
862
|
+
const pathItem = _optionalChain([this, 'access', _51 => _51.api, 'access', _52 => _52.paths, 'optionalAccess', _53 => _53[this.path]]);
|
|
863
|
+
if (_optionalChain([pathItem, 'optionalAccess', _54 => _54.summary]) && typeof pathItem.summary === "string") {
|
|
863
864
|
return pathItem.summary;
|
|
864
865
|
}
|
|
865
866
|
return void 0;
|
|
@@ -871,11 +872,11 @@ var Operation = (_class = class {
|
|
|
871
872
|
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.2.md#user-content-operation-description}
|
|
872
873
|
*/
|
|
873
874
|
getDescription() {
|
|
874
|
-
if (_optionalChain([this, 'access',
|
|
875
|
+
if (_optionalChain([this, 'access', _55 => _55.schema, 'optionalAccess', _56 => _56.description]) && typeof this.schema.description === "string") {
|
|
875
876
|
return this.schema.description;
|
|
876
877
|
}
|
|
877
|
-
const pathItem = _optionalChain([this, 'access',
|
|
878
|
-
if (_optionalChain([pathItem, 'optionalAccess',
|
|
878
|
+
const pathItem = _optionalChain([this, 'access', _57 => _57.api, 'access', _58 => _58.paths, 'optionalAccess', _59 => _59[this.path]]);
|
|
879
|
+
if (_optionalChain([pathItem, 'optionalAccess', _60 => _60.description]) && typeof pathItem.description === "string") {
|
|
879
880
|
return pathItem.description;
|
|
880
881
|
}
|
|
881
882
|
return void 0;
|
|
@@ -894,18 +895,18 @@ var Operation = (_class = class {
|
|
|
894
895
|
let types = [];
|
|
895
896
|
if (this.schema.requestBody) {
|
|
896
897
|
if (_chunk3MTU2ESPcjs.isRef.call(void 0, this.schema.requestBody)) {
|
|
897
|
-
this.schema.requestBody =
|
|
898
|
+
this.schema.requestBody = _chunkSAB2PGCDcjs.dereferenceRef.call(void 0, this.schema.requestBody, this.api);
|
|
898
899
|
}
|
|
899
900
|
if (this.schema.requestBody && "content" in this.schema.requestBody) {
|
|
900
901
|
types = Object.keys(this.schema.requestBody.content);
|
|
901
902
|
}
|
|
902
903
|
}
|
|
903
904
|
this.contentType = "application/json";
|
|
904
|
-
if (_optionalChain([types, 'optionalAccess',
|
|
905
|
+
if (_optionalChain([types, 'optionalAccess', _61 => _61.length])) {
|
|
905
906
|
this.contentType = types[0];
|
|
906
907
|
}
|
|
907
908
|
types.forEach((t) => {
|
|
908
|
-
if (
|
|
909
|
+
if (_chunkSAB2PGCDcjs.matches_mimetype_default.json(t)) {
|
|
909
910
|
this.contentType = t;
|
|
910
911
|
}
|
|
911
912
|
});
|
|
@@ -918,7 +919,7 @@ var Operation = (_class = class {
|
|
|
918
919
|
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.2.md#user-content-request-body-content}
|
|
919
920
|
*/
|
|
920
921
|
isFormUrlEncoded() {
|
|
921
|
-
return
|
|
922
|
+
return _chunkSAB2PGCDcjs.matches_mimetype_default.formUrlEncoded(this.getContentType());
|
|
922
923
|
}
|
|
923
924
|
/**
|
|
924
925
|
* Checks if the current operation has a mutipart content type payload.
|
|
@@ -927,7 +928,7 @@ var Operation = (_class = class {
|
|
|
927
928
|
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.2.md#user-content-request-body-content}
|
|
928
929
|
*/
|
|
929
930
|
isMultipart() {
|
|
930
|
-
return
|
|
931
|
+
return _chunkSAB2PGCDcjs.matches_mimetype_default.multipart(this.getContentType());
|
|
931
932
|
}
|
|
932
933
|
/**
|
|
933
934
|
* Checks if the current operation has a JSON-like content type payload.
|
|
@@ -936,7 +937,7 @@ var Operation = (_class = class {
|
|
|
936
937
|
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.2.md#user-content-request-body-content}
|
|
937
938
|
*/
|
|
938
939
|
isJson() {
|
|
939
|
-
return
|
|
940
|
+
return _chunkSAB2PGCDcjs.matches_mimetype_default.json(this.getContentType());
|
|
940
941
|
}
|
|
941
942
|
/**
|
|
942
943
|
* Checks if the current operation has an XML content type payload.
|
|
@@ -945,7 +946,7 @@ var Operation = (_class = class {
|
|
|
945
946
|
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.2.md#user-content-request-body-content}
|
|
946
947
|
*/
|
|
947
948
|
isXml() {
|
|
948
|
-
return
|
|
949
|
+
return _chunkSAB2PGCDcjs.matches_mimetype_default.xml(this.getContentType());
|
|
949
950
|
}
|
|
950
951
|
/**
|
|
951
952
|
* Checks if the current operation is a webhook or not.
|
|
@@ -964,7 +965,7 @@ var Operation = (_class = class {
|
|
|
964
965
|
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.2.md#security-requirement-object}
|
|
965
966
|
*/
|
|
966
967
|
getSecurity() {
|
|
967
|
-
if (!_optionalChain([this, 'access',
|
|
968
|
+
if (!_optionalChain([this, 'access', _62 => _62.api, 'optionalAccess', _63 => _63.components, 'optionalAccess', _64 => _64.securitySchemes]) || !Object.keys(this.api.components.securitySchemes).length) {
|
|
968
969
|
return [];
|
|
969
970
|
}
|
|
970
971
|
return this.schema.security || this.api.security || [];
|
|
@@ -990,10 +991,10 @@ var Operation = (_class = class {
|
|
|
990
991
|
const keysWithTypes = keys.map((key) => {
|
|
991
992
|
let security;
|
|
992
993
|
try {
|
|
993
|
-
security = _optionalChain([this, 'access',
|
|
994
|
+
security = _optionalChain([this, 'access', _65 => _65.api, 'optionalAccess', _66 => _66.components, 'optionalAccess', _67 => _67.securitySchemes, 'optionalAccess', _68 => _68[key]]);
|
|
994
995
|
if (!security) return false;
|
|
995
996
|
if (_chunk3MTU2ESPcjs.isRef.call(void 0, security)) {
|
|
996
|
-
security =
|
|
997
|
+
security = _chunkSAB2PGCDcjs.dereferenceRef.call(void 0, security, this.api);
|
|
997
998
|
if (!security || _chunk3MTU2ESPcjs.isRef.call(void 0, security)) return false;
|
|
998
999
|
}
|
|
999
1000
|
} catch (e4) {
|
|
@@ -1042,7 +1043,7 @@ var Operation = (_class = class {
|
|
|
1042
1043
|
if (!prev[security.type]) prev[security.type] = [];
|
|
1043
1044
|
const exists = prev[security.type].some((sec) => sec._key === security.security._key);
|
|
1044
1045
|
if (!exists) {
|
|
1045
|
-
if (_optionalChain([security, 'access',
|
|
1046
|
+
if (_optionalChain([security, 'access', _69 => _69.security, 'optionalAccess', _70 => _70._requirements])) delete security.security._requirements;
|
|
1046
1047
|
prev[security.type].push(security.security);
|
|
1047
1048
|
}
|
|
1048
1049
|
});
|
|
@@ -1074,11 +1075,11 @@ var Operation = (_class = class {
|
|
|
1074
1075
|
this.schema.parameters.map((p) => {
|
|
1075
1076
|
let param = p;
|
|
1076
1077
|
if (_chunk3MTU2ESPcjs.isRef.call(void 0, param)) {
|
|
1077
|
-
param =
|
|
1078
|
-
if (!param || _chunk3MTU2ESPcjs.isRef.call(void 0, param)) return
|
|
1078
|
+
param = _chunkSAB2PGCDcjs.dereferenceRef.call(void 0, param, this.api);
|
|
1079
|
+
if (!param || _chunk3MTU2ESPcjs.isRef.call(void 0, param)) return;
|
|
1079
1080
|
}
|
|
1080
1081
|
if (param.in && param.in === "header") return param.name;
|
|
1081
|
-
return
|
|
1082
|
+
return;
|
|
1082
1083
|
}).filter((item) => item !== void 0)
|
|
1083
1084
|
);
|
|
1084
1085
|
}
|
|
@@ -1087,20 +1088,20 @@ var Operation = (_class = class {
|
|
|
1087
1088
|
let response = this.schema.responses[r];
|
|
1088
1089
|
if (!response) return [];
|
|
1089
1090
|
if (_chunk3MTU2ESPcjs.isRef.call(void 0, response)) {
|
|
1090
|
-
this.schema.responses[r] =
|
|
1091
|
+
this.schema.responses[r] = _chunkSAB2PGCDcjs.dereferenceRef.call(void 0, response, this.api);
|
|
1091
1092
|
response = this.schema.responses[r];
|
|
1092
1093
|
if (!response || _chunk3MTU2ESPcjs.isRef.call(void 0, response)) {
|
|
1093
1094
|
return [];
|
|
1094
1095
|
}
|
|
1095
1096
|
}
|
|
1096
|
-
return _optionalChain([response, 'optionalAccess',
|
|
1097
|
+
return _optionalChain([response, 'optionalAccess', _71 => _71.headers]) ? Object.keys(response.headers) : [];
|
|
1097
1098
|
}).reduce((a, b) => a.concat(b), []);
|
|
1098
1099
|
}
|
|
1099
1100
|
if (!this.headers.request.includes("Content-Type") && this.schema.requestBody) {
|
|
1100
1101
|
let requestBody = this.schema.requestBody;
|
|
1101
1102
|
if (requestBody) {
|
|
1102
1103
|
if (_chunk3MTU2ESPcjs.isRef.call(void 0, requestBody)) {
|
|
1103
|
-
this.schema.requestBody =
|
|
1104
|
+
this.schema.requestBody = _chunkSAB2PGCDcjs.dereferenceRef.call(void 0, requestBody, this.api);
|
|
1104
1105
|
requestBody = this.schema.requestBody;
|
|
1105
1106
|
}
|
|
1106
1107
|
if (requestBody && !_chunk3MTU2ESPcjs.isRef.call(void 0, requestBody) && "content" in requestBody && Object.keys(requestBody.content)) {
|
|
@@ -1110,10 +1111,10 @@ var Operation = (_class = class {
|
|
|
1110
1111
|
}
|
|
1111
1112
|
if (this.schema.responses) {
|
|
1112
1113
|
const hasResponseContent = Object.keys(this.schema.responses).some((r) => {
|
|
1113
|
-
let response = _optionalChain([this, 'access',
|
|
1114
|
+
let response = _optionalChain([this, 'access', _72 => _72.schema, 'access', _73 => _73.responses, 'optionalAccess', _74 => _74[r]]);
|
|
1114
1115
|
if (!response) return false;
|
|
1115
1116
|
if (_chunk3MTU2ESPcjs.isRef.call(void 0, response)) {
|
|
1116
|
-
this.schema.responses[r] =
|
|
1117
|
+
this.schema.responses[r] = _chunkSAB2PGCDcjs.dereferenceRef.call(void 0, response, this.api);
|
|
1117
1118
|
response = this.schema.responses[r];
|
|
1118
1119
|
if (!response || _chunk3MTU2ESPcjs.isRef.call(void 0, response)) {
|
|
1119
1120
|
return false;
|
|
@@ -1177,7 +1178,7 @@ var Operation = (_class = class {
|
|
|
1177
1178
|
return [];
|
|
1178
1179
|
}
|
|
1179
1180
|
const oasTagMap = /* @__PURE__ */ new Map();
|
|
1180
|
-
if (Array.isArray(_optionalChain([this, 'access',
|
|
1181
|
+
if (Array.isArray(_optionalChain([this, 'access', _75 => _75.api, 'optionalAccess', _76 => _76.tags]))) {
|
|
1181
1182
|
this.api.tags.forEach((tag) => {
|
|
1182
1183
|
oasTagMap.set(tag.name, tag);
|
|
1183
1184
|
});
|
|
@@ -1220,19 +1221,19 @@ var Operation = (_class = class {
|
|
|
1220
1221
|
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.2.md#user-content-operation-parameters}
|
|
1221
1222
|
*/
|
|
1222
1223
|
getParameters() {
|
|
1223
|
-
let parameters = (_optionalChain([this, 'access',
|
|
1224
|
+
let parameters = (_optionalChain([this, 'access', _77 => _77.schema, 'optionalAccess', _78 => _78.parameters]) || []).map((p) => {
|
|
1224
1225
|
let param = p;
|
|
1225
1226
|
if (_chunk3MTU2ESPcjs.isRef.call(void 0, param)) {
|
|
1226
|
-
param =
|
|
1227
|
-
if (!param || _chunk3MTU2ESPcjs.isRef.call(void 0, param)) return
|
|
1227
|
+
param = _chunkSAB2PGCDcjs.dereferenceRef.call(void 0, param, this.api);
|
|
1228
|
+
if (!param || _chunk3MTU2ESPcjs.isRef.call(void 0, param)) return;
|
|
1228
1229
|
}
|
|
1229
1230
|
return param;
|
|
1230
1231
|
}).filter((param) => param !== void 0);
|
|
1231
|
-
const commonParams = (_optionalChain([this, 'access',
|
|
1232
|
+
const commonParams = (_optionalChain([this, 'access', _79 => _79.api, 'optionalAccess', _80 => _80.paths, 'optionalAccess', _81 => _81[this.path], 'optionalAccess', _82 => _82.parameters]) || []).map((p) => {
|
|
1232
1233
|
let param = p;
|
|
1233
1234
|
if (_chunk3MTU2ESPcjs.isRef.call(void 0, param)) {
|
|
1234
|
-
param =
|
|
1235
|
-
if (!param || _chunk3MTU2ESPcjs.isRef.call(void 0, param)) return
|
|
1235
|
+
param = _chunkSAB2PGCDcjs.dereferenceRef.call(void 0, param, this.api);
|
|
1236
|
+
if (!param || _chunk3MTU2ESPcjs.isRef.call(void 0, param)) return;
|
|
1236
1237
|
}
|
|
1237
1238
|
return param;
|
|
1238
1239
|
}).filter((param) => param !== void 0);
|
|
@@ -1269,10 +1270,10 @@ var Operation = (_class = class {
|
|
|
1269
1270
|
);
|
|
1270
1271
|
}
|
|
1271
1272
|
if (!this.schemasDecorated) {
|
|
1272
|
-
|
|
1273
|
+
_chunkSAB2PGCDcjs.decorateComponentSchemasWithRefName.call(void 0, this.api);
|
|
1273
1274
|
this.schemasDecorated = true;
|
|
1274
1275
|
}
|
|
1275
|
-
return
|
|
1276
|
+
return _chunkSAB2PGCDcjs.getParametersAsJSONSchema.call(void 0, this, this.api, {
|
|
1276
1277
|
includeDiscriminatorMappingRefs: true,
|
|
1277
1278
|
...opts
|
|
1278
1279
|
});
|
|
@@ -1297,7 +1298,7 @@ var Operation = (_class = class {
|
|
|
1297
1298
|
);
|
|
1298
1299
|
}
|
|
1299
1300
|
if (!this.schemasDecorated) {
|
|
1300
|
-
|
|
1301
|
+
_chunkSAB2PGCDcjs.decorateComponentSchemasWithRefName.call(void 0, this.api);
|
|
1301
1302
|
this.schemasDecorated = true;
|
|
1302
1303
|
}
|
|
1303
1304
|
return getResponseAsJSONSchema(this, this.api, statusCode, {
|
|
@@ -1312,7 +1313,7 @@ var Operation = (_class = class {
|
|
|
1312
1313
|
getResponseStatusCodes() {
|
|
1313
1314
|
if (!this.schema.responses) return [];
|
|
1314
1315
|
if (_chunk3MTU2ESPcjs.isRef.call(void 0, this.schema.responses)) {
|
|
1315
|
-
this.schema.responses =
|
|
1316
|
+
this.schema.responses = _chunkSAB2PGCDcjs.dereferenceRef.call(void 0, this.schema.responses, this.api);
|
|
1316
1317
|
if (!this.schema.responses || _chunk3MTU2ESPcjs.isRef.call(void 0, this.schema.responses)) {
|
|
1317
1318
|
return [];
|
|
1318
1319
|
}
|
|
@@ -1321,7 +1322,7 @@ var Operation = (_class = class {
|
|
|
1321
1322
|
if (key.startsWith("x-")) {
|
|
1322
1323
|
return false;
|
|
1323
1324
|
}
|
|
1324
|
-
const response = _optionalChain([this, 'access',
|
|
1325
|
+
const response = _optionalChain([this, 'access', _83 => _83.schema, 'access', _84 => _84.responses, 'optionalAccess', _85 => _85[key]]);
|
|
1325
1326
|
return response && typeof response === "object";
|
|
1326
1327
|
});
|
|
1327
1328
|
}
|
|
@@ -1338,7 +1339,7 @@ var Operation = (_class = class {
|
|
|
1338
1339
|
let resp = response;
|
|
1339
1340
|
if (!resp) return;
|
|
1340
1341
|
if (_chunk3MTU2ESPcjs.isRef.call(void 0, resp)) {
|
|
1341
|
-
resp =
|
|
1342
|
+
resp = _chunkSAB2PGCDcjs.dereferenceRef.call(void 0, resp, this.api);
|
|
1342
1343
|
if (!resp || _chunk3MTU2ESPcjs.isRef.call(void 0, resp)) {
|
|
1343
1344
|
return;
|
|
1344
1345
|
}
|
|
@@ -1367,7 +1368,7 @@ var Operation = (_class = class {
|
|
|
1367
1368
|
let requestBody = this.schema.requestBody;
|
|
1368
1369
|
if (!requestBody) return false;
|
|
1369
1370
|
if (_chunk3MTU2ESPcjs.isRef.call(void 0, requestBody)) {
|
|
1370
|
-
this.schema.requestBody =
|
|
1371
|
+
this.schema.requestBody = _chunkSAB2PGCDcjs.dereferenceRef.call(void 0, requestBody, this.api);
|
|
1371
1372
|
requestBody = this.schema.requestBody;
|
|
1372
1373
|
if (!requestBody || _chunk3MTU2ESPcjs.isRef.call(void 0, requestBody)) {
|
|
1373
1374
|
return false;
|
|
@@ -1437,7 +1438,7 @@ var Operation = (_class = class {
|
|
|
1437
1438
|
let availableMediaType;
|
|
1438
1439
|
const mediaTypes = this.getRequestBodyMediaTypes();
|
|
1439
1440
|
mediaTypes.forEach((mt) => {
|
|
1440
|
-
if (!availableMediaType &&
|
|
1441
|
+
if (!availableMediaType && _chunkSAB2PGCDcjs.matches_mimetype_default.json(mt)) {
|
|
1441
1442
|
availableMediaType = mt;
|
|
1442
1443
|
}
|
|
1443
1444
|
});
|
|
@@ -1464,7 +1465,7 @@ var Operation = (_class = class {
|
|
|
1464
1465
|
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.2.md#request-body-examples}
|
|
1465
1466
|
*/
|
|
1466
1467
|
getRequestBodyExamples() {
|
|
1467
|
-
const isRequestExampleValueDefined = typeof _optionalChain([this, 'access',
|
|
1468
|
+
const isRequestExampleValueDefined = typeof _optionalChain([this, 'access', _86 => _86.requestBodyExamples, 'optionalAccess', _87 => _87[0], 'optionalAccess', _88 => _88.examples, 'optionalAccess', _89 => _89[0], 'access', _90 => _90.value]) !== "undefined";
|
|
1468
1469
|
if (this.requestBodyExamples && isRequestExampleValueDefined) {
|
|
1469
1470
|
return this.requestBodyExamples;
|
|
1470
1471
|
}
|
|
@@ -1485,7 +1486,7 @@ var Operation = (_class = class {
|
|
|
1485
1486
|
let response = this.schema.responses[statusCode];
|
|
1486
1487
|
if (!response) return false;
|
|
1487
1488
|
if (_chunk3MTU2ESPcjs.isRef.call(void 0, response)) {
|
|
1488
|
-
this.schema.responses[statusCode] =
|
|
1489
|
+
this.schema.responses[statusCode] = _chunkSAB2PGCDcjs.dereferenceRef.call(void 0, response, this.api);
|
|
1489
1490
|
response = this.schema.responses[statusCode];
|
|
1490
1491
|
if (!response || _chunk3MTU2ESPcjs.isRef.call(void 0, response)) {
|
|
1491
1492
|
return false;
|
|
@@ -1529,7 +1530,7 @@ var Operation = (_class = class {
|
|
|
1529
1530
|
let callbackObj = this.schema.callbacks[identifier];
|
|
1530
1531
|
if (!callbackObj) return false;
|
|
1531
1532
|
if (_chunk3MTU2ESPcjs.isRef.call(void 0, callbackObj)) {
|
|
1532
|
-
this.schema.callbacks[identifier] =
|
|
1533
|
+
this.schema.callbacks[identifier] = _chunkSAB2PGCDcjs.dereferenceRef.call(void 0, callbackObj, this.api);
|
|
1533
1534
|
callbackObj = this.schema.callbacks[identifier];
|
|
1534
1535
|
if (!callbackObj || _chunk3MTU2ESPcjs.isRef.call(void 0, callbackObj)) {
|
|
1535
1536
|
return false;
|
|
@@ -1538,7 +1539,7 @@ var Operation = (_class = class {
|
|
|
1538
1539
|
let callback = callbackObj[expression];
|
|
1539
1540
|
if (!callback) return false;
|
|
1540
1541
|
if (_chunk3MTU2ESPcjs.isRef.call(void 0, callback)) {
|
|
1541
|
-
callbackObj[expression] =
|
|
1542
|
+
callbackObj[expression] = _chunkSAB2PGCDcjs.dereferenceRef.call(void 0, callback, this.api);
|
|
1542
1543
|
callback = callbackObj[expression];
|
|
1543
1544
|
if (!callback || _chunk3MTU2ESPcjs.isRef.call(void 0, callback)) {
|
|
1544
1545
|
return false;
|
|
@@ -1559,10 +1560,10 @@ var Operation = (_class = class {
|
|
|
1559
1560
|
if (!this.hasCallbacks()) return [];
|
|
1560
1561
|
const callbacks = [];
|
|
1561
1562
|
Object.keys(this.schema.callbacks).forEach((callback) => {
|
|
1562
|
-
let cb = _optionalChain([this, 'access',
|
|
1563
|
+
let cb = _optionalChain([this, 'access', _91 => _91.schema, 'access', _92 => _92.callbacks, 'optionalAccess', _93 => _93[callback]]);
|
|
1563
1564
|
if (!cb) return;
|
|
1564
1565
|
if (_chunk3MTU2ESPcjs.isRef.call(void 0, cb)) {
|
|
1565
|
-
this.schema.callbacks[callback] =
|
|
1566
|
+
this.schema.callbacks[callback] = _chunkSAB2PGCDcjs.dereferenceRef.call(void 0, cb, this.api);
|
|
1566
1567
|
cb = this.schema.callbacks[callback];
|
|
1567
1568
|
if (!cb || _chunk3MTU2ESPcjs.isRef.call(void 0, cb)) {
|
|
1568
1569
|
return;
|
|
@@ -1572,14 +1573,14 @@ var Operation = (_class = class {
|
|
|
1572
1573
|
let callbackPath = cb[expression];
|
|
1573
1574
|
if (!callbackPath) return;
|
|
1574
1575
|
if (_chunk3MTU2ESPcjs.isRef.call(void 0, callbackPath)) {
|
|
1575
|
-
cb[expression] =
|
|
1576
|
+
cb[expression] = _chunkSAB2PGCDcjs.dereferenceRef.call(void 0, callbackPath, this.api);
|
|
1576
1577
|
callbackPath = cb[expression];
|
|
1577
1578
|
if (!callbackPath || _chunk3MTU2ESPcjs.isRef.call(void 0, callbackPath)) {
|
|
1578
1579
|
return;
|
|
1579
1580
|
}
|
|
1580
1581
|
}
|
|
1581
1582
|
Object.keys(callbackPath).forEach((method) => {
|
|
1582
|
-
if (!
|
|
1583
|
+
if (!_chunkSAB2PGCDcjs.supportedMethods.includes(method)) return;
|
|
1583
1584
|
const found = this.getCallback(callback, expression, method);
|
|
1584
1585
|
if (found) {
|
|
1585
1586
|
callbacks.push(found);
|
|
@@ -1622,7 +1623,7 @@ var Operation = (_class = class {
|
|
|
1622
1623
|
* @deprecated Use `oas.getExtension(extension, operation)` instead.
|
|
1623
1624
|
*/
|
|
1624
1625
|
getExtension(extension) {
|
|
1625
|
-
return _optionalChain([this, 'access',
|
|
1626
|
+
return _optionalChain([this, 'access', _94 => _94.schema, 'optionalAccess', _95 => _95[extension]]);
|
|
1626
1627
|
}
|
|
1627
1628
|
/**
|
|
1628
1629
|
* Returns an object with groups of all example definitions (body/header/query/path/response/etc.).
|
|
@@ -1657,12 +1658,12 @@ var Operation = (_class = class {
|
|
|
1657
1658
|
}
|
|
1658
1659
|
this.dereferencing.processing = true;
|
|
1659
1660
|
if (!this.schemasDecorated) {
|
|
1660
|
-
|
|
1661
|
+
_chunkSAB2PGCDcjs.decorateComponentSchemasWithRefName.call(void 0, this.api);
|
|
1661
1662
|
this.schemasDecorated = true;
|
|
1662
1663
|
}
|
|
1663
1664
|
const { api, schema, promises } = this;
|
|
1664
1665
|
const circularRefs = /* @__PURE__ */ new Set();
|
|
1665
|
-
const dereferencingOptions =
|
|
1666
|
+
const dereferencingOptions = _chunkSAB2PGCDcjs.getDereferencingOptions.call(void 0, circularRefs);
|
|
1666
1667
|
const parser = new (0, _jsonschemarefparser.$RefParser)();
|
|
1667
1668
|
return parser.dereference(
|
|
1668
1669
|
"#/__INTERNAL__",
|
|
@@ -1709,7 +1710,7 @@ var Operation = (_class = class {
|
|
|
1709
1710
|
// We need to convert our `Set` to an array in order to match the typings.
|
|
1710
1711
|
circularRefs: [...circularRefs]
|
|
1711
1712
|
};
|
|
1712
|
-
if (_optionalChain([opts, 'optionalAccess',
|
|
1713
|
+
if (_optionalChain([opts, 'optionalAccess', _96 => _96.cb])) {
|
|
1713
1714
|
opts.cb();
|
|
1714
1715
|
}
|
|
1715
1716
|
}).then(() => {
|
|
@@ -1773,7 +1774,7 @@ var Callback = class extends Operation {
|
|
|
1773
1774
|
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.2.md#user-content-operation-summary}
|
|
1774
1775
|
*/
|
|
1775
1776
|
getSummary() {
|
|
1776
|
-
if (_optionalChain([this, 'access',
|
|
1777
|
+
if (_optionalChain([this, 'access', _97 => _97.schema, 'optionalAccess', _98 => _98.summary]) && typeof this.schema.summary === "string") {
|
|
1777
1778
|
return this.schema.summary;
|
|
1778
1779
|
} else if (this.parentSchema.summary && typeof this.parentSchema.summary === "string") {
|
|
1779
1780
|
return this.parentSchema.summary;
|
|
@@ -1787,7 +1788,7 @@ var Callback = class extends Operation {
|
|
|
1787
1788
|
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.2.md#user-content-operation-description}
|
|
1788
1789
|
*/
|
|
1789
1790
|
getDescription() {
|
|
1790
|
-
if (_optionalChain([this, 'access',
|
|
1791
|
+
if (_optionalChain([this, 'access', _99 => _99.schema, 'optionalAccess', _100 => _100.description]) && typeof this.schema.description === "string") {
|
|
1791
1792
|
return this.schema.description;
|
|
1792
1793
|
} else if (this.parentSchema.description && typeof this.parentSchema.description === "string") {
|
|
1793
1794
|
return this.parentSchema.description;
|
|
@@ -1801,19 +1802,19 @@ var Callback = class extends Operation {
|
|
|
1801
1802
|
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.2.md#user-content-operation-parameters}
|
|
1802
1803
|
*/
|
|
1803
1804
|
getParameters() {
|
|
1804
|
-
let parameters = (_optionalChain([this, 'access',
|
|
1805
|
+
let parameters = (_optionalChain([this, 'access', _101 => _101.schema, 'optionalAccess', _102 => _102.parameters]) || []).map((p) => {
|
|
1805
1806
|
let param = p;
|
|
1806
1807
|
if (_chunk3MTU2ESPcjs.isRef.call(void 0, param)) {
|
|
1807
|
-
param =
|
|
1808
|
-
if (!param || _chunk3MTU2ESPcjs.isRef.call(void 0, param)) return
|
|
1808
|
+
param = _chunkSAB2PGCDcjs.dereferenceRef.call(void 0, param, this.api);
|
|
1809
|
+
if (!param || _chunk3MTU2ESPcjs.isRef.call(void 0, param)) return;
|
|
1809
1810
|
}
|
|
1810
1811
|
return param;
|
|
1811
1812
|
}).filter((param) => param !== void 0);
|
|
1812
1813
|
const commonParams = (this.parentSchema.parameters || []).map((p) => {
|
|
1813
1814
|
let param = p;
|
|
1814
1815
|
if (_chunk3MTU2ESPcjs.isRef.call(void 0, param)) {
|
|
1815
|
-
param =
|
|
1816
|
-
if (!param || _chunk3MTU2ESPcjs.isRef.call(void 0, param)) return
|
|
1816
|
+
param = _chunkSAB2PGCDcjs.dereferenceRef.call(void 0, param, this.api);
|
|
1817
|
+
if (!param || _chunk3MTU2ESPcjs.isRef.call(void 0, param)) return;
|
|
1817
1818
|
}
|
|
1818
1819
|
return param;
|
|
1819
1820
|
}).filter((param) => param !== void 0);
|
|
@@ -1831,17 +1832,17 @@ var Webhook = class extends Operation {
|
|
|
1831
1832
|
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.2.md#user-content-operation-summary}
|
|
1832
1833
|
*/
|
|
1833
1834
|
getSummary() {
|
|
1834
|
-
if (_optionalChain([this, 'access',
|
|
1835
|
+
if (_optionalChain([this, 'access', _103 => _103.schema, 'optionalAccess', _104 => _104.summary]) && typeof this.schema.summary === "string") {
|
|
1835
1836
|
return this.schema.summary;
|
|
1836
1837
|
} else if (!this.api.webhooks) {
|
|
1837
1838
|
return void 0;
|
|
1838
1839
|
}
|
|
1839
1840
|
let webhookPath = this.api.webhooks[this.path];
|
|
1840
1841
|
if (_chunk3MTU2ESPcjs.isRef.call(void 0, webhookPath)) {
|
|
1841
|
-
this.api.webhooks[this.path] =
|
|
1842
|
+
this.api.webhooks[this.path] = _chunkSAB2PGCDcjs.dereferenceRef.call(void 0, webhookPath, this.api);
|
|
1842
1843
|
webhookPath = this.api.webhooks[this.path];
|
|
1843
1844
|
}
|
|
1844
|
-
return _optionalChain([webhookPath, 'optionalAccess',
|
|
1845
|
+
return _optionalChain([webhookPath, 'optionalAccess', _105 => _105.summary]);
|
|
1845
1846
|
}
|
|
1846
1847
|
/**
|
|
1847
1848
|
* Retrieve the `description` for this operation.
|
|
@@ -1850,17 +1851,17 @@ var Webhook = class extends Operation {
|
|
|
1850
1851
|
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.2.md#user-content-operation-description}
|
|
1851
1852
|
*/
|
|
1852
1853
|
getDescription() {
|
|
1853
|
-
if (_optionalChain([this, 'access',
|
|
1854
|
+
if (_optionalChain([this, 'access', _106 => _106.schema, 'optionalAccess', _107 => _107.description]) && typeof this.schema.description === "string") {
|
|
1854
1855
|
return this.schema.description;
|
|
1855
1856
|
} else if (!this.api.webhooks) {
|
|
1856
1857
|
return void 0;
|
|
1857
1858
|
}
|
|
1858
1859
|
let webhookPath = this.api.webhooks[this.path];
|
|
1859
1860
|
if (_chunk3MTU2ESPcjs.isRef.call(void 0, webhookPath)) {
|
|
1860
|
-
this.api.webhooks[this.path] =
|
|
1861
|
+
this.api.webhooks[this.path] = _chunkSAB2PGCDcjs.dereferenceRef.call(void 0, webhookPath, this.api);
|
|
1861
1862
|
webhookPath = this.api.webhooks[this.path];
|
|
1862
1863
|
}
|
|
1863
|
-
return _optionalChain([webhookPath, 'optionalAccess',
|
|
1864
|
+
return _optionalChain([webhookPath, 'optionalAccess', _108 => _108.description]);
|
|
1864
1865
|
}
|
|
1865
1866
|
};
|
|
1866
1867
|
|
|
@@ -1881,4 +1882,4 @@ exports.Operation = Operation; exports.Callback = Callback; exports.Webhook = We
|
|
|
1881
1882
|
* @license Apache-2.0
|
|
1882
1883
|
* @see {@link https://github.com/swagger-api/swagger-ui/blob/master/src/core/plugins/samples/fn.js}
|
|
1883
1884
|
*/
|
|
1884
|
-
//# sourceMappingURL=chunk-
|
|
1885
|
+
//# sourceMappingURL=chunk-7BWVOLZR.cjs.map
|