swagger-client 3.27.4 → 3.27.5
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/es/execute/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import cookie from 'cookie';
|
|
2
2
|
import { isPlainObject } from 'is-plain-object';
|
|
3
|
+
import { escapeRegExp } from 'ramda-adjunct';
|
|
3
4
|
import { ApiDOMStructuredError } from '@swagger-api/apidom-error';
|
|
4
5
|
import { url } from '@swagger-api/apidom-reference/configuration/empty';
|
|
5
6
|
import { DEFAULT_BASE_URL, DEFAULT_OPENAPI_3_SERVER } from '../constants.js';
|
|
@@ -321,7 +322,7 @@ function oas3BaseUrl({
|
|
|
321
322
|
// variable is defined in server
|
|
322
323
|
const variableDefinition = selectedServerObj.variables[variable];
|
|
323
324
|
const variableValue = serverVariables[variable] || variableDefinition.default;
|
|
324
|
-
const re = new RegExp(`{${variable}}`, 'g');
|
|
325
|
+
const re = new RegExp(`{${escapeRegExp(variable)}}`, 'g');
|
|
325
326
|
selectedServerUrl = selectedServerUrl.replace(re, variableValue);
|
|
326
327
|
}
|
|
327
328
|
});
|
package/lib/execute/index.js
CHANGED
|
@@ -9,6 +9,7 @@ exports.execute = execute;
|
|
|
9
9
|
exports.self = void 0;
|
|
10
10
|
var _cookie = _interopRequireDefault(require("cookie"));
|
|
11
11
|
var _isPlainObject = require("is-plain-object");
|
|
12
|
+
var _ramdaAdjunct = require("ramda-adjunct");
|
|
12
13
|
var _apidomError = require("@swagger-api/apidom-error");
|
|
13
14
|
var _empty = require("@swagger-api/apidom-reference/configuration/empty");
|
|
14
15
|
var _constants = require("../constants.js");
|
|
@@ -330,7 +331,7 @@ function oas3BaseUrl({
|
|
|
330
331
|
// variable is defined in server
|
|
331
332
|
const variableDefinition = selectedServerObj.variables[variable];
|
|
332
333
|
const variableValue = serverVariables[variable] || variableDefinition.default;
|
|
333
|
-
const re = new RegExp(`{${variable}}`, 'g');
|
|
334
|
+
const re = new RegExp(`{${(0, _ramdaAdjunct.escapeRegExp)(variable)}}`, 'g');
|
|
334
335
|
selectedServerUrl = selectedServerUrl.replace(re, variableValue);
|
|
335
336
|
}
|
|
336
337
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "swagger-client",
|
|
3
|
-
"version": "3.27.
|
|
3
|
+
"version": "3.27.5",
|
|
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",
|
|
@@ -124,6 +124,7 @@
|
|
|
124
124
|
"node-fetch-commonjs": "^3.3.2",
|
|
125
125
|
"openapi-path-templating": "^1.5.1",
|
|
126
126
|
"qs": "^6.10.2",
|
|
127
|
+
"ramda-adjunct": "^5.0.0",
|
|
127
128
|
"traverse": "=0.6.8"
|
|
128
129
|
},
|
|
129
130
|
"overrides": {
|