oas 25.1.0 → 25.2.1
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/README.md +9 -8
- package/dist/analyzer/index.cjs +13 -5
- package/dist/analyzer/index.cjs.map +1 -1
- package/dist/analyzer/index.js +12 -4
- package/dist/analyzer/index.js.map +1 -1
- package/dist/analyzer/types.d.cts +1 -0
- package/dist/analyzer/types.d.ts +1 -0
- package/dist/{chunk-G6ASGSM5.cjs → chunk-4DQE5VZI.cjs} +1 -1
- package/dist/chunk-4DQE5VZI.cjs.map +1 -0
- package/dist/{chunk-MH3THWQH.js → chunk-CLQZGF6D.js} +15 -15
- package/dist/chunk-CLQZGF6D.js.map +1 -0
- package/dist/{chunk-YIKOQY6K.cjs → chunk-CPI37LBJ.cjs} +17 -17
- package/dist/chunk-CPI37LBJ.cjs.map +1 -0
- package/dist/{chunk-ZXCOYYXC.cjs → chunk-DAS55TQF.cjs} +39 -39
- package/dist/{chunk-ZXCOYYXC.cjs.map → chunk-DAS55TQF.cjs.map} +1 -1
- package/dist/{chunk-U7Q7XPMY.js → chunk-QMLWI5HD.js} +1 -1
- package/dist/chunk-QMLWI5HD.js.map +1 -0
- package/dist/{chunk-3I4KH26E.cjs → chunk-TG4VCYD4.cjs} +11 -11
- package/dist/chunk-TG4VCYD4.cjs.map +1 -0
- package/dist/{chunk-GMSH2DQK.js → chunk-V6OITOCT.js} +14 -14
- package/dist/chunk-V6OITOCT.js.map +1 -0
- package/dist/{chunk-LH3S6NWD.js → chunk-W7MR5CC7.js} +2 -2
- package/dist/chunk-W7MR5CC7.js.map +1 -0
- package/dist/{extensions-B4_nMl6M.d.cts → extensions-CaiwqAu-.d.cts} +14 -14
- package/dist/{extensions-BTG_yoHC.d.ts → extensions-DYrxWRh4.d.ts} +14 -14
- package/dist/extensions.d.cts +1 -1
- package/dist/extensions.d.ts +1 -1
- package/dist/index.cjs +5 -5
- package/dist/index.d.cts +12 -12
- package/dist/index.d.ts +12 -12
- package/dist/index.js +4 -4
- package/dist/operation/index.cjs +4 -4
- package/dist/operation/index.d.cts +1 -1
- package/dist/operation/index.d.ts +1 -1
- package/dist/operation/index.js +3 -3
- package/dist/operation/lib/get-parameters-as-json-schema.cjs +3 -3
- package/dist/operation/lib/get-parameters-as-json-schema.d.cts +1 -1
- package/dist/operation/lib/get-parameters-as-json-schema.d.ts +1 -1
- package/dist/operation/lib/get-parameters-as-json-schema.js +2 -2
- package/dist/reducer/index.cjs +1 -2
- package/dist/reducer/index.cjs.map +1 -1
- package/dist/reducer/index.js +1 -2
- package/dist/reducer/index.js.map +1 -1
- package/dist/types.cjs +2 -2
- package/dist/types.d.cts +36 -36
- package/dist/types.d.ts +36 -36
- package/dist/types.js +1 -1
- package/dist/utils.cjs +3 -3
- package/dist/utils.d.cts +1 -1
- package/dist/utils.d.ts +1 -1
- package/dist/utils.js +2 -2
- package/package.json +2 -3
- package/dist/chunk-3I4KH26E.cjs.map +0 -1
- package/dist/chunk-G6ASGSM5.cjs.map +0 -1
- package/dist/chunk-GMSH2DQK.js.map +0 -1
- package/dist/chunk-LH3S6NWD.js.map +0 -1
- package/dist/chunk-MH3THWQH.js.map +0 -1
- package/dist/chunk-U7Q7XPMY.js.map +0 -1
- package/dist/chunk-YIKOQY6K.cjs.map +0 -1
|
@@ -10,13 +10,13 @@ var _chunkVIIXOUMHcjs = require('./chunk-VIIXOUMH.cjs');
|
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
var
|
|
13
|
+
var _chunkTG4VCYD4cjs = require('./chunk-TG4VCYD4.cjs');
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
var _chunkYHO3AOX6cjs = require('./chunk-YHO3AOX6.cjs');
|
|
17
17
|
|
|
18
18
|
|
|
19
|
-
var
|
|
19
|
+
var _chunk4DQE5VZIcjs = require('./chunk-4DQE5VZI.cjs');
|
|
20
20
|
|
|
21
21
|
// src/operation/lib/dedupe-common-parameters.ts
|
|
22
22
|
function dedupeCommonParameters(parameters, commonParameters) {
|
|
@@ -24,7 +24,7 @@ function dedupeCommonParameters(parameters, commonParameters) {
|
|
|
24
24
|
return !parameters.find((param2) => {
|
|
25
25
|
if (param.name && param2.name) {
|
|
26
26
|
return param.name === param2.name && param.in === param2.in;
|
|
27
|
-
} else if (
|
|
27
|
+
} else if (_chunk4DQE5VZIcjs.isRef.call(void 0, param) && _chunk4DQE5VZIcjs.isRef.call(void 0, param2)) {
|
|
28
28
|
return param.$ref === param2.$ref;
|
|
29
29
|
}
|
|
30
30
|
return false;
|
|
@@ -48,7 +48,7 @@ function usesPolymorphism(schema) {
|
|
|
48
48
|
return false;
|
|
49
49
|
}
|
|
50
50
|
function objectify(thing) {
|
|
51
|
-
if (!
|
|
51
|
+
if (!_chunkTG4VCYD4cjs.isObject.call(void 0, thing)) {
|
|
52
52
|
return {};
|
|
53
53
|
}
|
|
54
54
|
return thing;
|
|
@@ -256,7 +256,7 @@ function getMediaTypeExamples(mediaType, mediaTypeObject, opts = {}) {
|
|
|
256
256
|
}
|
|
257
257
|
}
|
|
258
258
|
if (mediaTypeObject.schema) {
|
|
259
|
-
if (!
|
|
259
|
+
if (!_chunkTG4VCYD4cjs.matches_mimetype_default.xml(mediaType)) {
|
|
260
260
|
return [
|
|
261
261
|
{
|
|
262
262
|
// eslint-disable-next-line try-catch-failsafe/json-parse
|
|
@@ -273,7 +273,7 @@ function getResponseExamples(operation) {
|
|
|
273
273
|
return Object.keys(operation.responses || {}).map((status) => {
|
|
274
274
|
const response = operation.responses[status];
|
|
275
275
|
let onlyHeaders = false;
|
|
276
|
-
if (
|
|
276
|
+
if (_chunk4DQE5VZIcjs.isRef.call(void 0, response)) {
|
|
277
277
|
return false;
|
|
278
278
|
}
|
|
279
279
|
const mediaTypes = {};
|
|
@@ -446,7 +446,7 @@ function getRequestBodyExamples(operation) {
|
|
|
446
446
|
}
|
|
447
447
|
|
|
448
448
|
// src/operation/lib/get-response-as-json-schema.ts
|
|
449
|
-
var isJSON =
|
|
449
|
+
var isJSON = _chunkTG4VCYD4cjs.matches_mimetype_default.json;
|
|
450
450
|
function buildHeadersSchema(response, opts) {
|
|
451
451
|
const headers = response.headers;
|
|
452
452
|
const headersSchema = {
|
|
@@ -456,7 +456,7 @@ function buildHeadersSchema(response, opts) {
|
|
|
456
456
|
Object.keys(headers).forEach((key) => {
|
|
457
457
|
if (headers[key] && headers[key].schema) {
|
|
458
458
|
const header = headers[key];
|
|
459
|
-
headersSchema.properties[key] =
|
|
459
|
+
headersSchema.properties[key] = _chunkTG4VCYD4cjs.toJSONSchema.call(void 0, header.schema, {
|
|
460
460
|
addEnumsToDescriptions: true,
|
|
461
461
|
transformer: opts.transformer
|
|
462
462
|
});
|
|
@@ -500,7 +500,7 @@ function getResponseAsJSONSchema(operation, api, statusCode, opts) {
|
|
|
500
500
|
}
|
|
501
501
|
for (let i = 0; i < contentTypes.length; i++) {
|
|
502
502
|
if (isJSON(contentTypes[i])) {
|
|
503
|
-
return
|
|
503
|
+
return _chunkTG4VCYD4cjs.toJSONSchema.call(void 0, _chunkTG4VCYD4cjs.cloneObject.call(void 0, content[contentTypes[i]].schema), {
|
|
504
504
|
addEnumsToDescriptions: true,
|
|
505
505
|
refLogger,
|
|
506
506
|
transformer: opts.transformer
|
|
@@ -508,7 +508,7 @@ function getResponseAsJSONSchema(operation, api, statusCode, opts) {
|
|
|
508
508
|
}
|
|
509
509
|
}
|
|
510
510
|
const contentType = contentTypes.shift();
|
|
511
|
-
return
|
|
511
|
+
return _chunkTG4VCYD4cjs.toJSONSchema.call(void 0, _chunkTG4VCYD4cjs.cloneObject.call(void 0, content[contentType].schema), {
|
|
512
512
|
addEnumsToDescriptions: true,
|
|
513
513
|
refLogger,
|
|
514
514
|
transformer: opts.transformer
|
|
@@ -516,15 +516,15 @@ function getResponseAsJSONSchema(operation, api, statusCode, opts) {
|
|
|
516
516
|
}
|
|
517
517
|
const foundSchema = getPreferredSchema(response.content);
|
|
518
518
|
if (foundSchema) {
|
|
519
|
-
const schema =
|
|
519
|
+
const schema = _chunkTG4VCYD4cjs.cloneObject.call(void 0, foundSchema);
|
|
520
520
|
const schemaWrapper = {
|
|
521
521
|
// If there's no `type` then the root schema is a circular `$ref` that we likely won't be
|
|
522
522
|
// able to render so instead of generating a JSON Schema with an `undefined` type we should
|
|
523
523
|
// default to `string` so there's at least *something* the end-user can interact with.
|
|
524
524
|
type: foundSchema.type || "string",
|
|
525
|
-
schema:
|
|
525
|
+
schema: _chunkTG4VCYD4cjs.isPrimitive.call(void 0, schema) ? schema : {
|
|
526
526
|
...schema,
|
|
527
|
-
$schema:
|
|
527
|
+
$schema: _chunkTG4VCYD4cjs.getSchemaVersionString.call(void 0, schema, api)
|
|
528
528
|
},
|
|
529
529
|
label: "Response body"
|
|
530
530
|
};
|
|
@@ -591,23 +591,23 @@ var Operation = class {
|
|
|
591
591
|
this.contentType = types[0];
|
|
592
592
|
}
|
|
593
593
|
types.forEach((t) => {
|
|
594
|
-
if (
|
|
594
|
+
if (_chunkTG4VCYD4cjs.matches_mimetype_default.json(t)) {
|
|
595
595
|
this.contentType = t;
|
|
596
596
|
}
|
|
597
597
|
});
|
|
598
598
|
return this.contentType;
|
|
599
599
|
}
|
|
600
600
|
isFormUrlEncoded() {
|
|
601
|
-
return
|
|
601
|
+
return _chunkTG4VCYD4cjs.matches_mimetype_default.formUrlEncoded(this.getContentType());
|
|
602
602
|
}
|
|
603
603
|
isMultipart() {
|
|
604
|
-
return
|
|
604
|
+
return _chunkTG4VCYD4cjs.matches_mimetype_default.multipart(this.getContentType());
|
|
605
605
|
}
|
|
606
606
|
isJson() {
|
|
607
|
-
return
|
|
607
|
+
return _chunkTG4VCYD4cjs.matches_mimetype_default.json(this.getContentType());
|
|
608
608
|
}
|
|
609
609
|
isXml() {
|
|
610
|
-
return
|
|
610
|
+
return _chunkTG4VCYD4cjs.matches_mimetype_default.xml(this.getContentType());
|
|
611
611
|
}
|
|
612
612
|
/**
|
|
613
613
|
* Checks if the current operation is a webhook or not.
|
|
@@ -634,7 +634,7 @@ var Operation = class {
|
|
|
634
634
|
*
|
|
635
635
|
* @see {@link https://swagger.io/docs/specification/authentication/#multiple}
|
|
636
636
|
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#security-requirement-object}
|
|
637
|
-
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#
|
|
637
|
+
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#security-requirement-object}
|
|
638
638
|
* @param filterInvalid Optional flag that, when set to `true`, filters out invalid/nonexistent
|
|
639
639
|
* security schemes, rather than returning `false`.
|
|
640
640
|
*/
|
|
@@ -874,7 +874,7 @@ var Operation = class {
|
|
|
874
874
|
*
|
|
875
875
|
*/
|
|
876
876
|
getParametersAsJSONSchema(opts = {}) {
|
|
877
|
-
return
|
|
877
|
+
return _chunkTG4VCYD4cjs.getParametersAsJSONSchema.call(void 0, this, this.api, {
|
|
878
878
|
includeDiscriminatorMappingRefs: true,
|
|
879
879
|
transformer: (s) => s,
|
|
880
880
|
...opts
|
|
@@ -909,15 +909,15 @@ var Operation = class {
|
|
|
909
909
|
/**
|
|
910
910
|
* Retrieve the list of all available media types that the operations request body can accept.
|
|
911
911
|
*
|
|
912
|
-
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#
|
|
913
|
-
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#
|
|
912
|
+
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#media-type-object}
|
|
913
|
+
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#media-type-object}
|
|
914
914
|
*/
|
|
915
915
|
getRequestBodyMediaTypes() {
|
|
916
916
|
if (!this.hasRequestBody()) {
|
|
917
917
|
return [];
|
|
918
918
|
}
|
|
919
919
|
const requestBody = this.schema.requestBody;
|
|
920
|
-
if (
|
|
920
|
+
if (_chunk4DQE5VZIcjs.isRef.call(void 0, requestBody)) {
|
|
921
921
|
return [];
|
|
922
922
|
}
|
|
923
923
|
return Object.keys(requestBody.content);
|
|
@@ -931,7 +931,7 @@ var Operation = class {
|
|
|
931
931
|
return false;
|
|
932
932
|
}
|
|
933
933
|
const requestBody = this.schema.requestBody;
|
|
934
|
-
if (
|
|
934
|
+
if (_chunk4DQE5VZIcjs.isRef.call(void 0, requestBody)) {
|
|
935
935
|
return false;
|
|
936
936
|
}
|
|
937
937
|
if (requestBody.required) {
|
|
@@ -947,8 +947,8 @@ var Operation = class {
|
|
|
947
947
|
* comes back it's in the form of an array with the first key being the selected media type,
|
|
948
948
|
* followed by the media type object in question.
|
|
949
949
|
*
|
|
950
|
-
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#
|
|
951
|
-
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#
|
|
950
|
+
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#media-type-object}
|
|
951
|
+
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#media-type-object}
|
|
952
952
|
* @param mediaType Specific request body media type to retrieve if present.
|
|
953
953
|
*/
|
|
954
954
|
getRequestBody(mediaType) {
|
|
@@ -956,7 +956,7 @@ var Operation = class {
|
|
|
956
956
|
return false;
|
|
957
957
|
}
|
|
958
958
|
const requestBody = this.schema.requestBody;
|
|
959
|
-
if (
|
|
959
|
+
if (_chunk4DQE5VZIcjs.isRef.call(void 0, requestBody)) {
|
|
960
960
|
return false;
|
|
961
961
|
}
|
|
962
962
|
if (mediaType) {
|
|
@@ -968,7 +968,7 @@ var Operation = class {
|
|
|
968
968
|
let availableMediaType;
|
|
969
969
|
const mediaTypes = this.getRequestBodyMediaTypes();
|
|
970
970
|
mediaTypes.forEach((mt) => {
|
|
971
|
-
if (!availableMediaType &&
|
|
971
|
+
if (!availableMediaType && _chunkTG4VCYD4cjs.matches_mimetype_default.json(mt)) {
|
|
972
972
|
availableMediaType = mt;
|
|
973
973
|
}
|
|
974
974
|
});
|
|
@@ -1013,7 +1013,7 @@ var Operation = class {
|
|
|
1013
1013
|
return false;
|
|
1014
1014
|
}
|
|
1015
1015
|
const response = this.schema.responses[statusCode];
|
|
1016
|
-
if (
|
|
1016
|
+
if (_chunk4DQE5VZIcjs.isRef.call(void 0, response)) {
|
|
1017
1017
|
return false;
|
|
1018
1018
|
}
|
|
1019
1019
|
return response;
|
|
@@ -1039,8 +1039,8 @@ var Operation = class {
|
|
|
1039
1039
|
/**
|
|
1040
1040
|
* Retrieve a specific callback.
|
|
1041
1041
|
*
|
|
1042
|
-
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#
|
|
1043
|
-
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#
|
|
1042
|
+
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#callback-object}
|
|
1043
|
+
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#callback-object}
|
|
1044
1044
|
* @param identifier Callback identifier to look for.
|
|
1045
1045
|
* @param expression Callback expression to look for.
|
|
1046
1046
|
* @param method HTTP Method on the callback to look for.
|
|
@@ -1061,9 +1061,9 @@ var Operation = class {
|
|
|
1061
1061
|
Object.keys(this.schema.callbacks).forEach((callback) => {
|
|
1062
1062
|
Object.keys(this.schema.callbacks[callback]).forEach((expression) => {
|
|
1063
1063
|
const cb = this.schema.callbacks[callback];
|
|
1064
|
-
if (!
|
|
1064
|
+
if (!_chunk4DQE5VZIcjs.isRef.call(void 0, cb)) {
|
|
1065
1065
|
const exp = cb[expression];
|
|
1066
|
-
if (!
|
|
1066
|
+
if (!_chunk4DQE5VZIcjs.isRef.call(void 0, exp)) {
|
|
1067
1067
|
Object.keys(exp).forEach((method) => {
|
|
1068
1068
|
if (!_chunkVIIXOUMHcjs.supportedMethods.has(method)) return;
|
|
1069
1069
|
callbackOperations.push(this.getCallback(callback, expression, method));
|
|
@@ -1088,8 +1088,8 @@ var Operation = class {
|
|
|
1088
1088
|
/**
|
|
1089
1089
|
* Determine if a given a custom specification extension exists within the operation.
|
|
1090
1090
|
*
|
|
1091
|
-
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#
|
|
1092
|
-
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#
|
|
1091
|
+
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#specification-extensions}
|
|
1092
|
+
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#specification-extensions}
|
|
1093
1093
|
* @param extension Specification extension to lookup.
|
|
1094
1094
|
*/
|
|
1095
1095
|
hasExtension(extension) {
|
|
@@ -1098,8 +1098,8 @@ var Operation = class {
|
|
|
1098
1098
|
/**
|
|
1099
1099
|
* Retrieve a custom specification extension off of the operation.
|
|
1100
1100
|
*
|
|
1101
|
-
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#
|
|
1102
|
-
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#
|
|
1101
|
+
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#specification-extensions}
|
|
1102
|
+
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#specification-extensions}
|
|
1103
1103
|
* @param extension Specification extension to lookup.
|
|
1104
1104
|
*
|
|
1105
1105
|
* @deprecated Use `oas.getExtension(extension, operation)` instead.
|
|
@@ -1135,7 +1135,7 @@ var Callback = class extends Operation {
|
|
|
1135
1135
|
* Return the primary identifier for this callback.
|
|
1136
1136
|
*
|
|
1137
1137
|
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#callback-object}
|
|
1138
|
-
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#
|
|
1138
|
+
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#callback-object}
|
|
1139
1139
|
*/
|
|
1140
1140
|
getIdentifier() {
|
|
1141
1141
|
return this.identifier;
|
|
@@ -1201,4 +1201,4 @@ exports.Operation = Operation; exports.Callback = Callback; exports.Webhook = We
|
|
|
1201
1201
|
* @license Apache-2.0
|
|
1202
1202
|
* @see {@link https://github.com/swagger-api/swagger-ui/blob/master/src/core/plugins/samples/fn.js}
|
|
1203
1203
|
*/
|
|
1204
|
-
//# sourceMappingURL=chunk-
|
|
1204
|
+
//# sourceMappingURL=chunk-DAS55TQF.cjs.map
|