chenshuai2144 / openapi2typescript

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

Validate config "openAPI" failed, "serversPath" is not allowed #64

Closed elpwc closed 2 years ago

elpwc commented 2 years ago

设置 serversPath 後,运行 npm run openapi 报错:

PS > npm run openapi

> umi openapi

Validate config "openAPI" failed, "serversPath" is not allowed
ValidationError: "serversPath" is not allowed

.umirc.ts 内容:

import * as appconfig from './appconfig';

export default {
  openAPI: {
    requestLibPath: "import request from '../../utils/request'",
    schemaPath: `${appconfig.default.apiBaseURL}/api-json`,
    mock: false,
    serversPath: './services/',
  },
};
elpwc commented 2 years ago

放弃 umi 配置,直接使用 openapi.config.ts 後成功生成了