chenshuai2144 / openapi2typescript

一个被大范围使用的小工具
312 stars 136 forks source link

指定 customClassName 之后,生成的index.ts import和export错误 #33

Closed magic-zagan closed 1 year ago

magic-zagan commented 2 years ago

指定 customClassName 之后,生成的index.ts import和export 还是默认的生成方式,没有使用 自定义的className,但是自定义ClassName之后的文件名称已经是自定义的;

问题代码在: openapi2typescript/src/serviceGenerator.ts

line 505-514

 if (genParams.length) {
          this.classNameList.push({
            fileName,
            controllerName: fileName,
          });
        }
        let className = fileName;
        if (this.config.hook && this.config.hook.customClassName) {
          className = this.config.hook.customClassName(tag);
        }
chenshuai2144 commented 2 years ago

求pr