oas 32.1.7 → 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-XRT2L32X.cjs → chunk-7AHI3P7Q.cjs} +19 -19
- package/dist/{chunk-XRT2L32X.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-KW4FVGCF.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-AIIJPBJJ.js → chunk-MQX2OLEW.js} +13 -4
- package/dist/chunk-MQX2OLEW.js.map +1 -0
- package/dist/{chunk-SEIG2ZZR.cjs → chunk-SM47EGII.cjs} +72 -63
- 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-AIIJPBJJ.js.map +0 -1
- package/dist/chunk-CH3OYPVG.js.map +0 -1
- package/dist/chunk-SEIG2ZZR.cjs.map +0 -1
- /package/dist/{chunk-KW4FVGCF.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, {
|
|
@@ -1285,7 +1294,7 @@ var Operation = (_class = class {
|
|
|
1285
1294
|
getResponseStatusCodes() {
|
|
1286
1295
|
if (!this.schema.responses) return [];
|
|
1287
1296
|
if (_chunkYPR7YTHMcjs.isRef.call(void 0, this.schema.responses)) {
|
|
1288
|
-
this.schema.responses =
|
|
1297
|
+
this.schema.responses = _chunkKZCEPS4Jcjs.dereferenceRef.call(void 0, this.schema.responses, this.api);
|
|
1289
1298
|
if (!this.schema.responses || _chunkYPR7YTHMcjs.isRef.call(void 0, this.schema.responses)) {
|
|
1290
1299
|
return [];
|
|
1291
1300
|
}
|
|
@@ -1311,7 +1320,7 @@ var Operation = (_class = class {
|
|
|
1311
1320
|
let resp = response;
|
|
1312
1321
|
if (!resp) return;
|
|
1313
1322
|
if (_chunkYPR7YTHMcjs.isRef.call(void 0, resp)) {
|
|
1314
|
-
resp =
|
|
1323
|
+
resp = _chunkKZCEPS4Jcjs.dereferenceRef.call(void 0, resp, this.api);
|
|
1315
1324
|
if (!resp || _chunkYPR7YTHMcjs.isRef.call(void 0, resp)) {
|
|
1316
1325
|
return;
|
|
1317
1326
|
}
|
|
@@ -1340,7 +1349,7 @@ var Operation = (_class = class {
|
|
|
1340
1349
|
let requestBody = this.schema.requestBody;
|
|
1341
1350
|
if (!requestBody) return false;
|
|
1342
1351
|
if (_chunkYPR7YTHMcjs.isRef.call(void 0, requestBody)) {
|
|
1343
|
-
this.schema.requestBody =
|
|
1352
|
+
this.schema.requestBody = _chunkKZCEPS4Jcjs.dereferenceRef.call(void 0, requestBody, this.api);
|
|
1344
1353
|
requestBody = this.schema.requestBody;
|
|
1345
1354
|
if (!requestBody || _chunkYPR7YTHMcjs.isRef.call(void 0, requestBody)) {
|
|
1346
1355
|
return false;
|
|
@@ -1410,7 +1419,7 @@ var Operation = (_class = class {
|
|
|
1410
1419
|
let availableMediaType;
|
|
1411
1420
|
const mediaTypes = this.getRequestBodyMediaTypes();
|
|
1412
1421
|
mediaTypes.forEach((mt) => {
|
|
1413
|
-
if (!availableMediaType &&
|
|
1422
|
+
if (!availableMediaType && _chunkKZCEPS4Jcjs.matches_mimetype_default.json(mt)) {
|
|
1414
1423
|
availableMediaType = mt;
|
|
1415
1424
|
}
|
|
1416
1425
|
});
|
|
@@ -1458,7 +1467,7 @@ var Operation = (_class = class {
|
|
|
1458
1467
|
let response = this.schema.responses[statusCode];
|
|
1459
1468
|
if (!response) return false;
|
|
1460
1469
|
if (_chunkYPR7YTHMcjs.isRef.call(void 0, response)) {
|
|
1461
|
-
this.schema.responses[statusCode] =
|
|
1470
|
+
this.schema.responses[statusCode] = _chunkKZCEPS4Jcjs.dereferenceRef.call(void 0, response, this.api);
|
|
1462
1471
|
response = this.schema.responses[statusCode];
|
|
1463
1472
|
if (!response || _chunkYPR7YTHMcjs.isRef.call(void 0, response)) {
|
|
1464
1473
|
return false;
|
|
@@ -1502,7 +1511,7 @@ var Operation = (_class = class {
|
|
|
1502
1511
|
let callbackObj = this.schema.callbacks[identifier];
|
|
1503
1512
|
if (!callbackObj) return false;
|
|
1504
1513
|
if (_chunkYPR7YTHMcjs.isRef.call(void 0, callbackObj)) {
|
|
1505
|
-
this.schema.callbacks[identifier] =
|
|
1514
|
+
this.schema.callbacks[identifier] = _chunkKZCEPS4Jcjs.dereferenceRef.call(void 0, callbackObj, this.api);
|
|
1506
1515
|
callbackObj = this.schema.callbacks[identifier];
|
|
1507
1516
|
if (!callbackObj || _chunkYPR7YTHMcjs.isRef.call(void 0, callbackObj)) {
|
|
1508
1517
|
return false;
|
|
@@ -1511,7 +1520,7 @@ var Operation = (_class = class {
|
|
|
1511
1520
|
let callback = callbackObj[expression];
|
|
1512
1521
|
if (!callback) return false;
|
|
1513
1522
|
if (_chunkYPR7YTHMcjs.isRef.call(void 0, callback)) {
|
|
1514
|
-
callbackObj[expression] =
|
|
1523
|
+
callbackObj[expression] = _chunkKZCEPS4Jcjs.dereferenceRef.call(void 0, callback, this.api);
|
|
1515
1524
|
callback = callbackObj[expression];
|
|
1516
1525
|
if (!callback || _chunkYPR7YTHMcjs.isRef.call(void 0, callback)) {
|
|
1517
1526
|
return false;
|
|
@@ -1535,7 +1544,7 @@ var Operation = (_class = class {
|
|
|
1535
1544
|
let cb = _optionalChain([this, 'access', _90 => _90.schema, 'access', _91 => _91.callbacks, 'optionalAccess', _92 => _92[callback]]);
|
|
1536
1545
|
if (!cb) return;
|
|
1537
1546
|
if (_chunkYPR7YTHMcjs.isRef.call(void 0, cb)) {
|
|
1538
|
-
this.schema.callbacks[callback] =
|
|
1547
|
+
this.schema.callbacks[callback] = _chunkKZCEPS4Jcjs.dereferenceRef.call(void 0, cb, this.api);
|
|
1539
1548
|
cb = this.schema.callbacks[callback];
|
|
1540
1549
|
if (!cb || _chunkYPR7YTHMcjs.isRef.call(void 0, cb)) {
|
|
1541
1550
|
return;
|
|
@@ -1545,14 +1554,14 @@ var Operation = (_class = class {
|
|
|
1545
1554
|
let callbackPath = cb[expression];
|
|
1546
1555
|
if (!callbackPath) return;
|
|
1547
1556
|
if (_chunkYPR7YTHMcjs.isRef.call(void 0, callbackPath)) {
|
|
1548
|
-
cb[expression] =
|
|
1557
|
+
cb[expression] = _chunkKZCEPS4Jcjs.dereferenceRef.call(void 0, callbackPath, this.api);
|
|
1549
1558
|
callbackPath = cb[expression];
|
|
1550
1559
|
if (!callbackPath || _chunkYPR7YTHMcjs.isRef.call(void 0, callbackPath)) {
|
|
1551
1560
|
return;
|
|
1552
1561
|
}
|
|
1553
1562
|
}
|
|
1554
1563
|
Object.keys(callbackPath).forEach((method) => {
|
|
1555
|
-
if (!
|
|
1564
|
+
if (!_chunkKZCEPS4Jcjs.supportedMethods.includes(method)) return;
|
|
1556
1565
|
const found = this.getCallback(callback, expression, method);
|
|
1557
1566
|
if (found) {
|
|
1558
1567
|
callbacks.push(found);
|
|
@@ -1630,12 +1639,12 @@ var Operation = (_class = class {
|
|
|
1630
1639
|
}
|
|
1631
1640
|
this.dereferencing.processing = true;
|
|
1632
1641
|
if (!this.schemasDecorated) {
|
|
1633
|
-
|
|
1642
|
+
_chunkKZCEPS4Jcjs.decorateComponentSchemasWithRefName.call(void 0, this.api);
|
|
1634
1643
|
this.schemasDecorated = true;
|
|
1635
1644
|
}
|
|
1636
1645
|
const { api, schema, promises } = this;
|
|
1637
1646
|
const circularRefs = /* @__PURE__ */ new Set();
|
|
1638
|
-
const dereferencingOptions =
|
|
1647
|
+
const dereferencingOptions = _chunkKZCEPS4Jcjs.getDereferencingOptions.call(void 0, circularRefs);
|
|
1639
1648
|
const parser = new (0, _jsonschemarefparser.$RefParser)();
|
|
1640
1649
|
return parser.dereference(
|
|
1641
1650
|
"#/__INTERNAL__",
|
|
@@ -1777,7 +1786,7 @@ var Callback = class extends Operation {
|
|
|
1777
1786
|
let parameters = (_optionalChain([this, 'access', _100 => _100.schema, 'optionalAccess', _101 => _101.parameters]) || []).map((p) => {
|
|
1778
1787
|
let param = p;
|
|
1779
1788
|
if (_chunkYPR7YTHMcjs.isRef.call(void 0, param)) {
|
|
1780
|
-
param =
|
|
1789
|
+
param = _chunkKZCEPS4Jcjs.dereferenceRef.call(void 0, param, this.api);
|
|
1781
1790
|
if (!param || _chunkYPR7YTHMcjs.isRef.call(void 0, param)) return void 0;
|
|
1782
1791
|
}
|
|
1783
1792
|
return param;
|
|
@@ -1785,7 +1794,7 @@ var Callback = class extends Operation {
|
|
|
1785
1794
|
const commonParams = (this.parentSchema.parameters || []).map((p) => {
|
|
1786
1795
|
let param = p;
|
|
1787
1796
|
if (_chunkYPR7YTHMcjs.isRef.call(void 0, param)) {
|
|
1788
|
-
param =
|
|
1797
|
+
param = _chunkKZCEPS4Jcjs.dereferenceRef.call(void 0, param, this.api);
|
|
1789
1798
|
if (!param || _chunkYPR7YTHMcjs.isRef.call(void 0, param)) return void 0;
|
|
1790
1799
|
}
|
|
1791
1800
|
return param;
|
|
@@ -1811,7 +1820,7 @@ var Webhook = class extends Operation {
|
|
|
1811
1820
|
}
|
|
1812
1821
|
let webhookPath = this.api.webhooks[this.path];
|
|
1813
1822
|
if (_chunkYPR7YTHMcjs.isRef.call(void 0, webhookPath)) {
|
|
1814
|
-
this.api.webhooks[this.path] =
|
|
1823
|
+
this.api.webhooks[this.path] = _chunkKZCEPS4Jcjs.dereferenceRef.call(void 0, webhookPath, this.api);
|
|
1815
1824
|
webhookPath = this.api.webhooks[this.path];
|
|
1816
1825
|
}
|
|
1817
1826
|
return _optionalChain([webhookPath, 'optionalAccess', _104 => _104.summary]);
|
|
@@ -1830,7 +1839,7 @@ var Webhook = class extends Operation {
|
|
|
1830
1839
|
}
|
|
1831
1840
|
let webhookPath = this.api.webhooks[this.path];
|
|
1832
1841
|
if (_chunkYPR7YTHMcjs.isRef.call(void 0, webhookPath)) {
|
|
1833
|
-
this.api.webhooks[this.path] =
|
|
1842
|
+
this.api.webhooks[this.path] = _chunkKZCEPS4Jcjs.dereferenceRef.call(void 0, webhookPath, this.api);
|
|
1834
1843
|
webhookPath = this.api.webhooks[this.path];
|
|
1835
1844
|
}
|
|
1836
1845
|
return _optionalChain([webhookPath, 'optionalAccess', _107 => _107.description]);
|
|
@@ -1854,4 +1863,4 @@ exports.Operation = Operation; exports.Callback = Callback; exports.Webhook = We
|
|
|
1854
1863
|
* @license Apache-2.0
|
|
1855
1864
|
* @see {@link https://github.com/swagger-api/swagger-ui/blob/master/src/core/plugins/samples/fn.js}
|
|
1856
1865
|
*/
|
|
1857
|
-
//# sourceMappingURL=chunk-
|
|
1866
|
+
//# sourceMappingURL=chunk-SM47EGII.cjs.map
|