diff --git a/CHANGELOG.md b/CHANGELOG.md index 3815e76f..ee00c2fb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -617,7 +617,7 @@ Features: Fixes: - Bug with missing `name` property in in-path requests parameters -- Problem with usage `--route-types` with `--modular` option (mising import data contracts) +- Problem with usage `--route-types` with `--modular` option (missing import data contracts) # 6.4.1 @@ -1347,7 +1347,7 @@ Changes: update documentation (+ add logo), add comment about author in generate # 1.0.6 Fixes: route naming, http(s) requests for getting swagger schema, integer enums -Changes: include only required files into npm pacakge +Changes: include only required files into npm package # 1.0.5 diff --git a/src/configuration.js b/src/configuration.js index 5d238884..f78b4094 100644 --- a/src/configuration.js +++ b/src/configuration.js @@ -60,7 +60,7 @@ class CodeGenConfig { /** { "#/components/schemas/Foo": @TypeInfo, ... } */ componentsMap = {}; - /** flag for catching convertion from swagger 2.0 */ + /** flag for catching conversion from swagger 2.0 */ convertedFromSwagger2 = false; /** url index from paths used for merging into modules */ diff --git a/templates/base/route-name.ejs b/templates/base/route-name.ejs index f4a08d5c..059c8b11 100644 --- a/templates/base/route-name.ejs +++ b/templates/base/route-name.ejs @@ -24,10 +24,10 @@ const methodAliases = { const createCustomOperationId = (method, route, moduleName) => { const hasPathInserts = /\{(\w){1,}\}/g.test(route); - const splitedRouteBySlash = _.compact(_.replace(route, /\{(\w){1,}\}/g, "").split("/")); - const routeParts = (splitedRouteBySlash.length > 1 - ? splitedRouteBySlash.splice(1) - : splitedRouteBySlash + const splittedRouteBySlash = _.compact(_.replace(route, /\{(\w){1,}\}/g, "").split("/")); + const routeParts = (splittedRouteBySlash.length > 1 + ? splittedRouteBySlash.splice(1) + : splittedRouteBySlash ).join("_"); return routeParts.length > 3 && methodAliases[method] ? methodAliases[method](routeParts, hasPathInserts) diff --git a/tests/generated/v3.0/additional-properties.ts b/tests/generated/v3.0/additional-properties.ts index 15478953..fd587e8a 100644 --- a/tests/generated/v3.0/additional-properties.ts +++ b/tests/generated/v3.0/additional-properties.ts @@ -227,7 +227,7 @@ export class HttpClient { } /** - * @title Additional propeties Example + * @title Additional properties Example * @version 1.0.0 */ export class Api extends HttpClient {} diff --git a/tests/schemas/v3.0/additional-properties.yaml b/tests/schemas/v3.0/additional-properties.yaml index 3956a110..7da5ffbd 100644 --- a/tests/schemas/v3.0/additional-properties.yaml +++ b/tests/schemas/v3.0/additional-properties.yaml @@ -1,6 +1,6 @@ openapi: "3.0.0" info: - title: Additional propeties Example + title: Additional properties Example version: 1.0.0 components: schemas: diff --git a/tests/spec/templates/spec_templates/route-name.eta b/tests/spec/templates/spec_templates/route-name.eta index b5323561..f62e2e11 100644 --- a/tests/spec/templates/spec_templates/route-name.eta +++ b/tests/spec/templates/spec_templates/route-name.eta @@ -23,10 +23,10 @@ const methodAliases = { const createCustomOperationId = (method, route, moduleName) => { const hasPathInserts = /\{(\w){1,}\}/g.test(route); - const splitedRouteBySlash = _.compact(_.replace(route, /\{(\w){1,}\}/g, "").split("/")); - const routeParts = (splitedRouteBySlash.length > 1 - ? splitedRouteBySlash.splice(1) - : splitedRouteBySlash + const splittedRouteBySlash = _.compact(_.replace(route, /\{(\w){1,}\}/g, "").split("/")); + const routeParts = (splittedRouteBySlash.length > 1 + ? splittedRouteBySlash.splice(1) + : splittedRouteBySlash ).join("_"); return routeParts.length > 3 && methodAliases[method] ? methodAliases[method](routeParts, hasPathInserts)