swagger-client 3.35.4 → 3.35.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.
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
import jsYaml from 'js-yaml';
|
|
2
2
|
export const shouldDownloadAsText = (contentType = '') => /(json|xml|yaml|text)\b/.test(contentType);
|
|
3
3
|
function parseBody(body, contentType) {
|
|
4
|
-
if (contentType
|
|
5
|
-
|
|
4
|
+
if (contentType) {
|
|
5
|
+
if (contentType.indexOf('application/json') === 0 || contentType.indexOf('+json') > 0) {
|
|
6
|
+
return JSON.parse(body);
|
|
7
|
+
}
|
|
8
|
+
if (contentType.indexOf('application/xml') === 0 || contentType.indexOf('+xml') > 0) {
|
|
9
|
+
return body;
|
|
10
|
+
}
|
|
6
11
|
}
|
|
7
12
|
return jsYaml.load(body);
|
|
8
13
|
}
|
|
@@ -9,8 +9,13 @@ var _jsYaml = _interopRequireDefault(require("js-yaml"));
|
|
|
9
9
|
const shouldDownloadAsText = (contentType = '') => /(json|xml|yaml|text)\b/.test(contentType);
|
|
10
10
|
exports.shouldDownloadAsText = shouldDownloadAsText;
|
|
11
11
|
function parseBody(body, contentType) {
|
|
12
|
-
if (contentType
|
|
13
|
-
|
|
12
|
+
if (contentType) {
|
|
13
|
+
if (contentType.indexOf('application/json') === 0 || contentType.indexOf('+json') > 0) {
|
|
14
|
+
return JSON.parse(body);
|
|
15
|
+
}
|
|
16
|
+
if (contentType.indexOf('application/xml') === 0 || contentType.indexOf('+xml') > 0) {
|
|
17
|
+
return body;
|
|
18
|
+
}
|
|
14
19
|
}
|
|
15
20
|
return _jsYaml.default.load(body);
|
|
16
21
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "swagger-client",
|
|
3
|
-
"version": "3.35.
|
|
3
|
+
"version": "3.35.6",
|
|
4
4
|
"description": "SwaggerJS - a collection of interfaces for OAI specs",
|
|
5
5
|
"browser": {
|
|
6
6
|
"./src/helpers/btoa.node.js": "./src/helpers/btoa.browser.js",
|
|
@@ -74,11 +74,11 @@
|
|
|
74
74
|
"dependencies": {
|
|
75
75
|
"@babel/runtime-corejs3": "^7.22.15",
|
|
76
76
|
"@scarf/scarf": "=1.4.0",
|
|
77
|
-
"@swagger-api/apidom-core": ">=1.0.0-beta.
|
|
78
|
-
"@swagger-api/apidom-error": ">=1.0.0-beta.
|
|
79
|
-
"@swagger-api/apidom-json-pointer": ">=1.0.0-beta.
|
|
80
|
-
"@swagger-api/apidom-ns-openapi-3-1": ">=1.0.0-beta.
|
|
81
|
-
"@swagger-api/apidom-reference": ">=1.0.0-beta.
|
|
77
|
+
"@swagger-api/apidom-core": ">=1.0.0-beta.41 <1.0.0-rc.0",
|
|
78
|
+
"@swagger-api/apidom-error": ">=1.0.0-beta.41 <1.0.0-rc.0",
|
|
79
|
+
"@swagger-api/apidom-json-pointer": ">=1.0.0-beta.41 <1.0.0-rc.0",
|
|
80
|
+
"@swagger-api/apidom-ns-openapi-3-1": ">=1.0.0-beta.41 <1.0.0-rc.0",
|
|
81
|
+
"@swagger-api/apidom-reference": ">=1.0.0-beta.41 <1.0.0-rc.0",
|
|
82
82
|
"@swaggerexpert/cookie": "^2.0.2",
|
|
83
83
|
"deepmerge": "~4.3.0",
|
|
84
84
|
"fast-json-patch": "^3.0.0-1",
|
|
@@ -105,10 +105,10 @@
|
|
|
105
105
|
"eslint": "^8.42.0",
|
|
106
106
|
"eslint-config-airbnb-base": "^15.0.0",
|
|
107
107
|
"eslint-config-prettier": "=10.1.5",
|
|
108
|
-
"eslint-plugin-import": "=2.
|
|
109
|
-
"eslint-plugin-prettier": "=5.
|
|
108
|
+
"eslint-plugin-import": "=2.32.0",
|
|
109
|
+
"eslint-plugin-prettier": "=5.5.1",
|
|
110
110
|
"expect": "^29.0.3",
|
|
111
|
-
"glob": "=11.0.
|
|
111
|
+
"glob": "=11.0.3",
|
|
112
112
|
"husky": "^9.0.11",
|
|
113
113
|
"inspectpack": "=4.7.1",
|
|
114
114
|
"install": "=0.13.0",
|
|
@@ -116,7 +116,7 @@
|
|
|
116
116
|
"jest-environment-jsdom": "^29.0.3",
|
|
117
117
|
"json-loader": "=0.5.7",
|
|
118
118
|
"license-checker": "=25.0.1",
|
|
119
|
-
"lint-staged": "=16.1.
|
|
119
|
+
"lint-staged": "=16.1.2",
|
|
120
120
|
"lodash": "^4.17.21",
|
|
121
121
|
"npm-run-all": "=4.1.5",
|
|
122
122
|
"prettier": "^3.1.1",
|