diff --git a/src/serviceGenerator.ts b/src/serviceGenerator.ts index 842c22a..a1a797f 100644 --- a/src/serviceGenerator.ts +++ b/src/serviceGenerator.ts @@ -14,6 +14,7 @@ import type { SchemaObject, } from 'openapi3-ts'; import { join } from 'path'; +import { camelCase } from 'lodash'; import ReservedDict from 'reserved-words'; import rimraf from 'rimraf'; import pinyin from 'tiny-pinyin'; @@ -318,7 +319,7 @@ class ServiceGenerator { } tags.forEach((tagString) => { - const tag = resolveTypeName(tagString); + const tag = camelCase(resolveTypeName(tagString)); if (!this.apiData[tag]) { this.apiData[tag] = []; @@ -530,7 +531,7 @@ class ServiceGenerator { return { ...newApi, - functionName, + functionName: camelCase(functionName), typeName: this.getTypeName(newApi), path: getPrefixPath(), pathInComment: formattedPath.replace(/\*/g, '*'),