swagger-client 3.27.7 → 3.27.8
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 +1 -1
package/es/execute/index.js
CHANGED
|
@@ -164,7 +164,7 @@ export function buildRequest(options) {
|
|
|
164
164
|
method,
|
|
165
165
|
pathName
|
|
166
166
|
} = operationRaw;
|
|
167
|
-
|
|
167
|
+
const baseURL = baseUrl({
|
|
168
168
|
spec,
|
|
169
169
|
scheme,
|
|
170
170
|
contextUrl,
|
|
@@ -173,6 +173,7 @@ export function buildRequest(options) {
|
|
|
173
173
|
pathName,
|
|
174
174
|
method
|
|
175
175
|
});
|
|
176
|
+
req.url += baseURL;
|
|
176
177
|
|
|
177
178
|
// Mostly for testing
|
|
178
179
|
if (!operationId) {
|
|
@@ -236,7 +237,7 @@ export function buildRequest(options) {
|
|
|
236
237
|
value,
|
|
237
238
|
operation,
|
|
238
239
|
spec,
|
|
239
|
-
|
|
240
|
+
baseURL
|
|
240
241
|
});
|
|
241
242
|
}
|
|
242
243
|
});
|
|
@@ -5,7 +5,7 @@ export function path({
|
|
|
5
5
|
req,
|
|
6
6
|
value,
|
|
7
7
|
parameter,
|
|
8
|
-
|
|
8
|
+
baseURL
|
|
9
9
|
}) {
|
|
10
10
|
const {
|
|
11
11
|
name,
|
|
@@ -14,16 +14,17 @@ export function path({
|
|
|
14
14
|
content
|
|
15
15
|
} = parameter;
|
|
16
16
|
if (value === undefined) return;
|
|
17
|
+
const pathname = req.url.replace(baseURL, '');
|
|
17
18
|
let resolvedPathname;
|
|
18
19
|
if (content) {
|
|
19
20
|
const effectiveMediaType = Object.keys(content)[0];
|
|
20
|
-
resolvedPathname = resolvePathTemplate(
|
|
21
|
+
resolvedPathname = resolvePathTemplate(pathname, {
|
|
21
22
|
[name]: value
|
|
22
23
|
}, {
|
|
23
24
|
encoder: val => encodeCharacters(serialize(val, effectiveMediaType))
|
|
24
25
|
});
|
|
25
26
|
} else {
|
|
26
|
-
resolvedPathname = resolvePathTemplate(
|
|
27
|
+
resolvedPathname = resolvePathTemplate(pathname, {
|
|
27
28
|
[name]: value
|
|
28
29
|
}, {
|
|
29
30
|
encoder: val => stylize({
|
|
@@ -35,7 +36,7 @@ export function path({
|
|
|
35
36
|
})
|
|
36
37
|
});
|
|
37
38
|
}
|
|
38
|
-
req.url =
|
|
39
|
+
req.url = baseURL + resolvedPathname;
|
|
39
40
|
}
|
|
40
41
|
export function query({
|
|
41
42
|
req,
|
|
@@ -64,13 +64,14 @@ function pathBuilder({
|
|
|
64
64
|
req,
|
|
65
65
|
value,
|
|
66
66
|
parameter,
|
|
67
|
-
|
|
67
|
+
baseURL
|
|
68
68
|
}) {
|
|
69
69
|
if (value !== undefined) {
|
|
70
|
-
const
|
|
70
|
+
const pathname = req.url.replace(baseURL, '');
|
|
71
|
+
const resolvedPathname = resolvePathTemplate(pathname, {
|
|
71
72
|
[parameter.name]: value
|
|
72
73
|
});
|
|
73
|
-
req.url =
|
|
74
|
+
req.url = baseURL + resolvedPathname;
|
|
74
75
|
}
|
|
75
76
|
}
|
|
76
77
|
|
package/lib/execute/index.js
CHANGED
|
@@ -173,7 +173,7 @@ function buildRequest(options) {
|
|
|
173
173
|
method,
|
|
174
174
|
pathName
|
|
175
175
|
} = operationRaw;
|
|
176
|
-
|
|
176
|
+
const baseURL = baseUrl({
|
|
177
177
|
spec,
|
|
178
178
|
scheme,
|
|
179
179
|
contextUrl,
|
|
@@ -182,6 +182,7 @@ function buildRequest(options) {
|
|
|
182
182
|
pathName,
|
|
183
183
|
method
|
|
184
184
|
});
|
|
185
|
+
req.url += baseURL;
|
|
185
186
|
|
|
186
187
|
// Mostly for testing
|
|
187
188
|
if (!operationId) {
|
|
@@ -245,7 +246,7 @@ function buildRequest(options) {
|
|
|
245
246
|
value,
|
|
246
247
|
operation,
|
|
247
248
|
spec,
|
|
248
|
-
|
|
249
|
+
baseURL
|
|
249
250
|
});
|
|
250
251
|
}
|
|
251
252
|
});
|
|
@@ -14,7 +14,7 @@ function path({
|
|
|
14
14
|
req,
|
|
15
15
|
value,
|
|
16
16
|
parameter,
|
|
17
|
-
|
|
17
|
+
baseURL
|
|
18
18
|
}) {
|
|
19
19
|
const {
|
|
20
20
|
name,
|
|
@@ -23,16 +23,17 @@ function path({
|
|
|
23
23
|
content
|
|
24
24
|
} = parameter;
|
|
25
25
|
if (value === undefined) return;
|
|
26
|
+
const pathname = req.url.replace(baseURL, '');
|
|
26
27
|
let resolvedPathname;
|
|
27
28
|
if (content) {
|
|
28
29
|
const effectiveMediaType = Object.keys(content)[0];
|
|
29
|
-
resolvedPathname = (0, _openapiPathTemplating.resolve)(
|
|
30
|
+
resolvedPathname = (0, _openapiPathTemplating.resolve)(pathname, {
|
|
30
31
|
[name]: value
|
|
31
32
|
}, {
|
|
32
33
|
encoder: val => (0, _styleSerializer.encodeCharacters)((0, _contentSerializer.default)(val, effectiveMediaType))
|
|
33
34
|
});
|
|
34
35
|
} else {
|
|
35
|
-
resolvedPathname = (0, _openapiPathTemplating.resolve)(
|
|
36
|
+
resolvedPathname = (0, _openapiPathTemplating.resolve)(pathname, {
|
|
36
37
|
[name]: value
|
|
37
38
|
}, {
|
|
38
39
|
encoder: val => (0, _styleSerializer.default)({
|
|
@@ -44,7 +45,7 @@ function path({
|
|
|
44
45
|
})
|
|
45
46
|
});
|
|
46
47
|
}
|
|
47
|
-
req.url =
|
|
48
|
+
req.url = baseURL + resolvedPathname;
|
|
48
49
|
}
|
|
49
50
|
function query({
|
|
50
51
|
req,
|
|
@@ -64,13 +64,14 @@ function pathBuilder({
|
|
|
64
64
|
req,
|
|
65
65
|
value,
|
|
66
66
|
parameter,
|
|
67
|
-
|
|
67
|
+
baseURL
|
|
68
68
|
}) {
|
|
69
69
|
if (value !== undefined) {
|
|
70
|
-
const
|
|
70
|
+
const pathname = req.url.replace(baseURL, '');
|
|
71
|
+
const resolvedPathname = (0, _openapiPathTemplating.resolve)(pathname, {
|
|
71
72
|
[parameter.name]: value
|
|
72
73
|
});
|
|
73
|
-
req.url =
|
|
74
|
+
req.url = baseURL + resolvedPathname;
|
|
74
75
|
}
|
|
75
76
|
}
|
|
76
77
|
|