diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavascriptClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavascriptClientCodegen.java
index fcac1e9d60b..d388979dac5 100644
--- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavascriptClientCodegen.java
+++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavascriptClientCodegen.java
@@ -296,7 +296,7 @@ public class JavascriptClientCodegen extends DefaultCodegen implements CodegenCo
if (StringUtils.isEmpty(info.getDescription())) {
projectDescription = "JS API client generated by OpenAPI Generator";
} else {
- projectDescription = sanitizeName(info.getDescription());
+ projectDescription = info.getDescription();
}
}
@@ -312,7 +312,7 @@ public class JavascriptClientCodegen extends DefaultCodegen implements CodegenCo
projectName = "openapi-js-client";
}
if (StringUtils.isBlank(moduleName)) {
- moduleName = camelize(underscore(projectName));
+ moduleName = camelize(underscore(sanitizeName(projectName)));
}
if (StringUtils.isBlank(projectVersion)) {
projectVersion = "1.0.0";
diff --git a/samples/client/petstore/javascript-es6/package.json b/samples/client/petstore/javascript-es6/package.json
index dfa8bf720fe..e457ebe7e0f 100644
--- a/samples/client/petstore/javascript-es6/package.json
+++ b/samples/client/petstore/javascript-es6/package.json
@@ -1,7 +1,7 @@
{
"name": "open_api_petstore",
"version": "1.0.0",
- "description": "This_spec_is_mainly_for_testing_Petstore_server_and_contains_fake_endpoints_models__Please_do_not_use_this_for_any_other_purpose__Special_characters___",
+ "description": "This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\",
"license": "Apache-2.0",
"main": "dist/index.js",
"scripts": {
diff --git a/samples/client/petstore/javascript-es6/src/index.js b/samples/client/petstore/javascript-es6/src/index.js
index a75a817c260..474899d9c51 100644
--- a/samples/client/petstore/javascript-es6/src/index.js
+++ b/samples/client/petstore/javascript-es6/src/index.js
@@ -69,7 +69,7 @@ import UserApi from './api/UserApi';
/**
-* This_spec_is_mainly_for_testing_Petstore_server_and_contains_fake_endpoints_models__Please_do_not_use_this_for_any_other_purpose__Special_characters___.
+* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\.
* The index
module provides access to constructors for all the classes which comprise the public API.
*
* An AMD (recommended!) or CommonJS application will generally do something equivalent to the following:
diff --git a/samples/client/petstore/javascript-promise-es6/package.json b/samples/client/petstore/javascript-promise-es6/package.json
index dfa8bf720fe..e457ebe7e0f 100644
--- a/samples/client/petstore/javascript-promise-es6/package.json
+++ b/samples/client/petstore/javascript-promise-es6/package.json
@@ -1,7 +1,7 @@
{
"name": "open_api_petstore",
"version": "1.0.0",
- "description": "This_spec_is_mainly_for_testing_Petstore_server_and_contains_fake_endpoints_models__Please_do_not_use_this_for_any_other_purpose__Special_characters___",
+ "description": "This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\",
"license": "Apache-2.0",
"main": "dist/index.js",
"scripts": {
diff --git a/samples/client/petstore/javascript-promise-es6/src/index.js b/samples/client/petstore/javascript-promise-es6/src/index.js
index a75a817c260..474899d9c51 100644
--- a/samples/client/petstore/javascript-promise-es6/src/index.js
+++ b/samples/client/petstore/javascript-promise-es6/src/index.js
@@ -69,7 +69,7 @@ import UserApi from './api/UserApi';
/**
-* This_spec_is_mainly_for_testing_Petstore_server_and_contains_fake_endpoints_models__Please_do_not_use_this_for_any_other_purpose__Special_characters___.
+* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\.
* The index
module provides access to constructors for all the classes which comprise the public API.
*
* An AMD (recommended!) or CommonJS application will generally do something equivalent to the following: