We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b6925ca commit 6bb0a4eCopy full SHA for 6bb0a4e
README.md
@@ -20,24 +20,30 @@ OpenAPI → Axios
20
21
```shell
22
npm i -D openapi-axios
23
+npm i axios
24
```
25
26
# 使用
27
28
## 创建配置文件
-
29
-在项目根目录下创建配置文件 openapi.config.js(也可以是 openapi.config.cjs)。
30
+```shell
+npx openapi-axios init
31
+```
32
+将在项目根目录下创建配置文件 openapi.config.cjs:
33
```js
-// openapi.config.js
34
+/**
35
+ * openapi-axios config
36
+ * @link https://github.com/FrontEndDev-org/openapi-axios
37
+ */
38
+
39
const { defineConfig } = require('openapi-axios');
40
41
module.exports = defineConfig({
42
modules: {
- // 将会生成 src/apis/petStore3.ts 文件
43
'petStore3': 'https://petstore31.swagger.io/api/v31/openapi.json'
44
},
45
});
46
47
48
49
## 生成 API 文件
0 commit comments