forked from loafle/openapi-generator-original
Javascript Generator: two small sanitization changes 🦠 (#13268)
* Javascript Generator: small sanitization changes Sanitize module name, do not sanitize description. If we set the project name to "@myorg/mypackage" (scoped package[1]), running `npm test` will fail, as it will generate faulty code due to the module name including the '@' symbol, which is not a valid JS identifier. Additionally, we don't need to sanitize the description - spaces and special characters are fine. We just need to make sure they are escaped, which we're already doing by invoking escapeText() on line 329 [1]anitize module name, do not sanitize description * update JS samples
This commit is contained in:
@@ -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": {
|
||||
|
||||
@@ -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___.<br>
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\.<br>
|
||||
* The <code>index</code> module provides access to constructors for all the classes which comprise the public API.
|
||||
* <p>
|
||||
* An AMD (recommended!) or CommonJS application will generally do something equivalent to the following:
|
||||
|
||||
Reference in New Issue
Block a user