swagger-client 3.27.7 → 3.27.9
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/swagger-client.browser.js +12 -9
- package/dist/swagger-client.browser.min.js +1 -1
- package/dist/swagger-client.browser.min.js.map +1 -1
- package/es/execute/index.js +3 -2
- package/es/execute/oas3/parameter-builders.js +5 -4
- package/es/execute/swagger2/parameter-builders.js +4 -3
- package/lib/execute/index.js +3 -2
- package/lib/execute/oas3/parameter-builders.js +5 -4
- package/lib/execute/swagger2/parameter-builders.js +4 -3
- package/package.json +5 -5
|
@@ -220,7 +220,7 @@ function buildRequest(options) {
|
|
|
220
220
|
method,
|
|
221
221
|
pathName
|
|
222
222
|
} = operationRaw;
|
|
223
|
-
|
|
223
|
+
const baseURL = baseUrl({
|
|
224
224
|
spec,
|
|
225
225
|
scheme,
|
|
226
226
|
contextUrl,
|
|
@@ -229,6 +229,7 @@ function buildRequest(options) {
|
|
|
229
229
|
pathName,
|
|
230
230
|
method
|
|
231
231
|
});
|
|
232
|
+
req.url += baseURL;
|
|
232
233
|
|
|
233
234
|
// Mostly for testing
|
|
234
235
|
if (!operationId) {
|
|
@@ -292,7 +293,7 @@ function buildRequest(options) {
|
|
|
292
293
|
value,
|
|
293
294
|
operation,
|
|
294
295
|
spec,
|
|
295
|
-
|
|
296
|
+
baseURL
|
|
296
297
|
});
|
|
297
298
|
}
|
|
298
299
|
});
|
|
@@ -673,7 +674,7 @@ function path({
|
|
|
673
674
|
req,
|
|
674
675
|
value,
|
|
675
676
|
parameter,
|
|
676
|
-
|
|
677
|
+
baseURL
|
|
677
678
|
}) {
|
|
678
679
|
const {
|
|
679
680
|
name,
|
|
@@ -682,16 +683,17 @@ function path({
|
|
|
682
683
|
content
|
|
683
684
|
} = parameter;
|
|
684
685
|
if (value === undefined) return;
|
|
686
|
+
const pathname = req.url.replace(baseURL, '');
|
|
685
687
|
let resolvedPathname;
|
|
686
688
|
if (content) {
|
|
687
689
|
const effectiveMediaType = Object.keys(content)[0];
|
|
688
|
-
resolvedPathname = (0,openapi_path_templating__WEBPACK_IMPORTED_MODULE_0__.resolve)(
|
|
690
|
+
resolvedPathname = (0,openapi_path_templating__WEBPACK_IMPORTED_MODULE_0__.resolve)(pathname, {
|
|
689
691
|
[name]: value
|
|
690
692
|
}, {
|
|
691
693
|
encoder: val => (0,_style_serializer_js__WEBPACK_IMPORTED_MODULE_1__.encodeCharacters)((0,_content_serializer_js__WEBPACK_IMPORTED_MODULE_2__["default"])(val, effectiveMediaType))
|
|
692
694
|
});
|
|
693
695
|
} else {
|
|
694
|
-
resolvedPathname = (0,openapi_path_templating__WEBPACK_IMPORTED_MODULE_0__.resolve)(
|
|
696
|
+
resolvedPathname = (0,openapi_path_templating__WEBPACK_IMPORTED_MODULE_0__.resolve)(pathname, {
|
|
695
697
|
[name]: value
|
|
696
698
|
}, {
|
|
697
699
|
encoder: val => (0,_style_serializer_js__WEBPACK_IMPORTED_MODULE_1__["default"])({
|
|
@@ -703,7 +705,7 @@ function path({
|
|
|
703
705
|
})
|
|
704
706
|
});
|
|
705
707
|
}
|
|
706
|
-
req.url =
|
|
708
|
+
req.url = baseURL + resolvedPathname;
|
|
707
709
|
}
|
|
708
710
|
function query({
|
|
709
711
|
req,
|
|
@@ -1160,13 +1162,14 @@ function pathBuilder({
|
|
|
1160
1162
|
req,
|
|
1161
1163
|
value,
|
|
1162
1164
|
parameter,
|
|
1163
|
-
|
|
1165
|
+
baseURL
|
|
1164
1166
|
}) {
|
|
1165
1167
|
if (value !== undefined) {
|
|
1166
|
-
const
|
|
1168
|
+
const pathname = req.url.replace(baseURL, '');
|
|
1169
|
+
const resolvedPathname = (0,openapi_path_templating__WEBPACK_IMPORTED_MODULE_0__.resolve)(pathname, {
|
|
1167
1170
|
[parameter.name]: value
|
|
1168
1171
|
});
|
|
1169
|
-
req.url =
|
|
1172
|
+
req.url = baseURL + resolvedPathname;
|
|
1170
1173
|
}
|
|
1171
1174
|
}
|
|
1172
1175
|
|