oas 32.1.5 → 32.1.7
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-JEOL436F.js → chunk-AIIJPBJJ.js} +16 -3
- package/dist/chunk-AIIJPBJJ.js.map +1 -0
- package/dist/{chunk-TM55HFEL.js → chunk-CH3OYPVG.js} +17 -6
- package/dist/chunk-CH3OYPVG.js.map +1 -0
- package/dist/{chunk-TY4JJJU6.js → chunk-KW4FVGCF.js} +3 -3
- package/dist/{chunk-I2TE44UE.cjs → chunk-SEIG2ZZR.cjs} +85 -72
- package/dist/chunk-SEIG2ZZR.cjs.map +1 -0
- package/dist/{chunk-774CH4GG.cjs → chunk-XRT2L32X.cjs} +19 -19
- package/dist/{chunk-774CH4GG.cjs.map → chunk-XRT2L32X.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 +2 -2
- package/dist/chunk-3IEA3ASV.cjs.map +0 -1
- package/dist/chunk-I2TE44UE.cjs.map +0 -1
- package/dist/chunk-JEOL436F.js.map +0 -1
- package/dist/chunk-TM55HFEL.js.map +0 -1
- /package/dist/{chunk-TY4JJJU6.js.map → chunk-KW4FVGCF.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, {
|
|
@@ -1283,7 +1283,20 @@ var Operation = (_class = class {
|
|
|
1283
1283
|
*
|
|
1284
1284
|
*/
|
|
1285
1285
|
getResponseStatusCodes() {
|
|
1286
|
-
|
|
1286
|
+
if (!this.schema.responses) return [];
|
|
1287
|
+
if (_chunkYPR7YTHMcjs.isRef.call(void 0, this.schema.responses)) {
|
|
1288
|
+
this.schema.responses = _chunk4ZMPFZPVcjs.dereferenceRef.call(void 0, this.schema.responses, this.api);
|
|
1289
|
+
if (!this.schema.responses || _chunkYPR7YTHMcjs.isRef.call(void 0, this.schema.responses)) {
|
|
1290
|
+
return [];
|
|
1291
|
+
}
|
|
1292
|
+
}
|
|
1293
|
+
return Object.keys(this.schema.responses).filter((key) => {
|
|
1294
|
+
if (key.startsWith("x-")) {
|
|
1295
|
+
return false;
|
|
1296
|
+
}
|
|
1297
|
+
const response = _optionalChain([this, 'access', _82 => _82.schema, 'access', _83 => _83.responses, 'optionalAccess', _84 => _84[key]]);
|
|
1298
|
+
return response && typeof response === "object";
|
|
1299
|
+
});
|
|
1287
1300
|
}
|
|
1288
1301
|
/**
|
|
1289
1302
|
* Retrieve an array of all content types that this operation can return.
|
|
@@ -1298,7 +1311,7 @@ var Operation = (_class = class {
|
|
|
1298
1311
|
let resp = response;
|
|
1299
1312
|
if (!resp) return;
|
|
1300
1313
|
if (_chunkYPR7YTHMcjs.isRef.call(void 0, resp)) {
|
|
1301
|
-
resp =
|
|
1314
|
+
resp = _chunk4ZMPFZPVcjs.dereferenceRef.call(void 0, resp, this.api);
|
|
1302
1315
|
if (!resp || _chunkYPR7YTHMcjs.isRef.call(void 0, resp)) {
|
|
1303
1316
|
return;
|
|
1304
1317
|
}
|
|
@@ -1327,7 +1340,7 @@ var Operation = (_class = class {
|
|
|
1327
1340
|
let requestBody = this.schema.requestBody;
|
|
1328
1341
|
if (!requestBody) return false;
|
|
1329
1342
|
if (_chunkYPR7YTHMcjs.isRef.call(void 0, requestBody)) {
|
|
1330
|
-
this.schema.requestBody =
|
|
1343
|
+
this.schema.requestBody = _chunk4ZMPFZPVcjs.dereferenceRef.call(void 0, requestBody, this.api);
|
|
1331
1344
|
requestBody = this.schema.requestBody;
|
|
1332
1345
|
if (!requestBody || _chunkYPR7YTHMcjs.isRef.call(void 0, requestBody)) {
|
|
1333
1346
|
return false;
|
|
@@ -1397,7 +1410,7 @@ var Operation = (_class = class {
|
|
|
1397
1410
|
let availableMediaType;
|
|
1398
1411
|
const mediaTypes = this.getRequestBodyMediaTypes();
|
|
1399
1412
|
mediaTypes.forEach((mt) => {
|
|
1400
|
-
if (!availableMediaType &&
|
|
1413
|
+
if (!availableMediaType && _chunk4ZMPFZPVcjs.matches_mimetype_default.json(mt)) {
|
|
1401
1414
|
availableMediaType = mt;
|
|
1402
1415
|
}
|
|
1403
1416
|
});
|
|
@@ -1424,7 +1437,7 @@ var Operation = (_class = class {
|
|
|
1424
1437
|
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.2.md#request-body-examples}
|
|
1425
1438
|
*/
|
|
1426
1439
|
getRequestBodyExamples() {
|
|
1427
|
-
const isRequestExampleValueDefined = typeof _optionalChain([this, 'access',
|
|
1440
|
+
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
1441
|
if (this.requestBodyExamples && isRequestExampleValueDefined) {
|
|
1429
1442
|
return this.requestBodyExamples;
|
|
1430
1443
|
}
|
|
@@ -1445,7 +1458,7 @@ var Operation = (_class = class {
|
|
|
1445
1458
|
let response = this.schema.responses[statusCode];
|
|
1446
1459
|
if (!response) return false;
|
|
1447
1460
|
if (_chunkYPR7YTHMcjs.isRef.call(void 0, response)) {
|
|
1448
|
-
this.schema.responses[statusCode] =
|
|
1461
|
+
this.schema.responses[statusCode] = _chunk4ZMPFZPVcjs.dereferenceRef.call(void 0, response, this.api);
|
|
1449
1462
|
response = this.schema.responses[statusCode];
|
|
1450
1463
|
if (!response || _chunkYPR7YTHMcjs.isRef.call(void 0, response)) {
|
|
1451
1464
|
return false;
|
|
@@ -1489,7 +1502,7 @@ var Operation = (_class = class {
|
|
|
1489
1502
|
let callbackObj = this.schema.callbacks[identifier];
|
|
1490
1503
|
if (!callbackObj) return false;
|
|
1491
1504
|
if (_chunkYPR7YTHMcjs.isRef.call(void 0, callbackObj)) {
|
|
1492
|
-
this.schema.callbacks[identifier] =
|
|
1505
|
+
this.schema.callbacks[identifier] = _chunk4ZMPFZPVcjs.dereferenceRef.call(void 0, callbackObj, this.api);
|
|
1493
1506
|
callbackObj = this.schema.callbacks[identifier];
|
|
1494
1507
|
if (!callbackObj || _chunkYPR7YTHMcjs.isRef.call(void 0, callbackObj)) {
|
|
1495
1508
|
return false;
|
|
@@ -1498,7 +1511,7 @@ var Operation = (_class = class {
|
|
|
1498
1511
|
let callback = callbackObj[expression];
|
|
1499
1512
|
if (!callback) return false;
|
|
1500
1513
|
if (_chunkYPR7YTHMcjs.isRef.call(void 0, callback)) {
|
|
1501
|
-
callbackObj[expression] =
|
|
1514
|
+
callbackObj[expression] = _chunk4ZMPFZPVcjs.dereferenceRef.call(void 0, callback, this.api);
|
|
1502
1515
|
callback = callbackObj[expression];
|
|
1503
1516
|
if (!callback || _chunkYPR7YTHMcjs.isRef.call(void 0, callback)) {
|
|
1504
1517
|
return false;
|
|
@@ -1519,10 +1532,10 @@ var Operation = (_class = class {
|
|
|
1519
1532
|
if (!this.hasCallbacks()) return [];
|
|
1520
1533
|
const callbacks = [];
|
|
1521
1534
|
Object.keys(this.schema.callbacks).forEach((callback) => {
|
|
1522
|
-
let cb = _optionalChain([this, 'access',
|
|
1535
|
+
let cb = _optionalChain([this, 'access', _90 => _90.schema, 'access', _91 => _91.callbacks, 'optionalAccess', _92 => _92[callback]]);
|
|
1523
1536
|
if (!cb) return;
|
|
1524
1537
|
if (_chunkYPR7YTHMcjs.isRef.call(void 0, cb)) {
|
|
1525
|
-
this.schema.callbacks[callback] =
|
|
1538
|
+
this.schema.callbacks[callback] = _chunk4ZMPFZPVcjs.dereferenceRef.call(void 0, cb, this.api);
|
|
1526
1539
|
cb = this.schema.callbacks[callback];
|
|
1527
1540
|
if (!cb || _chunkYPR7YTHMcjs.isRef.call(void 0, cb)) {
|
|
1528
1541
|
return;
|
|
@@ -1532,14 +1545,14 @@ var Operation = (_class = class {
|
|
|
1532
1545
|
let callbackPath = cb[expression];
|
|
1533
1546
|
if (!callbackPath) return;
|
|
1534
1547
|
if (_chunkYPR7YTHMcjs.isRef.call(void 0, callbackPath)) {
|
|
1535
|
-
cb[expression] =
|
|
1548
|
+
cb[expression] = _chunk4ZMPFZPVcjs.dereferenceRef.call(void 0, callbackPath, this.api);
|
|
1536
1549
|
callbackPath = cb[expression];
|
|
1537
1550
|
if (!callbackPath || _chunkYPR7YTHMcjs.isRef.call(void 0, callbackPath)) {
|
|
1538
1551
|
return;
|
|
1539
1552
|
}
|
|
1540
1553
|
}
|
|
1541
1554
|
Object.keys(callbackPath).forEach((method) => {
|
|
1542
|
-
if (!
|
|
1555
|
+
if (!_chunk4ZMPFZPVcjs.supportedMethods.includes(method)) return;
|
|
1543
1556
|
const found = this.getCallback(callback, expression, method);
|
|
1544
1557
|
if (found) {
|
|
1545
1558
|
callbacks.push(found);
|
|
@@ -1582,7 +1595,7 @@ var Operation = (_class = class {
|
|
|
1582
1595
|
* @deprecated Use `oas.getExtension(extension, operation)` instead.
|
|
1583
1596
|
*/
|
|
1584
1597
|
getExtension(extension) {
|
|
1585
|
-
return _optionalChain([this, 'access',
|
|
1598
|
+
return _optionalChain([this, 'access', _93 => _93.schema, 'optionalAccess', _94 => _94[extension]]);
|
|
1586
1599
|
}
|
|
1587
1600
|
/**
|
|
1588
1601
|
* Returns an object with groups of all example definitions (body/header/query/path/response/etc.).
|
|
@@ -1617,12 +1630,12 @@ var Operation = (_class = class {
|
|
|
1617
1630
|
}
|
|
1618
1631
|
this.dereferencing.processing = true;
|
|
1619
1632
|
if (!this.schemasDecorated) {
|
|
1620
|
-
|
|
1633
|
+
_chunk4ZMPFZPVcjs.decorateComponentSchemasWithRefName.call(void 0, this.api);
|
|
1621
1634
|
this.schemasDecorated = true;
|
|
1622
1635
|
}
|
|
1623
1636
|
const { api, schema, promises } = this;
|
|
1624
1637
|
const circularRefs = /* @__PURE__ */ new Set();
|
|
1625
|
-
const dereferencingOptions =
|
|
1638
|
+
const dereferencingOptions = _chunk4ZMPFZPVcjs.getDereferencingOptions.call(void 0, circularRefs);
|
|
1626
1639
|
const parser = new (0, _jsonschemarefparser.$RefParser)();
|
|
1627
1640
|
return parser.dereference(
|
|
1628
1641
|
"#/__INTERNAL__",
|
|
@@ -1669,7 +1682,7 @@ var Operation = (_class = class {
|
|
|
1669
1682
|
// We need to convert our `Set` to an array in order to match the typings.
|
|
1670
1683
|
circularRefs: [...circularRefs]
|
|
1671
1684
|
};
|
|
1672
|
-
if (_optionalChain([opts, 'optionalAccess',
|
|
1685
|
+
if (_optionalChain([opts, 'optionalAccess', _95 => _95.cb])) {
|
|
1673
1686
|
opts.cb();
|
|
1674
1687
|
}
|
|
1675
1688
|
}).then(() => {
|
|
@@ -1733,7 +1746,7 @@ var Callback = class extends Operation {
|
|
|
1733
1746
|
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.2.md#user-content-operation-summary}
|
|
1734
1747
|
*/
|
|
1735
1748
|
getSummary() {
|
|
1736
|
-
if (_optionalChain([this, 'access',
|
|
1749
|
+
if (_optionalChain([this, 'access', _96 => _96.schema, 'optionalAccess', _97 => _97.summary]) && typeof this.schema.summary === "string") {
|
|
1737
1750
|
return this.schema.summary;
|
|
1738
1751
|
} else if (this.parentSchema.summary && typeof this.parentSchema.summary === "string") {
|
|
1739
1752
|
return this.parentSchema.summary;
|
|
@@ -1747,7 +1760,7 @@ var Callback = class extends Operation {
|
|
|
1747
1760
|
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.2.md#user-content-operation-description}
|
|
1748
1761
|
*/
|
|
1749
1762
|
getDescription() {
|
|
1750
|
-
if (_optionalChain([this, 'access',
|
|
1763
|
+
if (_optionalChain([this, 'access', _98 => _98.schema, 'optionalAccess', _99 => _99.description]) && typeof this.schema.description === "string") {
|
|
1751
1764
|
return this.schema.description;
|
|
1752
1765
|
} else if (this.parentSchema.description && typeof this.parentSchema.description === "string") {
|
|
1753
1766
|
return this.parentSchema.description;
|
|
@@ -1761,10 +1774,10 @@ var Callback = class extends Operation {
|
|
|
1761
1774
|
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.2.md#user-content-operation-parameters}
|
|
1762
1775
|
*/
|
|
1763
1776
|
getParameters() {
|
|
1764
|
-
let parameters = (_optionalChain([this, 'access',
|
|
1777
|
+
let parameters = (_optionalChain([this, 'access', _100 => _100.schema, 'optionalAccess', _101 => _101.parameters]) || []).map((p) => {
|
|
1765
1778
|
let param = p;
|
|
1766
1779
|
if (_chunkYPR7YTHMcjs.isRef.call(void 0, param)) {
|
|
1767
|
-
param =
|
|
1780
|
+
param = _chunk4ZMPFZPVcjs.dereferenceRef.call(void 0, param, this.api);
|
|
1768
1781
|
if (!param || _chunkYPR7YTHMcjs.isRef.call(void 0, param)) return void 0;
|
|
1769
1782
|
}
|
|
1770
1783
|
return param;
|
|
@@ -1772,7 +1785,7 @@ var Callback = class extends Operation {
|
|
|
1772
1785
|
const commonParams = (this.parentSchema.parameters || []).map((p) => {
|
|
1773
1786
|
let param = p;
|
|
1774
1787
|
if (_chunkYPR7YTHMcjs.isRef.call(void 0, param)) {
|
|
1775
|
-
param =
|
|
1788
|
+
param = _chunk4ZMPFZPVcjs.dereferenceRef.call(void 0, param, this.api);
|
|
1776
1789
|
if (!param || _chunkYPR7YTHMcjs.isRef.call(void 0, param)) return void 0;
|
|
1777
1790
|
}
|
|
1778
1791
|
return param;
|
|
@@ -1791,17 +1804,17 @@ var Webhook = class extends Operation {
|
|
|
1791
1804
|
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.2.md#user-content-operation-summary}
|
|
1792
1805
|
*/
|
|
1793
1806
|
getSummary() {
|
|
1794
|
-
if (_optionalChain([this, 'access',
|
|
1807
|
+
if (_optionalChain([this, 'access', _102 => _102.schema, 'optionalAccess', _103 => _103.summary]) && typeof this.schema.summary === "string") {
|
|
1795
1808
|
return this.schema.summary;
|
|
1796
1809
|
} else if (!this.api.webhooks) {
|
|
1797
1810
|
return void 0;
|
|
1798
1811
|
}
|
|
1799
1812
|
let webhookPath = this.api.webhooks[this.path];
|
|
1800
1813
|
if (_chunkYPR7YTHMcjs.isRef.call(void 0, webhookPath)) {
|
|
1801
|
-
this.api.webhooks[this.path] =
|
|
1814
|
+
this.api.webhooks[this.path] = _chunk4ZMPFZPVcjs.dereferenceRef.call(void 0, webhookPath, this.api);
|
|
1802
1815
|
webhookPath = this.api.webhooks[this.path];
|
|
1803
1816
|
}
|
|
1804
|
-
return _optionalChain([webhookPath, 'optionalAccess',
|
|
1817
|
+
return _optionalChain([webhookPath, 'optionalAccess', _104 => _104.summary]);
|
|
1805
1818
|
}
|
|
1806
1819
|
/**
|
|
1807
1820
|
* Retrieve the `description` for this operation.
|
|
@@ -1810,17 +1823,17 @@ var Webhook = class extends Operation {
|
|
|
1810
1823
|
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.2.md#user-content-operation-description}
|
|
1811
1824
|
*/
|
|
1812
1825
|
getDescription() {
|
|
1813
|
-
if (_optionalChain([this, 'access',
|
|
1826
|
+
if (_optionalChain([this, 'access', _105 => _105.schema, 'optionalAccess', _106 => _106.description]) && typeof this.schema.description === "string") {
|
|
1814
1827
|
return this.schema.description;
|
|
1815
1828
|
} else if (!this.api.webhooks) {
|
|
1816
1829
|
return void 0;
|
|
1817
1830
|
}
|
|
1818
1831
|
let webhookPath = this.api.webhooks[this.path];
|
|
1819
1832
|
if (_chunkYPR7YTHMcjs.isRef.call(void 0, webhookPath)) {
|
|
1820
|
-
this.api.webhooks[this.path] =
|
|
1833
|
+
this.api.webhooks[this.path] = _chunk4ZMPFZPVcjs.dereferenceRef.call(void 0, webhookPath, this.api);
|
|
1821
1834
|
webhookPath = this.api.webhooks[this.path];
|
|
1822
1835
|
}
|
|
1823
|
-
return _optionalChain([webhookPath, 'optionalAccess',
|
|
1836
|
+
return _optionalChain([webhookPath, 'optionalAccess', _107 => _107.description]);
|
|
1824
1837
|
}
|
|
1825
1838
|
};
|
|
1826
1839
|
|
|
@@ -1841,4 +1854,4 @@ exports.Operation = Operation; exports.Callback = Callback; exports.Webhook = We
|
|
|
1841
1854
|
* @license Apache-2.0
|
|
1842
1855
|
* @see {@link https://github.com/swagger-api/swagger-ui/blob/master/src/core/plugins/samples/fn.js}
|
|
1843
1856
|
*/
|
|
1844
|
-
//# sourceMappingURL=chunk-
|
|
1857
|
+
//# sourceMappingURL=chunk-SEIG2ZZR.cjs.map
|