oas 32.1.6 → 32.1.8
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-UJRHFM6H.cjs → chunk-7AHI3P7Q.cjs} +19 -19
- package/dist/{chunk-UJRHFM6H.cjs.map → chunk-7AHI3P7Q.cjs.map} +1 -1
- package/dist/{chunk-CH3OYPVG.js → chunk-7BR3G6FM.js} +59 -19
- package/dist/chunk-7BR3G6FM.js.map +1 -0
- package/dist/{chunk-QXIKSHG7.js → chunk-A3J3WY7Q.js} +3 -3
- package/dist/{chunk-4ZMPFZPV.cjs → chunk-KZCEPS4J.cjs} +67 -27
- package/dist/chunk-KZCEPS4J.cjs.map +1 -0
- package/dist/{chunk-N4ZALGH2.js → chunk-MQX2OLEW.js} +27 -5
- package/dist/chunk-MQX2OLEW.js.map +1 -0
- package/dist/{chunk-5X7RYFCP.cjs → chunk-SM47EGII.cjs} +96 -74
- package/dist/chunk-SM47EGII.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.js +1 -1
- package/dist/utils.cjs +2 -2
- package/dist/utils.js +1 -1
- package/package.json +2 -2
- package/dist/chunk-4ZMPFZPV.cjs.map +0 -1
- package/dist/chunk-5X7RYFCP.cjs.map +0 -1
- package/dist/chunk-CH3OYPVG.js.map +0 -1
- package/dist/chunk-N4ZALGH2.js.map +0 -1
- /package/dist/{chunk-QXIKSHG7.js.map → chunk-A3J3WY7Q.js.map} +0 -0
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
var
|
|
16
|
+
var _chunkKZCEPS4Jcjs = require('./chunk-KZCEPS4J.cjs');
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
var _chunkAYA3UT4Lcjs = require('./chunk-AYA3UT4L.cjs');
|
|
@@ -54,7 +54,7 @@ function usesPolymorphism(schema) {
|
|
|
54
54
|
return false;
|
|
55
55
|
}
|
|
56
56
|
function objectify(thing) {
|
|
57
|
-
if (!
|
|
57
|
+
if (!_chunkKZCEPS4Jcjs.isObject.call(void 0, thing)) {
|
|
58
58
|
return {};
|
|
59
59
|
}
|
|
60
60
|
return thing;
|
|
@@ -133,7 +133,7 @@ function sampleFromSchema(schema, opts = {}) {
|
|
|
133
133
|
if (seenRefs.has(refToRelease)) {
|
|
134
134
|
return void 0;
|
|
135
135
|
}
|
|
136
|
-
objectifySchema =
|
|
136
|
+
objectifySchema = _chunkKZCEPS4Jcjs.dereferenceRef.call(void 0, objectifySchema, opts.definition, seenRefs);
|
|
137
137
|
if (!objectifySchema || _chunkYPR7YTHMcjs.isRef.call(void 0, objectifySchema)) {
|
|
138
138
|
return void 0;
|
|
139
139
|
}
|
|
@@ -261,6 +261,12 @@ var samples_default = memo;
|
|
|
261
261
|
// src/operation/lib/get-mediatype-examples.ts
|
|
262
262
|
function getMediaTypeExamples(mediaType, mediaTypeObject, definition, opts = {}) {
|
|
263
263
|
if (mediaTypeObject.example) {
|
|
264
|
+
if (_chunkYPR7YTHMcjs.isRef.call(void 0, mediaTypeObject.example)) {
|
|
265
|
+
mediaTypeObject.example = _chunkKZCEPS4Jcjs.dereferenceRef.call(void 0, mediaTypeObject.example, definition);
|
|
266
|
+
if (!mediaTypeObject.example || _chunkYPR7YTHMcjs.isRef.call(void 0, mediaTypeObject.example)) {
|
|
267
|
+
return [];
|
|
268
|
+
}
|
|
269
|
+
}
|
|
264
270
|
return [
|
|
265
271
|
{
|
|
266
272
|
value: mediaTypeObject.example
|
|
@@ -280,8 +286,11 @@ function getMediaTypeExamples(mediaType, mediaTypeObject, definition, opts = {})
|
|
|
280
286
|
description = example.description;
|
|
281
287
|
}
|
|
282
288
|
if ("value" in example) {
|
|
283
|
-
if (
|
|
284
|
-
|
|
289
|
+
if (_chunkYPR7YTHMcjs.isRef.call(void 0, example.value)) {
|
|
290
|
+
example.value = _chunkKZCEPS4Jcjs.dereferenceRef.call(void 0, example.value, definition);
|
|
291
|
+
if (!example.value || _chunkYPR7YTHMcjs.isRef.call(void 0, example.value)) {
|
|
292
|
+
return false;
|
|
293
|
+
}
|
|
285
294
|
}
|
|
286
295
|
example = example.value;
|
|
287
296
|
}
|
|
@@ -297,7 +306,7 @@ function getMediaTypeExamples(mediaType, mediaTypeObject, definition, opts = {})
|
|
|
297
306
|
}
|
|
298
307
|
}
|
|
299
308
|
if (mediaTypeObject.schema) {
|
|
300
|
-
if (!
|
|
309
|
+
if (!_chunkKZCEPS4Jcjs.matches_mimetype_default.xml(mediaType)) {
|
|
301
310
|
return [
|
|
302
311
|
{
|
|
303
312
|
value: samples_default(structuredClone(mediaTypeObject.schema), {
|
|
@@ -318,7 +327,7 @@ function getResponseExamples(operation, definition) {
|
|
|
318
327
|
let onlyHeaders = false;
|
|
319
328
|
if (!response) return false;
|
|
320
329
|
if (_chunkYPR7YTHMcjs.isRef.call(void 0, response)) {
|
|
321
|
-
response =
|
|
330
|
+
response = _chunkKZCEPS4Jcjs.dereferenceRef.call(void 0, response, definition);
|
|
322
331
|
if (!response || _chunkYPR7YTHMcjs.isRef.call(void 0, response)) return false;
|
|
323
332
|
}
|
|
324
333
|
const mediaTypes = {};
|
|
@@ -358,14 +367,14 @@ function getCallbackExamples(operation, definition) {
|
|
|
358
367
|
let callback = _optionalChain([operation, 'access', _16 => _16.callbacks, 'optionalAccess', _17 => _17[identifier]]);
|
|
359
368
|
if (!callback) return [];
|
|
360
369
|
if (_chunkYPR7YTHMcjs.isRef.call(void 0, callback)) {
|
|
361
|
-
callback =
|
|
370
|
+
callback = _chunkKZCEPS4Jcjs.dereferenceRef.call(void 0, callback, definition);
|
|
362
371
|
if (!callback || _chunkYPR7YTHMcjs.isRef.call(void 0, callback)) return [];
|
|
363
372
|
}
|
|
364
373
|
const items = Object.keys(callback).map((expression) => {
|
|
365
374
|
let callbackPath = callback[expression];
|
|
366
375
|
if (!callbackPath) return [];
|
|
367
376
|
if (_chunkYPR7YTHMcjs.isRef.call(void 0, callbackPath)) {
|
|
368
|
-
callbackPath =
|
|
377
|
+
callbackPath = _chunkKZCEPS4Jcjs.dereferenceRef.call(void 0, callbackPath, definition);
|
|
369
378
|
if (!callbackPath || _chunkYPR7YTHMcjs.isRef.call(void 0, callbackPath)) return [];
|
|
370
379
|
}
|
|
371
380
|
return Object.keys(callbackPath).map((method) => {
|
|
@@ -448,7 +457,7 @@ function getExampleGroups(operation) {
|
|
|
448
457
|
Object.entries(param.examples || {}).forEach(([exampleKey, paramExample]) => {
|
|
449
458
|
let example = paramExample;
|
|
450
459
|
if (_chunkYPR7YTHMcjs.isRef.call(void 0, example)) {
|
|
451
|
-
example =
|
|
460
|
+
example = _chunkKZCEPS4Jcjs.dereferenceRef.call(void 0, example, operation.api);
|
|
452
461
|
if (!example || _chunkYPR7YTHMcjs.isRef.call(void 0, example)) return;
|
|
453
462
|
}
|
|
454
463
|
groups[exampleKey] = {
|
|
@@ -496,7 +505,7 @@ function getRequestBodyExamples(operation, definition) {
|
|
|
496
505
|
if (!requestBody) {
|
|
497
506
|
return [];
|
|
498
507
|
} else if (_chunkYPR7YTHMcjs.isRef.call(void 0, requestBody)) {
|
|
499
|
-
requestBody =
|
|
508
|
+
requestBody = _chunkKZCEPS4Jcjs.dereferenceRef.call(void 0, requestBody, definition);
|
|
500
509
|
}
|
|
501
510
|
if (!requestBody || _chunkYPR7YTHMcjs.isRef.call(void 0, requestBody) || !requestBody.content) {
|
|
502
511
|
return [];
|
|
@@ -561,7 +570,7 @@ function getOperationId(path, method, operation, opts = {}) {
|
|
|
561
570
|
}
|
|
562
571
|
|
|
563
572
|
// src/operation/transformers/get-response-as-json-schema.ts
|
|
564
|
-
var isJSON =
|
|
573
|
+
var isJSON = _chunkKZCEPS4Jcjs.matches_mimetype_default.json;
|
|
565
574
|
function buildHeadersSchema(response, schemaOptions) {
|
|
566
575
|
const headersSchema = {
|
|
567
576
|
type: "object",
|
|
@@ -574,7 +583,7 @@ function buildHeadersSchema(response, schemaOptions) {
|
|
|
574
583
|
let headerEntry = _optionalChain([response, 'access', _44 => _44.headers, 'optionalAccess', _45 => _45[key]]);
|
|
575
584
|
if (!headerEntry) return;
|
|
576
585
|
if (_chunkYPR7YTHMcjs.isRef.call(void 0, headerEntry)) {
|
|
577
|
-
headerEntry =
|
|
586
|
+
headerEntry = _chunkKZCEPS4Jcjs.dereferenceRef.call(void 0, headerEntry, api, seenRefs);
|
|
578
587
|
if (!headerEntry || _chunkYPR7YTHMcjs.isRef.call(void 0, headerEntry)) return;
|
|
579
588
|
}
|
|
580
589
|
if (headerEntry.schema) {
|
|
@@ -582,10 +591,10 @@ function buildHeadersSchema(response, schemaOptions) {
|
|
|
582
591
|
let headerSchema = header.schema;
|
|
583
592
|
if (!headerSchema) return;
|
|
584
593
|
if (_chunkYPR7YTHMcjs.isRef.call(void 0, headerSchema)) {
|
|
585
|
-
headerSchema =
|
|
594
|
+
headerSchema = _chunkKZCEPS4Jcjs.dereferenceRef.call(void 0, headerSchema, api, seenRefs);
|
|
586
595
|
if (!headerSchema || _chunkYPR7YTHMcjs.isRef.call(void 0, headerSchema)) return;
|
|
587
596
|
}
|
|
588
|
-
headersSchema.properties[key] =
|
|
597
|
+
headersSchema.properties[key] = _chunkKZCEPS4Jcjs.toJSONSchema.call(void 0, _chunkKZCEPS4Jcjs.cloneObject.call(void 0, headerSchema), {
|
|
589
598
|
addEnumsToDescriptions: true,
|
|
590
599
|
...schemaOptions
|
|
591
600
|
});
|
|
@@ -639,32 +648,32 @@ function getResponseAsJSONSchema(operation, api, statusCode, opts) {
|
|
|
639
648
|
}
|
|
640
649
|
if (preferredContentType) {
|
|
641
650
|
if (contentTypes.includes(preferredContentType)) {
|
|
642
|
-
const schema2 =
|
|
651
|
+
const schema2 = _chunkKZCEPS4Jcjs.cloneObject.call(void 0, content[preferredContentType].schema);
|
|
643
652
|
if (!schema2) {
|
|
644
653
|
return null;
|
|
645
654
|
}
|
|
646
|
-
return
|
|
655
|
+
return _chunkKZCEPS4Jcjs.toJSONSchema.call(void 0, schema2, baseSchemaOptions);
|
|
647
656
|
}
|
|
648
657
|
return null;
|
|
649
658
|
}
|
|
650
659
|
for (let i = 0; i < contentTypes.length; i++) {
|
|
651
660
|
if (isJSON(contentTypes[i])) {
|
|
652
|
-
const schema2 =
|
|
661
|
+
const schema2 = _chunkKZCEPS4Jcjs.cloneObject.call(void 0, content[contentTypes[i]].schema);
|
|
653
662
|
if (!schema2) {
|
|
654
663
|
return {};
|
|
655
664
|
}
|
|
656
|
-
return
|
|
665
|
+
return _chunkKZCEPS4Jcjs.toJSONSchema.call(void 0, schema2, baseSchemaOptions);
|
|
657
666
|
}
|
|
658
667
|
}
|
|
659
668
|
const contentType = contentTypes.shift();
|
|
660
669
|
if (!contentType) {
|
|
661
670
|
return {};
|
|
662
671
|
}
|
|
663
|
-
const schema =
|
|
672
|
+
const schema = _chunkKZCEPS4Jcjs.cloneObject.call(void 0, content[contentType].schema);
|
|
664
673
|
if (!schema) {
|
|
665
674
|
return {};
|
|
666
675
|
}
|
|
667
|
-
return
|
|
676
|
+
return _chunkKZCEPS4Jcjs.toJSONSchema.call(void 0, schema, baseSchemaOptions);
|
|
668
677
|
}
|
|
669
678
|
const foundSchema = getPreferredSchema(response.content, _optionalChain([opts, 'optionalAccess', _46 => _46.contentType]));
|
|
670
679
|
if (_optionalChain([opts, 'optionalAccess', _47 => _47.contentType]) && !foundSchema) {
|
|
@@ -683,23 +692,23 @@ function getResponseAsJSONSchema(operation, api, statusCode, opts) {
|
|
|
683
692
|
// able to render so instead of generating a JSON Schema with an `undefined` type we should
|
|
684
693
|
// default to `string` so there's at least *something* the end-user can interact with.
|
|
685
694
|
type: _nullishCoalesce(schemaType, () => ( "string")),
|
|
686
|
-
schema:
|
|
695
|
+
schema: _chunkKZCEPS4Jcjs.isPrimitive.call(void 0, schema) ? schema : {
|
|
687
696
|
...schema,
|
|
688
|
-
$schema:
|
|
697
|
+
$schema: _chunkKZCEPS4Jcjs.getSchemaVersionString.call(void 0, schema, api)
|
|
689
698
|
},
|
|
690
699
|
label: "Response body"
|
|
691
700
|
};
|
|
692
701
|
if (response.description && schemaWrapper.schema) {
|
|
693
702
|
schemaWrapper.description = response.description;
|
|
694
703
|
}
|
|
695
|
-
|
|
704
|
+
_chunkKZCEPS4Jcjs.applyDiscriminatorOneOfToUsedSchemas.call(void 0, api, usedSchemas, (ref) => {
|
|
696
705
|
if (usedSchemas.has(ref)) {
|
|
697
706
|
return usedSchemas.get(ref);
|
|
698
707
|
}
|
|
699
708
|
try {
|
|
700
|
-
const resolved =
|
|
709
|
+
const resolved = _chunkKZCEPS4Jcjs.dereferenceRef.call(void 0, { $ref: ref }, api, seenRefs);
|
|
701
710
|
if (_chunkYPR7YTHMcjs.isRef.call(void 0, resolved)) return void 0;
|
|
702
|
-
const converted =
|
|
711
|
+
const converted = _chunkKZCEPS4Jcjs.toJSONSchema.call(void 0, structuredClone(resolved), {
|
|
703
712
|
...baseSchemaOptions,
|
|
704
713
|
seenRefs
|
|
705
714
|
});
|
|
@@ -711,9 +720,9 @@ function getResponseAsJSONSchema(operation, api, statusCode, opts) {
|
|
|
711
720
|
});
|
|
712
721
|
if (schemaWrapper.schema && usedSchemas.size > 0) {
|
|
713
722
|
const refsInGroup = _nullishCoalesce(refsByGroup.get("body"), () => ( /* @__PURE__ */ new Set()));
|
|
714
|
-
const referencedSchemas =
|
|
723
|
+
const referencedSchemas = _chunkKZCEPS4Jcjs.filterRequiredRefsToReferenced.call(void 0, refsInGroup, usedSchemas);
|
|
715
724
|
if (referencedSchemas.size > 0) {
|
|
716
|
-
|
|
725
|
+
_chunkKZCEPS4Jcjs.mergeReferencedSchemasIntoRoot.call(void 0, schemaWrapper.schema, referencedSchemas);
|
|
717
726
|
}
|
|
718
727
|
}
|
|
719
728
|
jsonSchema.push(schemaWrapper);
|
|
@@ -725,9 +734,9 @@ function getResponseAsJSONSchema(operation, api, statusCode, opts) {
|
|
|
725
734
|
});
|
|
726
735
|
if (headersWrapper.schema && usedSchemas.size > 0) {
|
|
727
736
|
const refsInGroup = _nullishCoalesce(refsByGroup.get("headers"), () => ( /* @__PURE__ */ new Set()));
|
|
728
|
-
const referencedSchemas =
|
|
737
|
+
const referencedSchemas = _chunkKZCEPS4Jcjs.filterRequiredRefsToReferenced.call(void 0, refsInGroup, usedSchemas);
|
|
729
738
|
if (referencedSchemas.size > 0) {
|
|
730
|
-
|
|
739
|
+
_chunkKZCEPS4Jcjs.mergeReferencedSchemasIntoRoot.call(void 0, headersWrapper.schema, referencedSchemas);
|
|
731
740
|
}
|
|
732
741
|
}
|
|
733
742
|
jsonSchema.push(headersWrapper);
|
|
@@ -867,7 +876,7 @@ var Operation = (_class = class {
|
|
|
867
876
|
let types = [];
|
|
868
877
|
if (this.schema.requestBody) {
|
|
869
878
|
if (_chunkYPR7YTHMcjs.isRef.call(void 0, this.schema.requestBody)) {
|
|
870
|
-
this.schema.requestBody =
|
|
879
|
+
this.schema.requestBody = _chunkKZCEPS4Jcjs.dereferenceRef.call(void 0, this.schema.requestBody, this.api);
|
|
871
880
|
}
|
|
872
881
|
if (this.schema.requestBody && "content" in this.schema.requestBody) {
|
|
873
882
|
types = Object.keys(this.schema.requestBody.content);
|
|
@@ -878,7 +887,7 @@ var Operation = (_class = class {
|
|
|
878
887
|
this.contentType = types[0];
|
|
879
888
|
}
|
|
880
889
|
types.forEach((t) => {
|
|
881
|
-
if (
|
|
890
|
+
if (_chunkKZCEPS4Jcjs.matches_mimetype_default.json(t)) {
|
|
882
891
|
this.contentType = t;
|
|
883
892
|
}
|
|
884
893
|
});
|
|
@@ -891,7 +900,7 @@ var Operation = (_class = class {
|
|
|
891
900
|
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.2.md#user-content-request-body-content}
|
|
892
901
|
*/
|
|
893
902
|
isFormUrlEncoded() {
|
|
894
|
-
return
|
|
903
|
+
return _chunkKZCEPS4Jcjs.matches_mimetype_default.formUrlEncoded(this.getContentType());
|
|
895
904
|
}
|
|
896
905
|
/**
|
|
897
906
|
* Checks if the current operation has a mutipart content type payload.
|
|
@@ -900,7 +909,7 @@ var Operation = (_class = class {
|
|
|
900
909
|
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.2.md#user-content-request-body-content}
|
|
901
910
|
*/
|
|
902
911
|
isMultipart() {
|
|
903
|
-
return
|
|
912
|
+
return _chunkKZCEPS4Jcjs.matches_mimetype_default.multipart(this.getContentType());
|
|
904
913
|
}
|
|
905
914
|
/**
|
|
906
915
|
* Checks if the current operation has a JSON-like content type payload.
|
|
@@ -909,7 +918,7 @@ var Operation = (_class = class {
|
|
|
909
918
|
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.2.md#user-content-request-body-content}
|
|
910
919
|
*/
|
|
911
920
|
isJson() {
|
|
912
|
-
return
|
|
921
|
+
return _chunkKZCEPS4Jcjs.matches_mimetype_default.json(this.getContentType());
|
|
913
922
|
}
|
|
914
923
|
/**
|
|
915
924
|
* Checks if the current operation has an XML content type payload.
|
|
@@ -918,7 +927,7 @@ var Operation = (_class = class {
|
|
|
918
927
|
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.2.md#user-content-request-body-content}
|
|
919
928
|
*/
|
|
920
929
|
isXml() {
|
|
921
|
-
return
|
|
930
|
+
return _chunkKZCEPS4Jcjs.matches_mimetype_default.xml(this.getContentType());
|
|
922
931
|
}
|
|
923
932
|
/**
|
|
924
933
|
* Checks if the current operation is a webhook or not.
|
|
@@ -966,7 +975,7 @@ var Operation = (_class = class {
|
|
|
966
975
|
security = _optionalChain([this, 'access', _64 => _64.api, 'optionalAccess', _65 => _65.components, 'optionalAccess', _66 => _66.securitySchemes, 'optionalAccess', _67 => _67[key]]);
|
|
967
976
|
if (!security) return false;
|
|
968
977
|
if (_chunkYPR7YTHMcjs.isRef.call(void 0, security)) {
|
|
969
|
-
security =
|
|
978
|
+
security = _chunkKZCEPS4Jcjs.dereferenceRef.call(void 0, security, this.api);
|
|
970
979
|
if (!security || _chunkYPR7YTHMcjs.isRef.call(void 0, security)) return false;
|
|
971
980
|
}
|
|
972
981
|
} catch (e4) {
|
|
@@ -1047,7 +1056,7 @@ var Operation = (_class = class {
|
|
|
1047
1056
|
this.schema.parameters.map((p) => {
|
|
1048
1057
|
let param = p;
|
|
1049
1058
|
if (_chunkYPR7YTHMcjs.isRef.call(void 0, param)) {
|
|
1050
|
-
param =
|
|
1059
|
+
param = _chunkKZCEPS4Jcjs.dereferenceRef.call(void 0, param, this.api);
|
|
1051
1060
|
if (!param || _chunkYPR7YTHMcjs.isRef.call(void 0, param)) return void 0;
|
|
1052
1061
|
}
|
|
1053
1062
|
if (param.in && param.in === "header") return param.name;
|
|
@@ -1060,7 +1069,7 @@ var Operation = (_class = class {
|
|
|
1060
1069
|
let response = this.schema.responses[r];
|
|
1061
1070
|
if (!response) return [];
|
|
1062
1071
|
if (_chunkYPR7YTHMcjs.isRef.call(void 0, response)) {
|
|
1063
|
-
this.schema.responses[r] =
|
|
1072
|
+
this.schema.responses[r] = _chunkKZCEPS4Jcjs.dereferenceRef.call(void 0, response, this.api);
|
|
1064
1073
|
response = this.schema.responses[r];
|
|
1065
1074
|
if (!response || _chunkYPR7YTHMcjs.isRef.call(void 0, response)) {
|
|
1066
1075
|
return [];
|
|
@@ -1073,7 +1082,7 @@ var Operation = (_class = class {
|
|
|
1073
1082
|
let requestBody = this.schema.requestBody;
|
|
1074
1083
|
if (requestBody) {
|
|
1075
1084
|
if (_chunkYPR7YTHMcjs.isRef.call(void 0, requestBody)) {
|
|
1076
|
-
this.schema.requestBody =
|
|
1085
|
+
this.schema.requestBody = _chunkKZCEPS4Jcjs.dereferenceRef.call(void 0, requestBody, this.api);
|
|
1077
1086
|
requestBody = this.schema.requestBody;
|
|
1078
1087
|
}
|
|
1079
1088
|
if (requestBody && !_chunkYPR7YTHMcjs.isRef.call(void 0, requestBody) && "content" in requestBody && Object.keys(requestBody.content)) {
|
|
@@ -1086,7 +1095,7 @@ var Operation = (_class = class {
|
|
|
1086
1095
|
let response = _optionalChain([this, 'access', _71 => _71.schema, 'access', _72 => _72.responses, 'optionalAccess', _73 => _73[r]]);
|
|
1087
1096
|
if (!response) return false;
|
|
1088
1097
|
if (_chunkYPR7YTHMcjs.isRef.call(void 0, response)) {
|
|
1089
|
-
this.schema.responses[r] =
|
|
1098
|
+
this.schema.responses[r] = _chunkKZCEPS4Jcjs.dereferenceRef.call(void 0, response, this.api);
|
|
1090
1099
|
response = this.schema.responses[r];
|
|
1091
1100
|
if (!response || _chunkYPR7YTHMcjs.isRef.call(void 0, response)) {
|
|
1092
1101
|
return false;
|
|
@@ -1196,7 +1205,7 @@ var Operation = (_class = class {
|
|
|
1196
1205
|
let parameters = (_optionalChain([this, 'access', _76 => _76.schema, 'optionalAccess', _77 => _77.parameters]) || []).map((p) => {
|
|
1197
1206
|
let param = p;
|
|
1198
1207
|
if (_chunkYPR7YTHMcjs.isRef.call(void 0, param)) {
|
|
1199
|
-
param =
|
|
1208
|
+
param = _chunkKZCEPS4Jcjs.dereferenceRef.call(void 0, param, this.api);
|
|
1200
1209
|
if (!param || _chunkYPR7YTHMcjs.isRef.call(void 0, param)) return void 0;
|
|
1201
1210
|
}
|
|
1202
1211
|
return param;
|
|
@@ -1204,7 +1213,7 @@ var Operation = (_class = class {
|
|
|
1204
1213
|
const commonParams = (_optionalChain([this, 'access', _78 => _78.api, 'optionalAccess', _79 => _79.paths, 'optionalAccess', _80 => _80[this.path], 'optionalAccess', _81 => _81.parameters]) || []).map((p) => {
|
|
1205
1214
|
let param = p;
|
|
1206
1215
|
if (_chunkYPR7YTHMcjs.isRef.call(void 0, param)) {
|
|
1207
|
-
param =
|
|
1216
|
+
param = _chunkKZCEPS4Jcjs.dereferenceRef.call(void 0, param, this.api);
|
|
1208
1217
|
if (!param || _chunkYPR7YTHMcjs.isRef.call(void 0, param)) return void 0;
|
|
1209
1218
|
}
|
|
1210
1219
|
return param;
|
|
@@ -1242,10 +1251,10 @@ var Operation = (_class = class {
|
|
|
1242
1251
|
);
|
|
1243
1252
|
}
|
|
1244
1253
|
if (!this.schemasDecorated) {
|
|
1245
|
-
|
|
1254
|
+
_chunkKZCEPS4Jcjs.decorateComponentSchemasWithRefName.call(void 0, this.api);
|
|
1246
1255
|
this.schemasDecorated = true;
|
|
1247
1256
|
}
|
|
1248
|
-
return
|
|
1257
|
+
return _chunkKZCEPS4Jcjs.getParametersAsJSONSchema.call(void 0, this, this.api, {
|
|
1249
1258
|
includeDiscriminatorMappingRefs: true,
|
|
1250
1259
|
...opts
|
|
1251
1260
|
});
|
|
@@ -1270,7 +1279,7 @@ var Operation = (_class = class {
|
|
|
1270
1279
|
);
|
|
1271
1280
|
}
|
|
1272
1281
|
if (!this.schemasDecorated) {
|
|
1273
|
-
|
|
1282
|
+
_chunkKZCEPS4Jcjs.decorateComponentSchemasWithRefName.call(void 0, this.api);
|
|
1274
1283
|
this.schemasDecorated = true;
|
|
1275
1284
|
}
|
|
1276
1285
|
return getResponseAsJSONSchema(this, this.api, statusCode, {
|
|
@@ -1283,7 +1292,20 @@ var Operation = (_class = class {
|
|
|
1283
1292
|
*
|
|
1284
1293
|
*/
|
|
1285
1294
|
getResponseStatusCodes() {
|
|
1286
|
-
|
|
1295
|
+
if (!this.schema.responses) return [];
|
|
1296
|
+
if (_chunkYPR7YTHMcjs.isRef.call(void 0, this.schema.responses)) {
|
|
1297
|
+
this.schema.responses = _chunkKZCEPS4Jcjs.dereferenceRef.call(void 0, this.schema.responses, this.api);
|
|
1298
|
+
if (!this.schema.responses || _chunkYPR7YTHMcjs.isRef.call(void 0, this.schema.responses)) {
|
|
1299
|
+
return [];
|
|
1300
|
+
}
|
|
1301
|
+
}
|
|
1302
|
+
return Object.keys(this.schema.responses).filter((key) => {
|
|
1303
|
+
if (key.startsWith("x-")) {
|
|
1304
|
+
return false;
|
|
1305
|
+
}
|
|
1306
|
+
const response = _optionalChain([this, 'access', _82 => _82.schema, 'access', _83 => _83.responses, 'optionalAccess', _84 => _84[key]]);
|
|
1307
|
+
return response && typeof response === "object";
|
|
1308
|
+
});
|
|
1287
1309
|
}
|
|
1288
1310
|
/**
|
|
1289
1311
|
* Retrieve an array of all content types that this operation can return.
|
|
@@ -1298,7 +1320,7 @@ var Operation = (_class = class {
|
|
|
1298
1320
|
let resp = response;
|
|
1299
1321
|
if (!resp) return;
|
|
1300
1322
|
if (_chunkYPR7YTHMcjs.isRef.call(void 0, resp)) {
|
|
1301
|
-
resp =
|
|
1323
|
+
resp = _chunkKZCEPS4Jcjs.dereferenceRef.call(void 0, resp, this.api);
|
|
1302
1324
|
if (!resp || _chunkYPR7YTHMcjs.isRef.call(void 0, resp)) {
|
|
1303
1325
|
return;
|
|
1304
1326
|
}
|
|
@@ -1327,7 +1349,7 @@ var Operation = (_class = class {
|
|
|
1327
1349
|
let requestBody = this.schema.requestBody;
|
|
1328
1350
|
if (!requestBody) return false;
|
|
1329
1351
|
if (_chunkYPR7YTHMcjs.isRef.call(void 0, requestBody)) {
|
|
1330
|
-
this.schema.requestBody =
|
|
1352
|
+
this.schema.requestBody = _chunkKZCEPS4Jcjs.dereferenceRef.call(void 0, requestBody, this.api);
|
|
1331
1353
|
requestBody = this.schema.requestBody;
|
|
1332
1354
|
if (!requestBody || _chunkYPR7YTHMcjs.isRef.call(void 0, requestBody)) {
|
|
1333
1355
|
return false;
|
|
@@ -1397,7 +1419,7 @@ var Operation = (_class = class {
|
|
|
1397
1419
|
let availableMediaType;
|
|
1398
1420
|
const mediaTypes = this.getRequestBodyMediaTypes();
|
|
1399
1421
|
mediaTypes.forEach((mt) => {
|
|
1400
|
-
if (!availableMediaType &&
|
|
1422
|
+
if (!availableMediaType && _chunkKZCEPS4Jcjs.matches_mimetype_default.json(mt)) {
|
|
1401
1423
|
availableMediaType = mt;
|
|
1402
1424
|
}
|
|
1403
1425
|
});
|
|
@@ -1424,7 +1446,7 @@ var Operation = (_class = class {
|
|
|
1424
1446
|
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.2.md#request-body-examples}
|
|
1425
1447
|
*/
|
|
1426
1448
|
getRequestBodyExamples() {
|
|
1427
|
-
const isRequestExampleValueDefined = typeof _optionalChain([this, 'access',
|
|
1449
|
+
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";
|
|
1428
1450
|
if (this.requestBodyExamples && isRequestExampleValueDefined) {
|
|
1429
1451
|
return this.requestBodyExamples;
|
|
1430
1452
|
}
|
|
@@ -1445,7 +1467,7 @@ var Operation = (_class = class {
|
|
|
1445
1467
|
let response = this.schema.responses[statusCode];
|
|
1446
1468
|
if (!response) return false;
|
|
1447
1469
|
if (_chunkYPR7YTHMcjs.isRef.call(void 0, response)) {
|
|
1448
|
-
this.schema.responses[statusCode] =
|
|
1470
|
+
this.schema.responses[statusCode] = _chunkKZCEPS4Jcjs.dereferenceRef.call(void 0, response, this.api);
|
|
1449
1471
|
response = this.schema.responses[statusCode];
|
|
1450
1472
|
if (!response || _chunkYPR7YTHMcjs.isRef.call(void 0, response)) {
|
|
1451
1473
|
return false;
|
|
@@ -1489,7 +1511,7 @@ var Operation = (_class = class {
|
|
|
1489
1511
|
let callbackObj = this.schema.callbacks[identifier];
|
|
1490
1512
|
if (!callbackObj) return false;
|
|
1491
1513
|
if (_chunkYPR7YTHMcjs.isRef.call(void 0, callbackObj)) {
|
|
1492
|
-
this.schema.callbacks[identifier] =
|
|
1514
|
+
this.schema.callbacks[identifier] = _chunkKZCEPS4Jcjs.dereferenceRef.call(void 0, callbackObj, this.api);
|
|
1493
1515
|
callbackObj = this.schema.callbacks[identifier];
|
|
1494
1516
|
if (!callbackObj || _chunkYPR7YTHMcjs.isRef.call(void 0, callbackObj)) {
|
|
1495
1517
|
return false;
|
|
@@ -1498,7 +1520,7 @@ var Operation = (_class = class {
|
|
|
1498
1520
|
let callback = callbackObj[expression];
|
|
1499
1521
|
if (!callback) return false;
|
|
1500
1522
|
if (_chunkYPR7YTHMcjs.isRef.call(void 0, callback)) {
|
|
1501
|
-
callbackObj[expression] =
|
|
1523
|
+
callbackObj[expression] = _chunkKZCEPS4Jcjs.dereferenceRef.call(void 0, callback, this.api);
|
|
1502
1524
|
callback = callbackObj[expression];
|
|
1503
1525
|
if (!callback || _chunkYPR7YTHMcjs.isRef.call(void 0, callback)) {
|
|
1504
1526
|
return false;
|
|
@@ -1519,10 +1541,10 @@ var Operation = (_class = class {
|
|
|
1519
1541
|
if (!this.hasCallbacks()) return [];
|
|
1520
1542
|
const callbacks = [];
|
|
1521
1543
|
Object.keys(this.schema.callbacks).forEach((callback) => {
|
|
1522
|
-
let cb = _optionalChain([this, 'access',
|
|
1544
|
+
let cb = _optionalChain([this, 'access', _90 => _90.schema, 'access', _91 => _91.callbacks, 'optionalAccess', _92 => _92[callback]]);
|
|
1523
1545
|
if (!cb) return;
|
|
1524
1546
|
if (_chunkYPR7YTHMcjs.isRef.call(void 0, cb)) {
|
|
1525
|
-
this.schema.callbacks[callback] =
|
|
1547
|
+
this.schema.callbacks[callback] = _chunkKZCEPS4Jcjs.dereferenceRef.call(void 0, cb, this.api);
|
|
1526
1548
|
cb = this.schema.callbacks[callback];
|
|
1527
1549
|
if (!cb || _chunkYPR7YTHMcjs.isRef.call(void 0, cb)) {
|
|
1528
1550
|
return;
|
|
@@ -1532,14 +1554,14 @@ var Operation = (_class = class {
|
|
|
1532
1554
|
let callbackPath = cb[expression];
|
|
1533
1555
|
if (!callbackPath) return;
|
|
1534
1556
|
if (_chunkYPR7YTHMcjs.isRef.call(void 0, callbackPath)) {
|
|
1535
|
-
cb[expression] =
|
|
1557
|
+
cb[expression] = _chunkKZCEPS4Jcjs.dereferenceRef.call(void 0, callbackPath, this.api);
|
|
1536
1558
|
callbackPath = cb[expression];
|
|
1537
1559
|
if (!callbackPath || _chunkYPR7YTHMcjs.isRef.call(void 0, callbackPath)) {
|
|
1538
1560
|
return;
|
|
1539
1561
|
}
|
|
1540
1562
|
}
|
|
1541
1563
|
Object.keys(callbackPath).forEach((method) => {
|
|
1542
|
-
if (!
|
|
1564
|
+
if (!_chunkKZCEPS4Jcjs.supportedMethods.includes(method)) return;
|
|
1543
1565
|
const found = this.getCallback(callback, expression, method);
|
|
1544
1566
|
if (found) {
|
|
1545
1567
|
callbacks.push(found);
|
|
@@ -1582,7 +1604,7 @@ var Operation = (_class = class {
|
|
|
1582
1604
|
* @deprecated Use `oas.getExtension(extension, operation)` instead.
|
|
1583
1605
|
*/
|
|
1584
1606
|
getExtension(extension) {
|
|
1585
|
-
return _optionalChain([this, 'access',
|
|
1607
|
+
return _optionalChain([this, 'access', _93 => _93.schema, 'optionalAccess', _94 => _94[extension]]);
|
|
1586
1608
|
}
|
|
1587
1609
|
/**
|
|
1588
1610
|
* Returns an object with groups of all example definitions (body/header/query/path/response/etc.).
|
|
@@ -1617,12 +1639,12 @@ var Operation = (_class = class {
|
|
|
1617
1639
|
}
|
|
1618
1640
|
this.dereferencing.processing = true;
|
|
1619
1641
|
if (!this.schemasDecorated) {
|
|
1620
|
-
|
|
1642
|
+
_chunkKZCEPS4Jcjs.decorateComponentSchemasWithRefName.call(void 0, this.api);
|
|
1621
1643
|
this.schemasDecorated = true;
|
|
1622
1644
|
}
|
|
1623
1645
|
const { api, schema, promises } = this;
|
|
1624
1646
|
const circularRefs = /* @__PURE__ */ new Set();
|
|
1625
|
-
const dereferencingOptions =
|
|
1647
|
+
const dereferencingOptions = _chunkKZCEPS4Jcjs.getDereferencingOptions.call(void 0, circularRefs);
|
|
1626
1648
|
const parser = new (0, _jsonschemarefparser.$RefParser)();
|
|
1627
1649
|
return parser.dereference(
|
|
1628
1650
|
"#/__INTERNAL__",
|
|
@@ -1669,7 +1691,7 @@ var Operation = (_class = class {
|
|
|
1669
1691
|
// We need to convert our `Set` to an array in order to match the typings.
|
|
1670
1692
|
circularRefs: [...circularRefs]
|
|
1671
1693
|
};
|
|
1672
|
-
if (_optionalChain([opts, 'optionalAccess',
|
|
1694
|
+
if (_optionalChain([opts, 'optionalAccess', _95 => _95.cb])) {
|
|
1673
1695
|
opts.cb();
|
|
1674
1696
|
}
|
|
1675
1697
|
}).then(() => {
|
|
@@ -1733,7 +1755,7 @@ var Callback = class extends Operation {
|
|
|
1733
1755
|
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.2.md#user-content-operation-summary}
|
|
1734
1756
|
*/
|
|
1735
1757
|
getSummary() {
|
|
1736
|
-
if (_optionalChain([this, 'access',
|
|
1758
|
+
if (_optionalChain([this, 'access', _96 => _96.schema, 'optionalAccess', _97 => _97.summary]) && typeof this.schema.summary === "string") {
|
|
1737
1759
|
return this.schema.summary;
|
|
1738
1760
|
} else if (this.parentSchema.summary && typeof this.parentSchema.summary === "string") {
|
|
1739
1761
|
return this.parentSchema.summary;
|
|
@@ -1747,7 +1769,7 @@ var Callback = class extends Operation {
|
|
|
1747
1769
|
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.2.md#user-content-operation-description}
|
|
1748
1770
|
*/
|
|
1749
1771
|
getDescription() {
|
|
1750
|
-
if (_optionalChain([this, 'access',
|
|
1772
|
+
if (_optionalChain([this, 'access', _98 => _98.schema, 'optionalAccess', _99 => _99.description]) && typeof this.schema.description === "string") {
|
|
1751
1773
|
return this.schema.description;
|
|
1752
1774
|
} else if (this.parentSchema.description && typeof this.parentSchema.description === "string") {
|
|
1753
1775
|
return this.parentSchema.description;
|
|
@@ -1761,10 +1783,10 @@ var Callback = class extends Operation {
|
|
|
1761
1783
|
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.2.md#user-content-operation-parameters}
|
|
1762
1784
|
*/
|
|
1763
1785
|
getParameters() {
|
|
1764
|
-
let parameters = (_optionalChain([this, 'access',
|
|
1786
|
+
let parameters = (_optionalChain([this, 'access', _100 => _100.schema, 'optionalAccess', _101 => _101.parameters]) || []).map((p) => {
|
|
1765
1787
|
let param = p;
|
|
1766
1788
|
if (_chunkYPR7YTHMcjs.isRef.call(void 0, param)) {
|
|
1767
|
-
param =
|
|
1789
|
+
param = _chunkKZCEPS4Jcjs.dereferenceRef.call(void 0, param, this.api);
|
|
1768
1790
|
if (!param || _chunkYPR7YTHMcjs.isRef.call(void 0, param)) return void 0;
|
|
1769
1791
|
}
|
|
1770
1792
|
return param;
|
|
@@ -1772,7 +1794,7 @@ var Callback = class extends Operation {
|
|
|
1772
1794
|
const commonParams = (this.parentSchema.parameters || []).map((p) => {
|
|
1773
1795
|
let param = p;
|
|
1774
1796
|
if (_chunkYPR7YTHMcjs.isRef.call(void 0, param)) {
|
|
1775
|
-
param =
|
|
1797
|
+
param = _chunkKZCEPS4Jcjs.dereferenceRef.call(void 0, param, this.api);
|
|
1776
1798
|
if (!param || _chunkYPR7YTHMcjs.isRef.call(void 0, param)) return void 0;
|
|
1777
1799
|
}
|
|
1778
1800
|
return param;
|
|
@@ -1791,17 +1813,17 @@ var Webhook = class extends Operation {
|
|
|
1791
1813
|
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.2.md#user-content-operation-summary}
|
|
1792
1814
|
*/
|
|
1793
1815
|
getSummary() {
|
|
1794
|
-
if (_optionalChain([this, 'access',
|
|
1816
|
+
if (_optionalChain([this, 'access', _102 => _102.schema, 'optionalAccess', _103 => _103.summary]) && typeof this.schema.summary === "string") {
|
|
1795
1817
|
return this.schema.summary;
|
|
1796
1818
|
} else if (!this.api.webhooks) {
|
|
1797
1819
|
return void 0;
|
|
1798
1820
|
}
|
|
1799
1821
|
let webhookPath = this.api.webhooks[this.path];
|
|
1800
1822
|
if (_chunkYPR7YTHMcjs.isRef.call(void 0, webhookPath)) {
|
|
1801
|
-
this.api.webhooks[this.path] =
|
|
1823
|
+
this.api.webhooks[this.path] = _chunkKZCEPS4Jcjs.dereferenceRef.call(void 0, webhookPath, this.api);
|
|
1802
1824
|
webhookPath = this.api.webhooks[this.path];
|
|
1803
1825
|
}
|
|
1804
|
-
return _optionalChain([webhookPath, 'optionalAccess',
|
|
1826
|
+
return _optionalChain([webhookPath, 'optionalAccess', _104 => _104.summary]);
|
|
1805
1827
|
}
|
|
1806
1828
|
/**
|
|
1807
1829
|
* Retrieve the `description` for this operation.
|
|
@@ -1810,17 +1832,17 @@ var Webhook = class extends Operation {
|
|
|
1810
1832
|
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.2.md#user-content-operation-description}
|
|
1811
1833
|
*/
|
|
1812
1834
|
getDescription() {
|
|
1813
|
-
if (_optionalChain([this, 'access',
|
|
1835
|
+
if (_optionalChain([this, 'access', _105 => _105.schema, 'optionalAccess', _106 => _106.description]) && typeof this.schema.description === "string") {
|
|
1814
1836
|
return this.schema.description;
|
|
1815
1837
|
} else if (!this.api.webhooks) {
|
|
1816
1838
|
return void 0;
|
|
1817
1839
|
}
|
|
1818
1840
|
let webhookPath = this.api.webhooks[this.path];
|
|
1819
1841
|
if (_chunkYPR7YTHMcjs.isRef.call(void 0, webhookPath)) {
|
|
1820
|
-
this.api.webhooks[this.path] =
|
|
1842
|
+
this.api.webhooks[this.path] = _chunkKZCEPS4Jcjs.dereferenceRef.call(void 0, webhookPath, this.api);
|
|
1821
1843
|
webhookPath = this.api.webhooks[this.path];
|
|
1822
1844
|
}
|
|
1823
|
-
return _optionalChain([webhookPath, 'optionalAccess',
|
|
1845
|
+
return _optionalChain([webhookPath, 'optionalAccess', _107 => _107.description]);
|
|
1824
1846
|
}
|
|
1825
1847
|
};
|
|
1826
1848
|
|
|
@@ -1841,4 +1863,4 @@ exports.Operation = Operation; exports.Callback = Callback; exports.Webhook = We
|
|
|
1841
1863
|
* @license Apache-2.0
|
|
1842
1864
|
* @see {@link https://github.com/swagger-api/swagger-ui/blob/master/src/core/plugins/samples/fn.js}
|
|
1843
1865
|
*/
|
|
1844
|
-
//# sourceMappingURL=chunk-
|
|
1866
|
+
//# sourceMappingURL=chunk-SM47EGII.cjs.map
|