diff --git a/modules/openapi-generator/src/main/resources/Javascript/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Javascript/ApiClient.mustache index dcea1e0da574..0f7a7ef669fc 100644 --- a/modules/openapi-generator/src/main/resources/Javascript/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Javascript/ApiClient.mustache @@ -650,7 +650,8 @@ ]; }; - exports.getBasePathFromSettings = function(index, variables={}) { + exports.getBasePathFromSettings = function(index, variables) { + var variables = variables || {}; var servers = this.hostSettings(); // check array index out of bound diff --git a/samples/client/petstore/javascript-promise/src/ApiClient.js b/samples/client/petstore/javascript-promise/src/ApiClient.js index 3416af28c957..a9e635f9c8ee 100644 --- a/samples/client/petstore/javascript-promise/src/ApiClient.js +++ b/samples/client/petstore/javascript-promise/src/ApiClient.js @@ -597,7 +597,8 @@ ]; }; - exports.getBasePathFromSettings = function(index, variables={}) { + exports.getBasePathFromSettings = function(index, variables) { + var variables = variables || {}; var servers = this.hostSettings(); // check array index out of bound diff --git a/samples/client/petstore/javascript/src/ApiClient.js b/samples/client/petstore/javascript/src/ApiClient.js index ed27f48fde16..91972a08cd9e 100644 --- a/samples/client/petstore/javascript/src/ApiClient.js +++ b/samples/client/petstore/javascript/src/ApiClient.js @@ -608,7 +608,8 @@ ]; }; - exports.getBasePathFromSettings = function(index, variables={}) { + exports.getBasePathFromSettings = function(index, variables) { + var variables = variables || {}; var servers = this.hostSettings(); // check array index out of bound