oas 32.1.4 → 32.1.6
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-3IEA3ASV.cjs → chunk-4ZMPFZPV.cjs} +17 -6
- package/dist/chunk-4ZMPFZPV.cjs.map +1 -0
- package/dist/{chunk-I2TE44UE.cjs → chunk-5X7RYFCP.cjs} +60 -60
- package/dist/{chunk-I2TE44UE.cjs.map → chunk-5X7RYFCP.cjs.map} +1 -1
- package/dist/{chunk-TM55HFEL.js → chunk-CH3OYPVG.js} +17 -6
- package/dist/chunk-CH3OYPVG.js.map +1 -0
- package/dist/{chunk-JEOL436F.js → chunk-N4ZALGH2.js} +2 -2
- package/dist/{chunk-TY4JJJU6.js → chunk-QXIKSHG7.js} +3 -3
- package/dist/{chunk-774CH4GG.cjs → chunk-UJRHFM6H.cjs} +19 -19
- package/dist/{chunk-774CH4GG.cjs.map → chunk-UJRHFM6H.cjs.map} +1 -1
- 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 +7 -7
- package/dist/chunk-3IEA3ASV.cjs.map +0 -1
- package/dist/chunk-TM55HFEL.js.map +0 -1
- /package/dist/{chunk-JEOL436F.js.map → chunk-N4ZALGH2.js.map} +0 -0
- /package/dist/{chunk-TY4JJJU6.js.map → chunk-QXIKSHG7.js.map} +0 -0
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
var
|
|
16
|
+
var _chunk4ZMPFZPVcjs = require('./chunk-4ZMPFZPV.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 (!_chunk4ZMPFZPVcjs.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 = _chunk4ZMPFZPVcjs.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
|
}
|
|
@@ -297,7 +297,7 @@ function getMediaTypeExamples(mediaType, mediaTypeObject, definition, opts = {})
|
|
|
297
297
|
}
|
|
298
298
|
}
|
|
299
299
|
if (mediaTypeObject.schema) {
|
|
300
|
-
if (!
|
|
300
|
+
if (!_chunk4ZMPFZPVcjs.matches_mimetype_default.xml(mediaType)) {
|
|
301
301
|
return [
|
|
302
302
|
{
|
|
303
303
|
value: samples_default(structuredClone(mediaTypeObject.schema), {
|
|
@@ -318,7 +318,7 @@ function getResponseExamples(operation, definition) {
|
|
|
318
318
|
let onlyHeaders = false;
|
|
319
319
|
if (!response) return false;
|
|
320
320
|
if (_chunkYPR7YTHMcjs.isRef.call(void 0, response)) {
|
|
321
|
-
response =
|
|
321
|
+
response = _chunk4ZMPFZPVcjs.dereferenceRef.call(void 0, response, definition);
|
|
322
322
|
if (!response || _chunkYPR7YTHMcjs.isRef.call(void 0, response)) return false;
|
|
323
323
|
}
|
|
324
324
|
const mediaTypes = {};
|
|
@@ -358,14 +358,14 @@ function getCallbackExamples(operation, definition) {
|
|
|
358
358
|
let callback = _optionalChain([operation, 'access', _16 => _16.callbacks, 'optionalAccess', _17 => _17[identifier]]);
|
|
359
359
|
if (!callback) return [];
|
|
360
360
|
if (_chunkYPR7YTHMcjs.isRef.call(void 0, callback)) {
|
|
361
|
-
callback =
|
|
361
|
+
callback = _chunk4ZMPFZPVcjs.dereferenceRef.call(void 0, callback, definition);
|
|
362
362
|
if (!callback || _chunkYPR7YTHMcjs.isRef.call(void 0, callback)) return [];
|
|
363
363
|
}
|
|
364
364
|
const items = Object.keys(callback).map((expression) => {
|
|
365
365
|
let callbackPath = callback[expression];
|
|
366
366
|
if (!callbackPath) return [];
|
|
367
367
|
if (_chunkYPR7YTHMcjs.isRef.call(void 0, callbackPath)) {
|
|
368
|
-
callbackPath =
|
|
368
|
+
callbackPath = _chunk4ZMPFZPVcjs.dereferenceRef.call(void 0, callbackPath, definition);
|
|
369
369
|
if (!callbackPath || _chunkYPR7YTHMcjs.isRef.call(void 0, callbackPath)) return [];
|
|
370
370
|
}
|
|
371
371
|
return Object.keys(callbackPath).map((method) => {
|
|
@@ -448,7 +448,7 @@ function getExampleGroups(operation) {
|
|
|
448
448
|
Object.entries(param.examples || {}).forEach(([exampleKey, paramExample]) => {
|
|
449
449
|
let example = paramExample;
|
|
450
450
|
if (_chunkYPR7YTHMcjs.isRef.call(void 0, example)) {
|
|
451
|
-
example =
|
|
451
|
+
example = _chunk4ZMPFZPVcjs.dereferenceRef.call(void 0, example, operation.api);
|
|
452
452
|
if (!example || _chunkYPR7YTHMcjs.isRef.call(void 0, example)) return;
|
|
453
453
|
}
|
|
454
454
|
groups[exampleKey] = {
|
|
@@ -496,7 +496,7 @@ function getRequestBodyExamples(operation, definition) {
|
|
|
496
496
|
if (!requestBody) {
|
|
497
497
|
return [];
|
|
498
498
|
} else if (_chunkYPR7YTHMcjs.isRef.call(void 0, requestBody)) {
|
|
499
|
-
requestBody =
|
|
499
|
+
requestBody = _chunk4ZMPFZPVcjs.dereferenceRef.call(void 0, requestBody, definition);
|
|
500
500
|
}
|
|
501
501
|
if (!requestBody || _chunkYPR7YTHMcjs.isRef.call(void 0, requestBody) || !requestBody.content) {
|
|
502
502
|
return [];
|
|
@@ -561,7 +561,7 @@ function getOperationId(path, method, operation, opts = {}) {
|
|
|
561
561
|
}
|
|
562
562
|
|
|
563
563
|
// src/operation/transformers/get-response-as-json-schema.ts
|
|
564
|
-
var isJSON =
|
|
564
|
+
var isJSON = _chunk4ZMPFZPVcjs.matches_mimetype_default.json;
|
|
565
565
|
function buildHeadersSchema(response, schemaOptions) {
|
|
566
566
|
const headersSchema = {
|
|
567
567
|
type: "object",
|
|
@@ -574,7 +574,7 @@ function buildHeadersSchema(response, schemaOptions) {
|
|
|
574
574
|
let headerEntry = _optionalChain([response, 'access', _44 => _44.headers, 'optionalAccess', _45 => _45[key]]);
|
|
575
575
|
if (!headerEntry) return;
|
|
576
576
|
if (_chunkYPR7YTHMcjs.isRef.call(void 0, headerEntry)) {
|
|
577
|
-
headerEntry =
|
|
577
|
+
headerEntry = _chunk4ZMPFZPVcjs.dereferenceRef.call(void 0, headerEntry, api, seenRefs);
|
|
578
578
|
if (!headerEntry || _chunkYPR7YTHMcjs.isRef.call(void 0, headerEntry)) return;
|
|
579
579
|
}
|
|
580
580
|
if (headerEntry.schema) {
|
|
@@ -582,10 +582,10 @@ function buildHeadersSchema(response, schemaOptions) {
|
|
|
582
582
|
let headerSchema = header.schema;
|
|
583
583
|
if (!headerSchema) return;
|
|
584
584
|
if (_chunkYPR7YTHMcjs.isRef.call(void 0, headerSchema)) {
|
|
585
|
-
headerSchema =
|
|
585
|
+
headerSchema = _chunk4ZMPFZPVcjs.dereferenceRef.call(void 0, headerSchema, api, seenRefs);
|
|
586
586
|
if (!headerSchema || _chunkYPR7YTHMcjs.isRef.call(void 0, headerSchema)) return;
|
|
587
587
|
}
|
|
588
|
-
headersSchema.properties[key] =
|
|
588
|
+
headersSchema.properties[key] = _chunk4ZMPFZPVcjs.toJSONSchema.call(void 0, _chunk4ZMPFZPVcjs.cloneObject.call(void 0, headerSchema), {
|
|
589
589
|
addEnumsToDescriptions: true,
|
|
590
590
|
...schemaOptions
|
|
591
591
|
});
|
|
@@ -639,32 +639,32 @@ function getResponseAsJSONSchema(operation, api, statusCode, opts) {
|
|
|
639
639
|
}
|
|
640
640
|
if (preferredContentType) {
|
|
641
641
|
if (contentTypes.includes(preferredContentType)) {
|
|
642
|
-
const schema2 =
|
|
642
|
+
const schema2 = _chunk4ZMPFZPVcjs.cloneObject.call(void 0, content[preferredContentType].schema);
|
|
643
643
|
if (!schema2) {
|
|
644
644
|
return null;
|
|
645
645
|
}
|
|
646
|
-
return
|
|
646
|
+
return _chunk4ZMPFZPVcjs.toJSONSchema.call(void 0, schema2, baseSchemaOptions);
|
|
647
647
|
}
|
|
648
648
|
return null;
|
|
649
649
|
}
|
|
650
650
|
for (let i = 0; i < contentTypes.length; i++) {
|
|
651
651
|
if (isJSON(contentTypes[i])) {
|
|
652
|
-
const schema2 =
|
|
652
|
+
const schema2 = _chunk4ZMPFZPVcjs.cloneObject.call(void 0, content[contentTypes[i]].schema);
|
|
653
653
|
if (!schema2) {
|
|
654
654
|
return {};
|
|
655
655
|
}
|
|
656
|
-
return
|
|
656
|
+
return _chunk4ZMPFZPVcjs.toJSONSchema.call(void 0, schema2, baseSchemaOptions);
|
|
657
657
|
}
|
|
658
658
|
}
|
|
659
659
|
const contentType = contentTypes.shift();
|
|
660
660
|
if (!contentType) {
|
|
661
661
|
return {};
|
|
662
662
|
}
|
|
663
|
-
const schema =
|
|
663
|
+
const schema = _chunk4ZMPFZPVcjs.cloneObject.call(void 0, content[contentType].schema);
|
|
664
664
|
if (!schema) {
|
|
665
665
|
return {};
|
|
666
666
|
}
|
|
667
|
-
return
|
|
667
|
+
return _chunk4ZMPFZPVcjs.toJSONSchema.call(void 0, schema, baseSchemaOptions);
|
|
668
668
|
}
|
|
669
669
|
const foundSchema = getPreferredSchema(response.content, _optionalChain([opts, 'optionalAccess', _46 => _46.contentType]));
|
|
670
670
|
if (_optionalChain([opts, 'optionalAccess', _47 => _47.contentType]) && !foundSchema) {
|
|
@@ -683,23 +683,23 @@ function getResponseAsJSONSchema(operation, api, statusCode, opts) {
|
|
|
683
683
|
// able to render so instead of generating a JSON Schema with an `undefined` type we should
|
|
684
684
|
// default to `string` so there's at least *something* the end-user can interact with.
|
|
685
685
|
type: _nullishCoalesce(schemaType, () => ( "string")),
|
|
686
|
-
schema:
|
|
686
|
+
schema: _chunk4ZMPFZPVcjs.isPrimitive.call(void 0, schema) ? schema : {
|
|
687
687
|
...schema,
|
|
688
|
-
$schema:
|
|
688
|
+
$schema: _chunk4ZMPFZPVcjs.getSchemaVersionString.call(void 0, schema, api)
|
|
689
689
|
},
|
|
690
690
|
label: "Response body"
|
|
691
691
|
};
|
|
692
692
|
if (response.description && schemaWrapper.schema) {
|
|
693
693
|
schemaWrapper.description = response.description;
|
|
694
694
|
}
|
|
695
|
-
|
|
695
|
+
_chunk4ZMPFZPVcjs.applyDiscriminatorOneOfToUsedSchemas.call(void 0, api, usedSchemas, (ref) => {
|
|
696
696
|
if (usedSchemas.has(ref)) {
|
|
697
697
|
return usedSchemas.get(ref);
|
|
698
698
|
}
|
|
699
699
|
try {
|
|
700
|
-
const resolved =
|
|
700
|
+
const resolved = _chunk4ZMPFZPVcjs.dereferenceRef.call(void 0, { $ref: ref }, api, seenRefs);
|
|
701
701
|
if (_chunkYPR7YTHMcjs.isRef.call(void 0, resolved)) return void 0;
|
|
702
|
-
const converted =
|
|
702
|
+
const converted = _chunk4ZMPFZPVcjs.toJSONSchema.call(void 0, structuredClone(resolved), {
|
|
703
703
|
...baseSchemaOptions,
|
|
704
704
|
seenRefs
|
|
705
705
|
});
|
|
@@ -711,9 +711,9 @@ function getResponseAsJSONSchema(operation, api, statusCode, opts) {
|
|
|
711
711
|
});
|
|
712
712
|
if (schemaWrapper.schema && usedSchemas.size > 0) {
|
|
713
713
|
const refsInGroup = _nullishCoalesce(refsByGroup.get("body"), () => ( /* @__PURE__ */ new Set()));
|
|
714
|
-
const referencedSchemas =
|
|
714
|
+
const referencedSchemas = _chunk4ZMPFZPVcjs.filterRequiredRefsToReferenced.call(void 0, refsInGroup, usedSchemas);
|
|
715
715
|
if (referencedSchemas.size > 0) {
|
|
716
|
-
|
|
716
|
+
_chunk4ZMPFZPVcjs.mergeReferencedSchemasIntoRoot.call(void 0, schemaWrapper.schema, referencedSchemas);
|
|
717
717
|
}
|
|
718
718
|
}
|
|
719
719
|
jsonSchema.push(schemaWrapper);
|
|
@@ -725,9 +725,9 @@ function getResponseAsJSONSchema(operation, api, statusCode, opts) {
|
|
|
725
725
|
});
|
|
726
726
|
if (headersWrapper.schema && usedSchemas.size > 0) {
|
|
727
727
|
const refsInGroup = _nullishCoalesce(refsByGroup.get("headers"), () => ( /* @__PURE__ */ new Set()));
|
|
728
|
-
const referencedSchemas =
|
|
728
|
+
const referencedSchemas = _chunk4ZMPFZPVcjs.filterRequiredRefsToReferenced.call(void 0, refsInGroup, usedSchemas);
|
|
729
729
|
if (referencedSchemas.size > 0) {
|
|
730
|
-
|
|
730
|
+
_chunk4ZMPFZPVcjs.mergeReferencedSchemasIntoRoot.call(void 0, headersWrapper.schema, referencedSchemas);
|
|
731
731
|
}
|
|
732
732
|
}
|
|
733
733
|
jsonSchema.push(headersWrapper);
|
|
@@ -867,7 +867,7 @@ var Operation = (_class = class {
|
|
|
867
867
|
let types = [];
|
|
868
868
|
if (this.schema.requestBody) {
|
|
869
869
|
if (_chunkYPR7YTHMcjs.isRef.call(void 0, this.schema.requestBody)) {
|
|
870
|
-
this.schema.requestBody =
|
|
870
|
+
this.schema.requestBody = _chunk4ZMPFZPVcjs.dereferenceRef.call(void 0, this.schema.requestBody, this.api);
|
|
871
871
|
}
|
|
872
872
|
if (this.schema.requestBody && "content" in this.schema.requestBody) {
|
|
873
873
|
types = Object.keys(this.schema.requestBody.content);
|
|
@@ -878,7 +878,7 @@ var Operation = (_class = class {
|
|
|
878
878
|
this.contentType = types[0];
|
|
879
879
|
}
|
|
880
880
|
types.forEach((t) => {
|
|
881
|
-
if (
|
|
881
|
+
if (_chunk4ZMPFZPVcjs.matches_mimetype_default.json(t)) {
|
|
882
882
|
this.contentType = t;
|
|
883
883
|
}
|
|
884
884
|
});
|
|
@@ -891,7 +891,7 @@ var Operation = (_class = class {
|
|
|
891
891
|
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.2.md#user-content-request-body-content}
|
|
892
892
|
*/
|
|
893
893
|
isFormUrlEncoded() {
|
|
894
|
-
return
|
|
894
|
+
return _chunk4ZMPFZPVcjs.matches_mimetype_default.formUrlEncoded(this.getContentType());
|
|
895
895
|
}
|
|
896
896
|
/**
|
|
897
897
|
* Checks if the current operation has a mutipart content type payload.
|
|
@@ -900,7 +900,7 @@ var Operation = (_class = class {
|
|
|
900
900
|
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.2.md#user-content-request-body-content}
|
|
901
901
|
*/
|
|
902
902
|
isMultipart() {
|
|
903
|
-
return
|
|
903
|
+
return _chunk4ZMPFZPVcjs.matches_mimetype_default.multipart(this.getContentType());
|
|
904
904
|
}
|
|
905
905
|
/**
|
|
906
906
|
* Checks if the current operation has a JSON-like content type payload.
|
|
@@ -909,7 +909,7 @@ var Operation = (_class = class {
|
|
|
909
909
|
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.2.md#user-content-request-body-content}
|
|
910
910
|
*/
|
|
911
911
|
isJson() {
|
|
912
|
-
return
|
|
912
|
+
return _chunk4ZMPFZPVcjs.matches_mimetype_default.json(this.getContentType());
|
|
913
913
|
}
|
|
914
914
|
/**
|
|
915
915
|
* Checks if the current operation has an XML content type payload.
|
|
@@ -918,7 +918,7 @@ var Operation = (_class = class {
|
|
|
918
918
|
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.2.md#user-content-request-body-content}
|
|
919
919
|
*/
|
|
920
920
|
isXml() {
|
|
921
|
-
return
|
|
921
|
+
return _chunk4ZMPFZPVcjs.matches_mimetype_default.xml(this.getContentType());
|
|
922
922
|
}
|
|
923
923
|
/**
|
|
924
924
|
* Checks if the current operation is a webhook or not.
|
|
@@ -966,7 +966,7 @@ var Operation = (_class = class {
|
|
|
966
966
|
security = _optionalChain([this, 'access', _64 => _64.api, 'optionalAccess', _65 => _65.components, 'optionalAccess', _66 => _66.securitySchemes, 'optionalAccess', _67 => _67[key]]);
|
|
967
967
|
if (!security) return false;
|
|
968
968
|
if (_chunkYPR7YTHMcjs.isRef.call(void 0, security)) {
|
|
969
|
-
security =
|
|
969
|
+
security = _chunk4ZMPFZPVcjs.dereferenceRef.call(void 0, security, this.api);
|
|
970
970
|
if (!security || _chunkYPR7YTHMcjs.isRef.call(void 0, security)) return false;
|
|
971
971
|
}
|
|
972
972
|
} catch (e4) {
|
|
@@ -1047,7 +1047,7 @@ var Operation = (_class = class {
|
|
|
1047
1047
|
this.schema.parameters.map((p) => {
|
|
1048
1048
|
let param = p;
|
|
1049
1049
|
if (_chunkYPR7YTHMcjs.isRef.call(void 0, param)) {
|
|
1050
|
-
param =
|
|
1050
|
+
param = _chunk4ZMPFZPVcjs.dereferenceRef.call(void 0, param, this.api);
|
|
1051
1051
|
if (!param || _chunkYPR7YTHMcjs.isRef.call(void 0, param)) return void 0;
|
|
1052
1052
|
}
|
|
1053
1053
|
if (param.in && param.in === "header") return param.name;
|
|
@@ -1060,7 +1060,7 @@ var Operation = (_class = class {
|
|
|
1060
1060
|
let response = this.schema.responses[r];
|
|
1061
1061
|
if (!response) return [];
|
|
1062
1062
|
if (_chunkYPR7YTHMcjs.isRef.call(void 0, response)) {
|
|
1063
|
-
this.schema.responses[r] =
|
|
1063
|
+
this.schema.responses[r] = _chunk4ZMPFZPVcjs.dereferenceRef.call(void 0, response, this.api);
|
|
1064
1064
|
response = this.schema.responses[r];
|
|
1065
1065
|
if (!response || _chunkYPR7YTHMcjs.isRef.call(void 0, response)) {
|
|
1066
1066
|
return [];
|
|
@@ -1073,7 +1073,7 @@ var Operation = (_class = class {
|
|
|
1073
1073
|
let requestBody = this.schema.requestBody;
|
|
1074
1074
|
if (requestBody) {
|
|
1075
1075
|
if (_chunkYPR7YTHMcjs.isRef.call(void 0, requestBody)) {
|
|
1076
|
-
this.schema.requestBody =
|
|
1076
|
+
this.schema.requestBody = _chunk4ZMPFZPVcjs.dereferenceRef.call(void 0, requestBody, this.api);
|
|
1077
1077
|
requestBody = this.schema.requestBody;
|
|
1078
1078
|
}
|
|
1079
1079
|
if (requestBody && !_chunkYPR7YTHMcjs.isRef.call(void 0, requestBody) && "content" in requestBody && Object.keys(requestBody.content)) {
|
|
@@ -1086,7 +1086,7 @@ var Operation = (_class = class {
|
|
|
1086
1086
|
let response = _optionalChain([this, 'access', _71 => _71.schema, 'access', _72 => _72.responses, 'optionalAccess', _73 => _73[r]]);
|
|
1087
1087
|
if (!response) return false;
|
|
1088
1088
|
if (_chunkYPR7YTHMcjs.isRef.call(void 0, response)) {
|
|
1089
|
-
this.schema.responses[r] =
|
|
1089
|
+
this.schema.responses[r] = _chunk4ZMPFZPVcjs.dereferenceRef.call(void 0, response, this.api);
|
|
1090
1090
|
response = this.schema.responses[r];
|
|
1091
1091
|
if (!response || _chunkYPR7YTHMcjs.isRef.call(void 0, response)) {
|
|
1092
1092
|
return false;
|
|
@@ -1196,7 +1196,7 @@ var Operation = (_class = class {
|
|
|
1196
1196
|
let parameters = (_optionalChain([this, 'access', _76 => _76.schema, 'optionalAccess', _77 => _77.parameters]) || []).map((p) => {
|
|
1197
1197
|
let param = p;
|
|
1198
1198
|
if (_chunkYPR7YTHMcjs.isRef.call(void 0, param)) {
|
|
1199
|
-
param =
|
|
1199
|
+
param = _chunk4ZMPFZPVcjs.dereferenceRef.call(void 0, param, this.api);
|
|
1200
1200
|
if (!param || _chunkYPR7YTHMcjs.isRef.call(void 0, param)) return void 0;
|
|
1201
1201
|
}
|
|
1202
1202
|
return param;
|
|
@@ -1204,7 +1204,7 @@ var Operation = (_class = class {
|
|
|
1204
1204
|
const commonParams = (_optionalChain([this, 'access', _78 => _78.api, 'optionalAccess', _79 => _79.paths, 'optionalAccess', _80 => _80[this.path], 'optionalAccess', _81 => _81.parameters]) || []).map((p) => {
|
|
1205
1205
|
let param = p;
|
|
1206
1206
|
if (_chunkYPR7YTHMcjs.isRef.call(void 0, param)) {
|
|
1207
|
-
param =
|
|
1207
|
+
param = _chunk4ZMPFZPVcjs.dereferenceRef.call(void 0, param, this.api);
|
|
1208
1208
|
if (!param || _chunkYPR7YTHMcjs.isRef.call(void 0, param)) return void 0;
|
|
1209
1209
|
}
|
|
1210
1210
|
return param;
|
|
@@ -1242,10 +1242,10 @@ var Operation = (_class = class {
|
|
|
1242
1242
|
);
|
|
1243
1243
|
}
|
|
1244
1244
|
if (!this.schemasDecorated) {
|
|
1245
|
-
|
|
1245
|
+
_chunk4ZMPFZPVcjs.decorateComponentSchemasWithRefName.call(void 0, this.api);
|
|
1246
1246
|
this.schemasDecorated = true;
|
|
1247
1247
|
}
|
|
1248
|
-
return
|
|
1248
|
+
return _chunk4ZMPFZPVcjs.getParametersAsJSONSchema.call(void 0, this, this.api, {
|
|
1249
1249
|
includeDiscriminatorMappingRefs: true,
|
|
1250
1250
|
...opts
|
|
1251
1251
|
});
|
|
@@ -1270,7 +1270,7 @@ var Operation = (_class = class {
|
|
|
1270
1270
|
);
|
|
1271
1271
|
}
|
|
1272
1272
|
if (!this.schemasDecorated) {
|
|
1273
|
-
|
|
1273
|
+
_chunk4ZMPFZPVcjs.decorateComponentSchemasWithRefName.call(void 0, this.api);
|
|
1274
1274
|
this.schemasDecorated = true;
|
|
1275
1275
|
}
|
|
1276
1276
|
return getResponseAsJSONSchema(this, this.api, statusCode, {
|
|
@@ -1298,7 +1298,7 @@ var Operation = (_class = class {
|
|
|
1298
1298
|
let resp = response;
|
|
1299
1299
|
if (!resp) return;
|
|
1300
1300
|
if (_chunkYPR7YTHMcjs.isRef.call(void 0, resp)) {
|
|
1301
|
-
resp =
|
|
1301
|
+
resp = _chunk4ZMPFZPVcjs.dereferenceRef.call(void 0, resp, this.api);
|
|
1302
1302
|
if (!resp || _chunkYPR7YTHMcjs.isRef.call(void 0, resp)) {
|
|
1303
1303
|
return;
|
|
1304
1304
|
}
|
|
@@ -1327,7 +1327,7 @@ var Operation = (_class = class {
|
|
|
1327
1327
|
let requestBody = this.schema.requestBody;
|
|
1328
1328
|
if (!requestBody) return false;
|
|
1329
1329
|
if (_chunkYPR7YTHMcjs.isRef.call(void 0, requestBody)) {
|
|
1330
|
-
this.schema.requestBody =
|
|
1330
|
+
this.schema.requestBody = _chunk4ZMPFZPVcjs.dereferenceRef.call(void 0, requestBody, this.api);
|
|
1331
1331
|
requestBody = this.schema.requestBody;
|
|
1332
1332
|
if (!requestBody || _chunkYPR7YTHMcjs.isRef.call(void 0, requestBody)) {
|
|
1333
1333
|
return false;
|
|
@@ -1397,7 +1397,7 @@ var Operation = (_class = class {
|
|
|
1397
1397
|
let availableMediaType;
|
|
1398
1398
|
const mediaTypes = this.getRequestBodyMediaTypes();
|
|
1399
1399
|
mediaTypes.forEach((mt) => {
|
|
1400
|
-
if (!availableMediaType &&
|
|
1400
|
+
if (!availableMediaType && _chunk4ZMPFZPVcjs.matches_mimetype_default.json(mt)) {
|
|
1401
1401
|
availableMediaType = mt;
|
|
1402
1402
|
}
|
|
1403
1403
|
});
|
|
@@ -1445,7 +1445,7 @@ var Operation = (_class = class {
|
|
|
1445
1445
|
let response = this.schema.responses[statusCode];
|
|
1446
1446
|
if (!response) return false;
|
|
1447
1447
|
if (_chunkYPR7YTHMcjs.isRef.call(void 0, response)) {
|
|
1448
|
-
this.schema.responses[statusCode] =
|
|
1448
|
+
this.schema.responses[statusCode] = _chunk4ZMPFZPVcjs.dereferenceRef.call(void 0, response, this.api);
|
|
1449
1449
|
response = this.schema.responses[statusCode];
|
|
1450
1450
|
if (!response || _chunkYPR7YTHMcjs.isRef.call(void 0, response)) {
|
|
1451
1451
|
return false;
|
|
@@ -1489,7 +1489,7 @@ var Operation = (_class = class {
|
|
|
1489
1489
|
let callbackObj = this.schema.callbacks[identifier];
|
|
1490
1490
|
if (!callbackObj) return false;
|
|
1491
1491
|
if (_chunkYPR7YTHMcjs.isRef.call(void 0, callbackObj)) {
|
|
1492
|
-
this.schema.callbacks[identifier] =
|
|
1492
|
+
this.schema.callbacks[identifier] = _chunk4ZMPFZPVcjs.dereferenceRef.call(void 0, callbackObj, this.api);
|
|
1493
1493
|
callbackObj = this.schema.callbacks[identifier];
|
|
1494
1494
|
if (!callbackObj || _chunkYPR7YTHMcjs.isRef.call(void 0, callbackObj)) {
|
|
1495
1495
|
return false;
|
|
@@ -1498,7 +1498,7 @@ var Operation = (_class = class {
|
|
|
1498
1498
|
let callback = callbackObj[expression];
|
|
1499
1499
|
if (!callback) return false;
|
|
1500
1500
|
if (_chunkYPR7YTHMcjs.isRef.call(void 0, callback)) {
|
|
1501
|
-
callbackObj[expression] =
|
|
1501
|
+
callbackObj[expression] = _chunk4ZMPFZPVcjs.dereferenceRef.call(void 0, callback, this.api);
|
|
1502
1502
|
callback = callbackObj[expression];
|
|
1503
1503
|
if (!callback || _chunkYPR7YTHMcjs.isRef.call(void 0, callback)) {
|
|
1504
1504
|
return false;
|
|
@@ -1522,7 +1522,7 @@ var Operation = (_class = class {
|
|
|
1522
1522
|
let cb = _optionalChain([this, 'access', _87 => _87.schema, 'access', _88 => _88.callbacks, 'optionalAccess', _89 => _89[callback]]);
|
|
1523
1523
|
if (!cb) return;
|
|
1524
1524
|
if (_chunkYPR7YTHMcjs.isRef.call(void 0, cb)) {
|
|
1525
|
-
this.schema.callbacks[callback] =
|
|
1525
|
+
this.schema.callbacks[callback] = _chunk4ZMPFZPVcjs.dereferenceRef.call(void 0, cb, this.api);
|
|
1526
1526
|
cb = this.schema.callbacks[callback];
|
|
1527
1527
|
if (!cb || _chunkYPR7YTHMcjs.isRef.call(void 0, cb)) {
|
|
1528
1528
|
return;
|
|
@@ -1532,14 +1532,14 @@ var Operation = (_class = class {
|
|
|
1532
1532
|
let callbackPath = cb[expression];
|
|
1533
1533
|
if (!callbackPath) return;
|
|
1534
1534
|
if (_chunkYPR7YTHMcjs.isRef.call(void 0, callbackPath)) {
|
|
1535
|
-
cb[expression] =
|
|
1535
|
+
cb[expression] = _chunk4ZMPFZPVcjs.dereferenceRef.call(void 0, callbackPath, this.api);
|
|
1536
1536
|
callbackPath = cb[expression];
|
|
1537
1537
|
if (!callbackPath || _chunkYPR7YTHMcjs.isRef.call(void 0, callbackPath)) {
|
|
1538
1538
|
return;
|
|
1539
1539
|
}
|
|
1540
1540
|
}
|
|
1541
1541
|
Object.keys(callbackPath).forEach((method) => {
|
|
1542
|
-
if (!
|
|
1542
|
+
if (!_chunk4ZMPFZPVcjs.supportedMethods.includes(method)) return;
|
|
1543
1543
|
const found = this.getCallback(callback, expression, method);
|
|
1544
1544
|
if (found) {
|
|
1545
1545
|
callbacks.push(found);
|
|
@@ -1617,12 +1617,12 @@ var Operation = (_class = class {
|
|
|
1617
1617
|
}
|
|
1618
1618
|
this.dereferencing.processing = true;
|
|
1619
1619
|
if (!this.schemasDecorated) {
|
|
1620
|
-
|
|
1620
|
+
_chunk4ZMPFZPVcjs.decorateComponentSchemasWithRefName.call(void 0, this.api);
|
|
1621
1621
|
this.schemasDecorated = true;
|
|
1622
1622
|
}
|
|
1623
1623
|
const { api, schema, promises } = this;
|
|
1624
1624
|
const circularRefs = /* @__PURE__ */ new Set();
|
|
1625
|
-
const dereferencingOptions =
|
|
1625
|
+
const dereferencingOptions = _chunk4ZMPFZPVcjs.getDereferencingOptions.call(void 0, circularRefs);
|
|
1626
1626
|
const parser = new (0, _jsonschemarefparser.$RefParser)();
|
|
1627
1627
|
return parser.dereference(
|
|
1628
1628
|
"#/__INTERNAL__",
|
|
@@ -1764,7 +1764,7 @@ var Callback = class extends Operation {
|
|
|
1764
1764
|
let parameters = (_optionalChain([this, 'access', _97 => _97.schema, 'optionalAccess', _98 => _98.parameters]) || []).map((p) => {
|
|
1765
1765
|
let param = p;
|
|
1766
1766
|
if (_chunkYPR7YTHMcjs.isRef.call(void 0, param)) {
|
|
1767
|
-
param =
|
|
1767
|
+
param = _chunk4ZMPFZPVcjs.dereferenceRef.call(void 0, param, this.api);
|
|
1768
1768
|
if (!param || _chunkYPR7YTHMcjs.isRef.call(void 0, param)) return void 0;
|
|
1769
1769
|
}
|
|
1770
1770
|
return param;
|
|
@@ -1772,7 +1772,7 @@ var Callback = class extends Operation {
|
|
|
1772
1772
|
const commonParams = (this.parentSchema.parameters || []).map((p) => {
|
|
1773
1773
|
let param = p;
|
|
1774
1774
|
if (_chunkYPR7YTHMcjs.isRef.call(void 0, param)) {
|
|
1775
|
-
param =
|
|
1775
|
+
param = _chunk4ZMPFZPVcjs.dereferenceRef.call(void 0, param, this.api);
|
|
1776
1776
|
if (!param || _chunkYPR7YTHMcjs.isRef.call(void 0, param)) return void 0;
|
|
1777
1777
|
}
|
|
1778
1778
|
return param;
|
|
@@ -1798,7 +1798,7 @@ var Webhook = class extends Operation {
|
|
|
1798
1798
|
}
|
|
1799
1799
|
let webhookPath = this.api.webhooks[this.path];
|
|
1800
1800
|
if (_chunkYPR7YTHMcjs.isRef.call(void 0, webhookPath)) {
|
|
1801
|
-
this.api.webhooks[this.path] =
|
|
1801
|
+
this.api.webhooks[this.path] = _chunk4ZMPFZPVcjs.dereferenceRef.call(void 0, webhookPath, this.api);
|
|
1802
1802
|
webhookPath = this.api.webhooks[this.path];
|
|
1803
1803
|
}
|
|
1804
1804
|
return _optionalChain([webhookPath, 'optionalAccess', _101 => _101.summary]);
|
|
@@ -1817,7 +1817,7 @@ var Webhook = class extends Operation {
|
|
|
1817
1817
|
}
|
|
1818
1818
|
let webhookPath = this.api.webhooks[this.path];
|
|
1819
1819
|
if (_chunkYPR7YTHMcjs.isRef.call(void 0, webhookPath)) {
|
|
1820
|
-
this.api.webhooks[this.path] =
|
|
1820
|
+
this.api.webhooks[this.path] = _chunk4ZMPFZPVcjs.dereferenceRef.call(void 0, webhookPath, this.api);
|
|
1821
1821
|
webhookPath = this.api.webhooks[this.path];
|
|
1822
1822
|
}
|
|
1823
1823
|
return _optionalChain([webhookPath, 'optionalAccess', _104 => _104.description]);
|
|
@@ -1841,4 +1841,4 @@ exports.Operation = Operation; exports.Callback = Callback; exports.Webhook = We
|
|
|
1841
1841
|
* @license Apache-2.0
|
|
1842
1842
|
* @see {@link https://github.com/swagger-api/swagger-ui/blob/master/src/core/plugins/samples/fn.js}
|
|
1843
1843
|
*/
|
|
1844
|
-
//# sourceMappingURL=chunk-
|
|
1844
|
+
//# sourceMappingURL=chunk-5X7RYFCP.cjs.map
|