From 25c7ccf30c1a2dcfd130aba00bc6398c51d6dec0 Mon Sep 17 00:00:00 2001 From: nitoqq <6482641+nitoqq@users.noreply.github.com> Date: Fri, 4 Dec 2020 09:27:44 +0500 Subject: [PATCH] JS Client: Allow dot in path parameter name (#6116) * JS Client: Allow dot in path parameter name * JS Client: Allow dot in path parameter name * Delete ApiClient.js * Delete ApiClient.js Co-authored-by: Nikolai Konovalov --- .../src/main/resources/Javascript/ApiClient.mustache | 2 +- .../src/main/resources/Javascript/es6/ApiClient.mustache | 2 +- samples/client/petstore/javascript-es6/src/ApiClient.js | 2 +- samples/client/petstore/javascript-promise-es6/src/ApiClient.js | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/Javascript/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Javascript/ApiClient.mustache index f4f2024f4c6..3c1751b70a5 100644 --- a/modules/openapi-generator/src/main/resources/Javascript/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Javascript/ApiClient.mustache @@ -163,7 +163,7 @@ } var _this = this; - url = url.replace(/\{([\w-]+)\}/g, function(fullMatch, key) { + url = url.replace(/\{([\w-\.]+)\}/g, function(fullMatch, key) { var value; if (pathParams.hasOwnProperty(key)) { value = _this.paramToString(pathParams[key]); diff --git a/modules/openapi-generator/src/main/resources/Javascript/es6/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Javascript/es6/ApiClient.mustache index 91728cd6ea9..c356fd6f45e 100644 --- a/modules/openapi-generator/src/main/resources/Javascript/es6/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Javascript/es6/ApiClient.mustache @@ -153,7 +153,7 @@ class ApiClient { url = apiBasePath + path; } - url = url.replace(/\{([\w-]+)\}/g, (fullMatch, key) => { + url = url.replace(/\{([\w-\.]+)\}/g, (fullMatch, key) => { var value; if (pathParams.hasOwnProperty(key)) { value = this.paramToString(pathParams[key]); diff --git a/samples/client/petstore/javascript-es6/src/ApiClient.js b/samples/client/petstore/javascript-es6/src/ApiClient.js index 947a9e05217..4a73394c094 100644 --- a/samples/client/petstore/javascript-es6/src/ApiClient.js +++ b/samples/client/petstore/javascript-es6/src/ApiClient.js @@ -152,7 +152,7 @@ class ApiClient { url = apiBasePath + path; } - url = url.replace(/\{([\w-]+)\}/g, (fullMatch, key) => { + url = url.replace(/\{([\w-\.]+)\}/g, (fullMatch, key) => { var value; if (pathParams.hasOwnProperty(key)) { value = this.paramToString(pathParams[key]); diff --git a/samples/client/petstore/javascript-promise-es6/src/ApiClient.js b/samples/client/petstore/javascript-promise-es6/src/ApiClient.js index dbf723afbf0..d5d9e1a7230 100644 --- a/samples/client/petstore/javascript-promise-es6/src/ApiClient.js +++ b/samples/client/petstore/javascript-promise-es6/src/ApiClient.js @@ -152,7 +152,7 @@ class ApiClient { url = apiBasePath + path; } - url = url.replace(/\{([\w-]+)\}/g, (fullMatch, key) => { + url = url.replace(/\{([\w-\.]+)\}/g, (fullMatch, key) => { var value; if (pathParams.hasOwnProperty(key)) { value = this.paramToString(pathParams[key]);