oas 37.1.0 → 37.2.0
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/{chunk-6APWNY54.js → chunk-6QP66C5V.js} +53 -57
- package/dist/chunk-6QP66C5V.js.map +1 -0
- package/dist/{chunk-OWMXX4EB.cjs → chunk-GPOPN7TQ.cjs} +53 -57
- package/dist/chunk-GPOPN7TQ.cjs.map +1 -0
- package/dist/{chunk-I7R3WTTN.js → chunk-LOR5XCEP.js} +2 -2
- package/dist/{chunk-QPYARJRD.cjs → chunk-YCSVUVAC.cjs} +70 -70
- package/dist/{chunk-QPYARJRD.cjs.map → chunk-YCSVUVAC.cjs.map} +1 -1
- package/dist/index.cjs +27 -27
- package/dist/index.js +2 -2
- 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-6APWNY54.js.map +0 -1
- package/dist/chunk-OWMXX4EB.cjs.map +0 -1
- /package/dist/{chunk-I7R3WTTN.js.map → chunk-LOR5XCEP.js.map} +0 -0
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
|
|
18
|
-
var
|
|
18
|
+
var _chunkGPOPN7TQcjs = require('./chunk-GPOPN7TQ.cjs');
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
var _chunk6HXOZ5GYcjs = require('./chunk-6HXOZ5GY.cjs');
|
|
@@ -108,7 +108,7 @@ function splitUrlFromServers(servers, selected = 0) {
|
|
|
108
108
|
});
|
|
109
109
|
}
|
|
110
110
|
function transformURLIntoRegex(url) {
|
|
111
|
-
return stripTrailingSlash(url.replace(
|
|
111
|
+
return stripTrailingSlash(url.replace(_chunkGPOPN7TQcjs.SERVER_VARIABLE_REGEX, "([-_a-zA-Z0-9:.[\\]]+)"));
|
|
112
112
|
}
|
|
113
113
|
function normalizePath(path) {
|
|
114
114
|
return path.replace(/({?){(.*?)}(}?)/g, (str, ...args) => {
|
|
@@ -206,7 +206,7 @@ function usesPolymorphism(schema) {
|
|
|
206
206
|
return false;
|
|
207
207
|
}
|
|
208
208
|
function objectify(thing) {
|
|
209
|
-
if (!
|
|
209
|
+
if (!_chunkGPOPN7TQcjs.isObject.call(void 0, thing)) {
|
|
210
210
|
return {};
|
|
211
211
|
}
|
|
212
212
|
return thing;
|
|
@@ -271,7 +271,7 @@ function sampleFromSchema(schema, opts = {}) {
|
|
|
271
271
|
if (seenRefs.has(refToRelease)) {
|
|
272
272
|
return void 0;
|
|
273
273
|
}
|
|
274
|
-
objectifySchema =
|
|
274
|
+
objectifySchema = _chunkGPOPN7TQcjs.dereferenceRef.call(void 0, objectifySchema, opts.definition, seenRefs);
|
|
275
275
|
if (!objectifySchema || _chunk7PWF3F2Wcjs.isRef.call(void 0, objectifySchema)) {
|
|
276
276
|
return void 0;
|
|
277
277
|
}
|
|
@@ -289,7 +289,7 @@ function sampleFromResolvedSchema(schema, opts, seenRefs) {
|
|
|
289
289
|
const { example, additionalProperties, properties, items } = schema;
|
|
290
290
|
const { includeReadOnly, includeWriteOnly } = opts;
|
|
291
291
|
if (example !== void 0) {
|
|
292
|
-
return
|
|
292
|
+
return _chunkGPOPN7TQcjs.dereferenceRefDeep.call(void 0, example, opts.definition, seenRefs);
|
|
293
293
|
}
|
|
294
294
|
const hasPolymorphism = usesPolymorphism(schema);
|
|
295
295
|
if (hasPolymorphism === "allOf") {
|
|
@@ -298,7 +298,7 @@ function sampleFromResolvedSchema(schema, opts, seenRefs) {
|
|
|
298
298
|
const resolvedAllOf = schema.allOf.map((subSchema) => {
|
|
299
299
|
let sub = objectify(subSchema);
|
|
300
300
|
if (definition && _chunk7PWF3F2Wcjs.isRef.call(void 0, sub)) {
|
|
301
|
-
const resolved =
|
|
301
|
+
const resolved = _chunkGPOPN7TQcjs.dereferenceRef.call(void 0, sub, definition, /* @__PURE__ */ new Set());
|
|
302
302
|
if (resolved && !_chunk7PWF3F2Wcjs.isRef.call(void 0, resolved)) {
|
|
303
303
|
sub = resolved;
|
|
304
304
|
}
|
|
@@ -409,8 +409,8 @@ function sampleFromResolvedSchema(schema, opts, seenRefs) {
|
|
|
409
409
|
// src/operation/lib/get-mediatype-examples.ts
|
|
410
410
|
function getMediaTypeExamples(mediaType, mediaTypeObject, definition, opts = {}) {
|
|
411
411
|
if (mediaTypeObject.example) {
|
|
412
|
-
mediaTypeObject.example =
|
|
413
|
-
if (mediaTypeObject.example === void 0 ||
|
|
412
|
+
mediaTypeObject.example = _chunkGPOPN7TQcjs.dereferenceRefDeep.call(void 0, mediaTypeObject.example, definition);
|
|
413
|
+
if (mediaTypeObject.example === void 0 || _chunkGPOPN7TQcjs.collectRefsInSchema.call(void 0, mediaTypeObject.example).size > 0) {
|
|
414
414
|
return [];
|
|
415
415
|
}
|
|
416
416
|
return [
|
|
@@ -426,7 +426,7 @@ function getMediaTypeExamples(mediaType, mediaTypeObject, definition, opts = {})
|
|
|
426
426
|
let example = examples[key];
|
|
427
427
|
if (example !== null && typeof example === "object") {
|
|
428
428
|
if (_chunk7PWF3F2Wcjs.isRef.call(void 0, example)) {
|
|
429
|
-
example =
|
|
429
|
+
example = _chunkGPOPN7TQcjs.dereferenceRef.call(void 0, example, definition);
|
|
430
430
|
if (!example || _chunk7PWF3F2Wcjs.isRef.call(void 0, example)) {
|
|
431
431
|
return false;
|
|
432
432
|
}
|
|
@@ -438,8 +438,8 @@ function getMediaTypeExamples(mediaType, mediaTypeObject, definition, opts = {})
|
|
|
438
438
|
description = example.description;
|
|
439
439
|
}
|
|
440
440
|
if ("value" in example) {
|
|
441
|
-
example.value =
|
|
442
|
-
if (example.value === void 0 ||
|
|
441
|
+
example.value = _chunkGPOPN7TQcjs.dereferenceRefDeep.call(void 0, example.value, definition);
|
|
442
|
+
if (example.value === void 0 || _chunkGPOPN7TQcjs.collectRefsInSchema.call(void 0, example.value).size > 0) {
|
|
443
443
|
return false;
|
|
444
444
|
}
|
|
445
445
|
example = example.value;
|
|
@@ -456,7 +456,7 @@ function getMediaTypeExamples(mediaType, mediaTypeObject, definition, opts = {})
|
|
|
456
456
|
}
|
|
457
457
|
}
|
|
458
458
|
if (mediaTypeObject.schema) {
|
|
459
|
-
if (!
|
|
459
|
+
if (!_chunkGPOPN7TQcjs.matches_mimetype_default.xml(mediaType)) {
|
|
460
460
|
return [
|
|
461
461
|
{
|
|
462
462
|
value: sampleFromSchema(structuredClone(mediaTypeObject.schema), {
|
|
@@ -477,7 +477,7 @@ function getResponseExamples(operation, definition) {
|
|
|
477
477
|
let onlyHeaders = false;
|
|
478
478
|
if (!response) return false;
|
|
479
479
|
if (_chunk7PWF3F2Wcjs.isRef.call(void 0, response)) {
|
|
480
|
-
response =
|
|
480
|
+
response = _chunkGPOPN7TQcjs.dereferenceRef.call(void 0, response, definition);
|
|
481
481
|
if (!response || _chunk7PWF3F2Wcjs.isRef.call(void 0, response)) return false;
|
|
482
482
|
}
|
|
483
483
|
const mediaTypes = {};
|
|
@@ -517,14 +517,14 @@ function getCallbackExamples(operation, definition) {
|
|
|
517
517
|
let callback = _optionalChain([operation, 'access', _24 => _24.callbacks, 'optionalAccess', _25 => _25[identifier]]);
|
|
518
518
|
if (!callback) return [];
|
|
519
519
|
if (_chunk7PWF3F2Wcjs.isRef.call(void 0, callback)) {
|
|
520
|
-
callback =
|
|
520
|
+
callback = _chunkGPOPN7TQcjs.dereferenceRef.call(void 0, callback, definition);
|
|
521
521
|
if (!callback || _chunk7PWF3F2Wcjs.isRef.call(void 0, callback)) return [];
|
|
522
522
|
}
|
|
523
523
|
const items = Object.keys(callback).map((expression) => {
|
|
524
524
|
let callbackPath = callback[expression];
|
|
525
525
|
if (!callbackPath) return [];
|
|
526
526
|
if (_chunk7PWF3F2Wcjs.isRef.call(void 0, callbackPath)) {
|
|
527
|
-
callbackPath =
|
|
527
|
+
callbackPath = _chunkGPOPN7TQcjs.dereferenceRef.call(void 0, callbackPath, definition);
|
|
528
528
|
if (!callbackPath || _chunk7PWF3F2Wcjs.isRef.call(void 0, callbackPath)) return [];
|
|
529
529
|
}
|
|
530
530
|
return Object.keys(callbackPath).map((method) => {
|
|
@@ -607,7 +607,7 @@ function getExampleGroups(operation) {
|
|
|
607
607
|
Object.entries(param.examples || {}).forEach(([exampleKey, paramExample]) => {
|
|
608
608
|
let example = paramExample;
|
|
609
609
|
if (_chunk7PWF3F2Wcjs.isRef.call(void 0, example)) {
|
|
610
|
-
example =
|
|
610
|
+
example = _chunkGPOPN7TQcjs.dereferenceRef.call(void 0, example, operation.api);
|
|
611
611
|
if (!example || _chunk7PWF3F2Wcjs.isRef.call(void 0, example)) return;
|
|
612
612
|
}
|
|
613
613
|
groups[exampleKey] = {
|
|
@@ -655,7 +655,7 @@ function getRequestBodyExamples(operation, definition) {
|
|
|
655
655
|
if (!requestBody) {
|
|
656
656
|
return [];
|
|
657
657
|
} else if (_chunk7PWF3F2Wcjs.isRef.call(void 0, requestBody)) {
|
|
658
|
-
requestBody =
|
|
658
|
+
requestBody = _chunkGPOPN7TQcjs.dereferenceRef.call(void 0, requestBody, definition);
|
|
659
659
|
}
|
|
660
660
|
if (!requestBody || _chunk7PWF3F2Wcjs.isRef.call(void 0, requestBody) || !requestBody.content) {
|
|
661
661
|
return [];
|
|
@@ -720,7 +720,7 @@ function getOperationId(path, method, operation, opts = {}) {
|
|
|
720
720
|
}
|
|
721
721
|
|
|
722
722
|
// src/operation/transformers/get-response-as-json-schema.ts
|
|
723
|
-
var isJSON =
|
|
723
|
+
var isJSON = _chunkGPOPN7TQcjs.matches_mimetype_default.json;
|
|
724
724
|
function buildHeadersSchema(response, schemaOptions) {
|
|
725
725
|
const headersSchema = {
|
|
726
726
|
type: "object",
|
|
@@ -733,7 +733,7 @@ function buildHeadersSchema(response, schemaOptions) {
|
|
|
733
733
|
let headerEntry = _optionalChain([response, 'access', _52 => _52.headers, 'optionalAccess', _53 => _53[key]]);
|
|
734
734
|
if (!headerEntry) return;
|
|
735
735
|
if (_chunk7PWF3F2Wcjs.isRef.call(void 0, headerEntry)) {
|
|
736
|
-
headerEntry =
|
|
736
|
+
headerEntry = _chunkGPOPN7TQcjs.dereferenceRef.call(void 0, headerEntry, api, seenRefs);
|
|
737
737
|
if (!headerEntry || _chunk7PWF3F2Wcjs.isRef.call(void 0, headerEntry)) return;
|
|
738
738
|
}
|
|
739
739
|
if (headerEntry.schema) {
|
|
@@ -741,10 +741,10 @@ function buildHeadersSchema(response, schemaOptions) {
|
|
|
741
741
|
let headerSchema = header.schema;
|
|
742
742
|
if (!headerSchema) return;
|
|
743
743
|
if (_chunk7PWF3F2Wcjs.isRef.call(void 0, headerSchema)) {
|
|
744
|
-
headerSchema =
|
|
744
|
+
headerSchema = _chunkGPOPN7TQcjs.dereferenceRef.call(void 0, headerSchema, api, seenRefs);
|
|
745
745
|
if (!headerSchema || _chunk7PWF3F2Wcjs.isRef.call(void 0, headerSchema)) return;
|
|
746
746
|
}
|
|
747
|
-
headersSchema.properties[key] =
|
|
747
|
+
headersSchema.properties[key] = _chunkGPOPN7TQcjs.toJSONSchema.call(void 0, _chunkGPOPN7TQcjs.cloneObject.call(void 0, headerSchema), {
|
|
748
748
|
addEnumsToDescriptions: true,
|
|
749
749
|
...schemaOptions
|
|
750
750
|
});
|
|
@@ -798,32 +798,32 @@ function getResponseAsJSONSchema(operation, api, statusCode, opts) {
|
|
|
798
798
|
}
|
|
799
799
|
if (preferredContentType) {
|
|
800
800
|
if (contentTypes.includes(preferredContentType)) {
|
|
801
|
-
const schema2 =
|
|
801
|
+
const schema2 = _chunkGPOPN7TQcjs.cloneObject.call(void 0, content[preferredContentType].schema);
|
|
802
802
|
if (!schema2) {
|
|
803
803
|
return null;
|
|
804
804
|
}
|
|
805
|
-
return
|
|
805
|
+
return _chunkGPOPN7TQcjs.toJSONSchema.call(void 0, schema2, baseSchemaOptions);
|
|
806
806
|
}
|
|
807
807
|
return null;
|
|
808
808
|
}
|
|
809
809
|
for (let i = 0; i < contentTypes.length; i++) {
|
|
810
810
|
if (isJSON(contentTypes[i])) {
|
|
811
|
-
const schema2 =
|
|
811
|
+
const schema2 = _chunkGPOPN7TQcjs.cloneObject.call(void 0, content[contentTypes[i]].schema);
|
|
812
812
|
if (!schema2) {
|
|
813
813
|
return {};
|
|
814
814
|
}
|
|
815
|
-
return
|
|
815
|
+
return _chunkGPOPN7TQcjs.toJSONSchema.call(void 0, schema2, baseSchemaOptions);
|
|
816
816
|
}
|
|
817
817
|
}
|
|
818
818
|
const contentType = contentTypes.shift();
|
|
819
819
|
if (!contentType) {
|
|
820
820
|
return {};
|
|
821
821
|
}
|
|
822
|
-
const schema =
|
|
822
|
+
const schema = _chunkGPOPN7TQcjs.cloneObject.call(void 0, content[contentType].schema);
|
|
823
823
|
if (!schema) {
|
|
824
824
|
return {};
|
|
825
825
|
}
|
|
826
|
-
return
|
|
826
|
+
return _chunkGPOPN7TQcjs.toJSONSchema.call(void 0, schema, baseSchemaOptions);
|
|
827
827
|
}
|
|
828
828
|
const foundSchema = getPreferredSchema(response.content, _optionalChain([opts, 'optionalAccess', _54 => _54.contentType]));
|
|
829
829
|
if (_optionalChain([opts, 'optionalAccess', _55 => _55.contentType]) && !foundSchema) {
|
|
@@ -842,23 +842,23 @@ function getResponseAsJSONSchema(operation, api, statusCode, opts) {
|
|
|
842
842
|
// able to render so instead of generating a JSON Schema with an `undefined` type we should
|
|
843
843
|
// default to `string` so there's at least *something* the end-user can interact with.
|
|
844
844
|
type: _nullishCoalesce(schemaType, () => ( "string")),
|
|
845
|
-
schema:
|
|
845
|
+
schema: _chunkGPOPN7TQcjs.isPrimitive.call(void 0, schema) ? schema : {
|
|
846
846
|
...schema,
|
|
847
|
-
$schema:
|
|
847
|
+
$schema: _chunkGPOPN7TQcjs.getSchemaVersionString.call(void 0, schema, api)
|
|
848
848
|
},
|
|
849
849
|
label: "Response body"
|
|
850
850
|
};
|
|
851
851
|
if (response.description && schemaWrapper.schema) {
|
|
852
852
|
schemaWrapper.description = response.description;
|
|
853
853
|
}
|
|
854
|
-
|
|
854
|
+
_chunkGPOPN7TQcjs.applyDiscriminatorOneOfToUsedSchemas.call(void 0, api, usedSchemas, (ref) => {
|
|
855
855
|
if (usedSchemas.has(ref)) {
|
|
856
856
|
return usedSchemas.get(ref);
|
|
857
857
|
}
|
|
858
858
|
try {
|
|
859
|
-
const resolved =
|
|
859
|
+
const resolved = _chunkGPOPN7TQcjs.dereferenceRef.call(void 0, { $ref: ref }, api, seenRefs);
|
|
860
860
|
if (_chunk7PWF3F2Wcjs.isRef.call(void 0, resolved)) return;
|
|
861
|
-
const converted =
|
|
861
|
+
const converted = _chunkGPOPN7TQcjs.toJSONSchema.call(void 0, structuredClone(resolved), {
|
|
862
862
|
...baseSchemaOptions,
|
|
863
863
|
seenRefs
|
|
864
864
|
});
|
|
@@ -868,11 +868,11 @@ function getResponseAsJSONSchema(operation, api, statusCode, opts) {
|
|
|
868
868
|
}
|
|
869
869
|
});
|
|
870
870
|
if (schemaWrapper.schema && usedSchemas.size > 0) {
|
|
871
|
-
const refsInOutput =
|
|
871
|
+
const refsInOutput = _chunkGPOPN7TQcjs.collectRefsInSchema.call(void 0, schemaWrapper.schema);
|
|
872
872
|
const refsInGroup = _nullishCoalesce(refsByGroup.get("body"), () => ( /* @__PURE__ */ new Set()));
|
|
873
|
-
const referencedSchemas =
|
|
873
|
+
const referencedSchemas = _chunkGPOPN7TQcjs.filterRequiredRefsToReferenced.call(void 0, /* @__PURE__ */ new Set([...refsInGroup, ...refsInOutput]), usedSchemas);
|
|
874
874
|
if (referencedSchemas.size > 0) {
|
|
875
|
-
|
|
875
|
+
_chunkGPOPN7TQcjs.mergeReferencedSchemasIntoRoot.call(void 0, schemaWrapper.schema, referencedSchemas);
|
|
876
876
|
}
|
|
877
877
|
}
|
|
878
878
|
jsonSchema.push(schemaWrapper);
|
|
@@ -884,10 +884,10 @@ function getResponseAsJSONSchema(operation, api, statusCode, opts) {
|
|
|
884
884
|
});
|
|
885
885
|
if (headersWrapper.schema && usedSchemas.size > 0) {
|
|
886
886
|
const refsInGroup = _nullishCoalesce(refsByGroup.get("headers"), () => ( /* @__PURE__ */ new Set()));
|
|
887
|
-
const refsInOutput =
|
|
888
|
-
const referencedSchemas =
|
|
887
|
+
const refsInOutput = _chunkGPOPN7TQcjs.collectRefsInSchema.call(void 0, headersWrapper.schema);
|
|
888
|
+
const referencedSchemas = _chunkGPOPN7TQcjs.filterRequiredRefsToReferenced.call(void 0, /* @__PURE__ */ new Set([...refsInGroup, ...refsInOutput]), usedSchemas);
|
|
889
889
|
if (referencedSchemas.size > 0) {
|
|
890
|
-
|
|
890
|
+
_chunkGPOPN7TQcjs.mergeReferencedSchemasIntoRoot.call(void 0, headersWrapper.schema, referencedSchemas);
|
|
891
891
|
}
|
|
892
892
|
}
|
|
893
893
|
jsonSchema.push(headersWrapper);
|
|
@@ -998,7 +998,7 @@ var Operation = class {
|
|
|
998
998
|
return this.schema.servers;
|
|
999
999
|
}
|
|
1000
1000
|
if (_optionalChain([this, 'access', _71 => _71.api, 'access', _72 => _72.paths, 'optionalAccess', _73 => _73[this.path]])) {
|
|
1001
|
-
const pathItem =
|
|
1001
|
+
const pathItem = _chunkGPOPN7TQcjs.dereferenceRef.call(void 0, this.api.paths[this.path], this.api);
|
|
1002
1002
|
if (pathItem && !_chunk7PWF3F2Wcjs.isRef.call(void 0, pathItem) && _optionalChain([pathItem, 'access', _74 => _74.servers, 'optionalAccess', _75 => _75.length])) {
|
|
1003
1003
|
return pathItem.servers;
|
|
1004
1004
|
}
|
|
@@ -1032,7 +1032,7 @@ var Operation = class {
|
|
|
1032
1032
|
let types = [];
|
|
1033
1033
|
if (this.schema.requestBody) {
|
|
1034
1034
|
if (_chunk7PWF3F2Wcjs.isRef.call(void 0, this.schema.requestBody)) {
|
|
1035
|
-
this.schema.requestBody =
|
|
1035
|
+
this.schema.requestBody = _chunkGPOPN7TQcjs.dereferenceRef.call(void 0, this.schema.requestBody, this.api);
|
|
1036
1036
|
}
|
|
1037
1037
|
if (this.schema.requestBody && "content" in this.schema.requestBody) {
|
|
1038
1038
|
types = Object.keys(this.schema.requestBody.content);
|
|
@@ -1043,7 +1043,7 @@ var Operation = class {
|
|
|
1043
1043
|
this.contentType = types[0];
|
|
1044
1044
|
}
|
|
1045
1045
|
types.forEach((t) => {
|
|
1046
|
-
if (
|
|
1046
|
+
if (_chunkGPOPN7TQcjs.matches_mimetype_default.json(t)) {
|
|
1047
1047
|
this.contentType = t;
|
|
1048
1048
|
}
|
|
1049
1049
|
});
|
|
@@ -1056,7 +1056,7 @@ var Operation = class {
|
|
|
1056
1056
|
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.2.md#user-content-request-body-content}
|
|
1057
1057
|
*/
|
|
1058
1058
|
isFormUrlEncoded() {
|
|
1059
|
-
return
|
|
1059
|
+
return _chunkGPOPN7TQcjs.matches_mimetype_default.formUrlEncoded(this.getContentType());
|
|
1060
1060
|
}
|
|
1061
1061
|
/**
|
|
1062
1062
|
* Checks if the current operation has a mutipart content type payload.
|
|
@@ -1065,7 +1065,7 @@ var Operation = class {
|
|
|
1065
1065
|
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.2.md#user-content-request-body-content}
|
|
1066
1066
|
*/
|
|
1067
1067
|
isMultipart() {
|
|
1068
|
-
return
|
|
1068
|
+
return _chunkGPOPN7TQcjs.matches_mimetype_default.multipart(this.getContentType());
|
|
1069
1069
|
}
|
|
1070
1070
|
/**
|
|
1071
1071
|
* Checks if the current operation has a JSON-like content type payload.
|
|
@@ -1074,7 +1074,7 @@ var Operation = class {
|
|
|
1074
1074
|
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.2.md#user-content-request-body-content}
|
|
1075
1075
|
*/
|
|
1076
1076
|
isJson() {
|
|
1077
|
-
return
|
|
1077
|
+
return _chunkGPOPN7TQcjs.matches_mimetype_default.json(this.getContentType());
|
|
1078
1078
|
}
|
|
1079
1079
|
/**
|
|
1080
1080
|
* Checks if the current operation has an XML content type payload.
|
|
@@ -1083,7 +1083,7 @@ var Operation = class {
|
|
|
1083
1083
|
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.2.md#user-content-request-body-content}
|
|
1084
1084
|
*/
|
|
1085
1085
|
isXml() {
|
|
1086
|
-
return
|
|
1086
|
+
return _chunkGPOPN7TQcjs.matches_mimetype_default.xml(this.getContentType());
|
|
1087
1087
|
}
|
|
1088
1088
|
/**
|
|
1089
1089
|
* Checks if the current operation is a webhook or not.
|
|
@@ -1131,7 +1131,7 @@ var Operation = class {
|
|
|
1131
1131
|
security = _optionalChain([this, 'access', _80 => _80.api, 'optionalAccess', _81 => _81.components, 'optionalAccess', _82 => _82.securitySchemes, 'optionalAccess', _83 => _83[key]]);
|
|
1132
1132
|
if (!security) return false;
|
|
1133
1133
|
if (_chunk7PWF3F2Wcjs.isRef.call(void 0, security)) {
|
|
1134
|
-
security =
|
|
1134
|
+
security = _chunkGPOPN7TQcjs.dereferenceRef.call(void 0, security, this.api);
|
|
1135
1135
|
if (!security || _chunk7PWF3F2Wcjs.isRef.call(void 0, security)) return false;
|
|
1136
1136
|
}
|
|
1137
1137
|
} catch (e6) {
|
|
@@ -1212,7 +1212,7 @@ var Operation = class {
|
|
|
1212
1212
|
this.schema.parameters.map((p) => {
|
|
1213
1213
|
let param = p;
|
|
1214
1214
|
if (_chunk7PWF3F2Wcjs.isRef.call(void 0, param)) {
|
|
1215
|
-
param =
|
|
1215
|
+
param = _chunkGPOPN7TQcjs.dereferenceRef.call(void 0, param, this.api);
|
|
1216
1216
|
if (!param || _chunk7PWF3F2Wcjs.isRef.call(void 0, param)) return;
|
|
1217
1217
|
}
|
|
1218
1218
|
if (param.in && param.in === "header") return param.name;
|
|
@@ -1225,7 +1225,7 @@ var Operation = class {
|
|
|
1225
1225
|
let response = this.schema.responses[r];
|
|
1226
1226
|
if (!response) return [];
|
|
1227
1227
|
if (_chunk7PWF3F2Wcjs.isRef.call(void 0, response)) {
|
|
1228
|
-
this.schema.responses[r] =
|
|
1228
|
+
this.schema.responses[r] = _chunkGPOPN7TQcjs.dereferenceRef.call(void 0, response, this.api);
|
|
1229
1229
|
response = this.schema.responses[r];
|
|
1230
1230
|
if (!response || _chunk7PWF3F2Wcjs.isRef.call(void 0, response)) {
|
|
1231
1231
|
return [];
|
|
@@ -1238,7 +1238,7 @@ var Operation = class {
|
|
|
1238
1238
|
let requestBody = this.schema.requestBody;
|
|
1239
1239
|
if (requestBody) {
|
|
1240
1240
|
if (_chunk7PWF3F2Wcjs.isRef.call(void 0, requestBody)) {
|
|
1241
|
-
this.schema.requestBody =
|
|
1241
|
+
this.schema.requestBody = _chunkGPOPN7TQcjs.dereferenceRef.call(void 0, requestBody, this.api);
|
|
1242
1242
|
requestBody = this.schema.requestBody;
|
|
1243
1243
|
}
|
|
1244
1244
|
if (requestBody && !_chunk7PWF3F2Wcjs.isRef.call(void 0, requestBody) && "content" in requestBody && Object.keys(requestBody.content)) {
|
|
@@ -1251,7 +1251,7 @@ var Operation = class {
|
|
|
1251
1251
|
let response = _optionalChain([this, 'access', _87 => _87.schema, 'access', _88 => _88.responses, 'optionalAccess', _89 => _89[r]]);
|
|
1252
1252
|
if (!response) return false;
|
|
1253
1253
|
if (_chunk7PWF3F2Wcjs.isRef.call(void 0, response)) {
|
|
1254
|
-
this.schema.responses[r] =
|
|
1254
|
+
this.schema.responses[r] = _chunkGPOPN7TQcjs.dereferenceRef.call(void 0, response, this.api);
|
|
1255
1255
|
response = this.schema.responses[r];
|
|
1256
1256
|
if (!response || _chunk7PWF3F2Wcjs.isRef.call(void 0, response)) {
|
|
1257
1257
|
return false;
|
|
@@ -1361,7 +1361,7 @@ var Operation = class {
|
|
|
1361
1361
|
let parameters = (_optionalChain([this, 'access', _92 => _92.schema, 'optionalAccess', _93 => _93.parameters]) || []).map((p) => {
|
|
1362
1362
|
let param = p;
|
|
1363
1363
|
if (_chunk7PWF3F2Wcjs.isRef.call(void 0, param)) {
|
|
1364
|
-
param =
|
|
1364
|
+
param = _chunkGPOPN7TQcjs.dereferenceRef.call(void 0, param, this.api);
|
|
1365
1365
|
if (!param || _chunk7PWF3F2Wcjs.isRef.call(void 0, param)) return;
|
|
1366
1366
|
}
|
|
1367
1367
|
return param;
|
|
@@ -1369,7 +1369,7 @@ var Operation = class {
|
|
|
1369
1369
|
const commonParams = (_optionalChain([this, 'access', _94 => _94.api, 'optionalAccess', _95 => _95.paths, 'optionalAccess', _96 => _96[this.path], 'optionalAccess', _97 => _97.parameters]) || []).map((p) => {
|
|
1370
1370
|
let param = p;
|
|
1371
1371
|
if (_chunk7PWF3F2Wcjs.isRef.call(void 0, param)) {
|
|
1372
|
-
param =
|
|
1372
|
+
param = _chunkGPOPN7TQcjs.dereferenceRef.call(void 0, param, this.api);
|
|
1373
1373
|
if (!param || _chunk7PWF3F2Wcjs.isRef.call(void 0, param)) return;
|
|
1374
1374
|
}
|
|
1375
1375
|
return param;
|
|
@@ -1401,8 +1401,8 @@ var Operation = class {
|
|
|
1401
1401
|
*
|
|
1402
1402
|
*/
|
|
1403
1403
|
getParametersAsJSONSchema(opts = {}) {
|
|
1404
|
-
|
|
1405
|
-
return
|
|
1404
|
+
_chunkGPOPN7TQcjs.decorateComponentSchemasWithRefName.call(void 0, this.api);
|
|
1405
|
+
return _chunkGPOPN7TQcjs.getParametersAsJSONSchema.call(void 0, this, this.api, {
|
|
1406
1406
|
includeDiscriminatorMappingRefs: true,
|
|
1407
1407
|
...opts
|
|
1408
1408
|
});
|
|
@@ -1421,7 +1421,7 @@ var Operation = class {
|
|
|
1421
1421
|
* this content-type, the function will return null.
|
|
1422
1422
|
*/
|
|
1423
1423
|
getResponseAsJSONSchema(statusCode, opts = {}) {
|
|
1424
|
-
|
|
1424
|
+
_chunkGPOPN7TQcjs.decorateComponentSchemasWithRefName.call(void 0, this.api);
|
|
1425
1425
|
return getResponseAsJSONSchema(this, this.api, statusCode, {
|
|
1426
1426
|
includeDiscriminatorMappingRefs: true,
|
|
1427
1427
|
...opts
|
|
@@ -1434,7 +1434,7 @@ var Operation = class {
|
|
|
1434
1434
|
getResponseStatusCodes() {
|
|
1435
1435
|
if (!this.schema.responses) return [];
|
|
1436
1436
|
if (_chunk7PWF3F2Wcjs.isRef.call(void 0, this.schema.responses)) {
|
|
1437
|
-
this.schema.responses =
|
|
1437
|
+
this.schema.responses = _chunkGPOPN7TQcjs.dereferenceRef.call(void 0, this.schema.responses, this.api);
|
|
1438
1438
|
if (!this.schema.responses || _chunk7PWF3F2Wcjs.isRef.call(void 0, this.schema.responses)) {
|
|
1439
1439
|
return [];
|
|
1440
1440
|
}
|
|
@@ -1460,7 +1460,7 @@ var Operation = class {
|
|
|
1460
1460
|
let resp = response;
|
|
1461
1461
|
if (!resp) return;
|
|
1462
1462
|
if (_chunk7PWF3F2Wcjs.isRef.call(void 0, resp)) {
|
|
1463
|
-
resp =
|
|
1463
|
+
resp = _chunkGPOPN7TQcjs.dereferenceRef.call(void 0, resp, this.api);
|
|
1464
1464
|
if (!resp || _chunk7PWF3F2Wcjs.isRef.call(void 0, resp)) {
|
|
1465
1465
|
return;
|
|
1466
1466
|
}
|
|
@@ -1489,7 +1489,7 @@ var Operation = class {
|
|
|
1489
1489
|
let requestBody = this.schema.requestBody;
|
|
1490
1490
|
if (!requestBody) return false;
|
|
1491
1491
|
if (_chunk7PWF3F2Wcjs.isRef.call(void 0, requestBody)) {
|
|
1492
|
-
this.schema.requestBody =
|
|
1492
|
+
this.schema.requestBody = _chunkGPOPN7TQcjs.dereferenceRef.call(void 0, requestBody, this.api);
|
|
1493
1493
|
requestBody = this.schema.requestBody;
|
|
1494
1494
|
if (!requestBody || _chunk7PWF3F2Wcjs.isRef.call(void 0, requestBody)) {
|
|
1495
1495
|
return false;
|
|
@@ -1563,7 +1563,7 @@ var Operation = class {
|
|
|
1563
1563
|
let availableMediaType;
|
|
1564
1564
|
const mediaTypes = this.getRequestBodyMediaTypes();
|
|
1565
1565
|
mediaTypes.forEach((mt) => {
|
|
1566
|
-
if (!availableMediaType &&
|
|
1566
|
+
if (!availableMediaType && _chunkGPOPN7TQcjs.matches_mimetype_default.json(mt)) {
|
|
1567
1567
|
availableMediaType = mt;
|
|
1568
1568
|
}
|
|
1569
1569
|
});
|
|
@@ -1611,7 +1611,7 @@ var Operation = class {
|
|
|
1611
1611
|
let response = this.schema.responses[statusCode];
|
|
1612
1612
|
if (!response) return false;
|
|
1613
1613
|
if (_chunk7PWF3F2Wcjs.isRef.call(void 0, response)) {
|
|
1614
|
-
this.schema.responses[statusCode] =
|
|
1614
|
+
this.schema.responses[statusCode] = _chunkGPOPN7TQcjs.dereferenceRef.call(void 0, response, this.api);
|
|
1615
1615
|
response = this.schema.responses[statusCode];
|
|
1616
1616
|
if (!response || _chunk7PWF3F2Wcjs.isRef.call(void 0, response)) {
|
|
1617
1617
|
return false;
|
|
@@ -1655,7 +1655,7 @@ var Operation = class {
|
|
|
1655
1655
|
let callbackObj = this.schema.callbacks[identifier];
|
|
1656
1656
|
if (!callbackObj) return false;
|
|
1657
1657
|
if (_chunk7PWF3F2Wcjs.isRef.call(void 0, callbackObj)) {
|
|
1658
|
-
this.schema.callbacks[identifier] =
|
|
1658
|
+
this.schema.callbacks[identifier] = _chunkGPOPN7TQcjs.dereferenceRef.call(void 0, callbackObj, this.api);
|
|
1659
1659
|
callbackObj = this.schema.callbacks[identifier];
|
|
1660
1660
|
if (!callbackObj || _chunk7PWF3F2Wcjs.isRef.call(void 0, callbackObj)) {
|
|
1661
1661
|
return false;
|
|
@@ -1664,7 +1664,7 @@ var Operation = class {
|
|
|
1664
1664
|
let callback = callbackObj[expression];
|
|
1665
1665
|
if (!callback) return false;
|
|
1666
1666
|
if (_chunk7PWF3F2Wcjs.isRef.call(void 0, callback)) {
|
|
1667
|
-
callbackObj[expression] =
|
|
1667
|
+
callbackObj[expression] = _chunkGPOPN7TQcjs.dereferenceRef.call(void 0, callback, this.api);
|
|
1668
1668
|
callback = callbackObj[expression];
|
|
1669
1669
|
if (!callback || _chunk7PWF3F2Wcjs.isRef.call(void 0, callback)) {
|
|
1670
1670
|
return false;
|
|
@@ -1688,7 +1688,7 @@ var Operation = class {
|
|
|
1688
1688
|
let cb = _optionalChain([this, 'access', _106 => _106.schema, 'access', _107 => _107.callbacks, 'optionalAccess', _108 => _108[callback]]);
|
|
1689
1689
|
if (!cb) return;
|
|
1690
1690
|
if (_chunk7PWF3F2Wcjs.isRef.call(void 0, cb)) {
|
|
1691
|
-
this.schema.callbacks[callback] =
|
|
1691
|
+
this.schema.callbacks[callback] = _chunkGPOPN7TQcjs.dereferenceRef.call(void 0, cb, this.api);
|
|
1692
1692
|
cb = this.schema.callbacks[callback];
|
|
1693
1693
|
if (!cb || _chunk7PWF3F2Wcjs.isRef.call(void 0, cb)) {
|
|
1694
1694
|
return;
|
|
@@ -1698,14 +1698,14 @@ var Operation = class {
|
|
|
1698
1698
|
let callbackPath = cb[expression];
|
|
1699
1699
|
if (!callbackPath) return;
|
|
1700
1700
|
if (_chunk7PWF3F2Wcjs.isRef.call(void 0, callbackPath)) {
|
|
1701
|
-
cb[expression] =
|
|
1701
|
+
cb[expression] = _chunkGPOPN7TQcjs.dereferenceRef.call(void 0, callbackPath, this.api);
|
|
1702
1702
|
callbackPath = cb[expression];
|
|
1703
1703
|
if (!callbackPath || _chunk7PWF3F2Wcjs.isRef.call(void 0, callbackPath)) {
|
|
1704
1704
|
return;
|
|
1705
1705
|
}
|
|
1706
1706
|
}
|
|
1707
1707
|
Object.keys(callbackPath).forEach((method) => {
|
|
1708
|
-
if (!
|
|
1708
|
+
if (!_chunkGPOPN7TQcjs.supportedMethods.includes(method)) return;
|
|
1709
1709
|
const found = this.getCallback(callback, expression, method);
|
|
1710
1710
|
if (found) {
|
|
1711
1711
|
callbacks.push(found);
|
|
@@ -1829,7 +1829,7 @@ var Callback = class extends Operation {
|
|
|
1829
1829
|
let parameters = (_optionalChain([this, 'access', _115 => _115.schema, 'optionalAccess', _116 => _116.parameters]) || []).map((p) => {
|
|
1830
1830
|
let param = p;
|
|
1831
1831
|
if (_chunk7PWF3F2Wcjs.isRef.call(void 0, param)) {
|
|
1832
|
-
param =
|
|
1832
|
+
param = _chunkGPOPN7TQcjs.dereferenceRef.call(void 0, param, this.api);
|
|
1833
1833
|
if (!param || _chunk7PWF3F2Wcjs.isRef.call(void 0, param)) return;
|
|
1834
1834
|
}
|
|
1835
1835
|
return param;
|
|
@@ -1837,7 +1837,7 @@ var Callback = class extends Operation {
|
|
|
1837
1837
|
const commonParams = (this.parentSchema.parameters || []).map((p) => {
|
|
1838
1838
|
let param = p;
|
|
1839
1839
|
if (_chunk7PWF3F2Wcjs.isRef.call(void 0, param)) {
|
|
1840
|
-
param =
|
|
1840
|
+
param = _chunkGPOPN7TQcjs.dereferenceRef.call(void 0, param, this.api);
|
|
1841
1841
|
if (!param || _chunk7PWF3F2Wcjs.isRef.call(void 0, param)) return;
|
|
1842
1842
|
}
|
|
1843
1843
|
return param;
|
|
@@ -1863,7 +1863,7 @@ var Webhook = class extends Operation {
|
|
|
1863
1863
|
}
|
|
1864
1864
|
let webhookPath = this.api.webhooks[this.path];
|
|
1865
1865
|
if (_chunk7PWF3F2Wcjs.isRef.call(void 0, webhookPath)) {
|
|
1866
|
-
this.api.webhooks[this.path] =
|
|
1866
|
+
this.api.webhooks[this.path] = _chunkGPOPN7TQcjs.dereferenceRef.call(void 0, webhookPath, this.api);
|
|
1867
1867
|
webhookPath = this.api.webhooks[this.path];
|
|
1868
1868
|
}
|
|
1869
1869
|
return _optionalChain([webhookPath, 'optionalAccess', _119 => _119.summary]);
|
|
@@ -1882,7 +1882,7 @@ var Webhook = class extends Operation {
|
|
|
1882
1882
|
}
|
|
1883
1883
|
let webhookPath = this.api.webhooks[this.path];
|
|
1884
1884
|
if (_chunk7PWF3F2Wcjs.isRef.call(void 0, webhookPath)) {
|
|
1885
|
-
this.api.webhooks[this.path] =
|
|
1885
|
+
this.api.webhooks[this.path] = _chunkGPOPN7TQcjs.dereferenceRef.call(void 0, webhookPath, this.api);
|
|
1886
1886
|
webhookPath = this.api.webhooks[this.path];
|
|
1887
1887
|
}
|
|
1888
1888
|
return _optionalChain([webhookPath, 'optionalAccess', _122 => _122.description]);
|
|
@@ -1916,4 +1916,4 @@ exports.getUserVariable = getUserVariable; exports.stripTrailingSlash = stripTra
|
|
|
1916
1916
|
* @license Apache-2.0
|
|
1917
1917
|
* @see {@link https://github.com/swagger-api/swagger-ui/blob/master/src/core/plugins/samples/fn.js}
|
|
1918
1918
|
*/
|
|
1919
|
-
//# sourceMappingURL=chunk-
|
|
1919
|
+
//# sourceMappingURL=chunk-YCSVUVAC.cjs.map
|