You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Create oas.config.js or oas.json in the root directory of the project, and refer to [cosmiconfig](https://www.npmjs.com/package/cosmiconfig) for the file name specification.
32
-
33
-
The search order for configuration files is `oas.config.cjs`, `oas.config.js`, `oas.json`.
31
+
Create oas.config.js or oas.json in the root directory of the project. The search order for configuration files is `oas.config.cjs`, `oas.config.js`, `oas.json`.
34
32
35
33
```js
36
34
// oas.config.cjs
37
35
const { defineConfig } =require('oas-gen-ts');
38
36
39
37
module.exports=defineConfig({
40
-
axiosImport:`import { axios } from '@/util/axios';`,
41
38
list: [
42
39
{
43
40
name:'swagger/pet',
@@ -59,8 +56,6 @@ The generated file will be exported as one function and one operation, like this
59
56
```ts
60
57
// src/apis/swagger/pet.ts
61
58
62
-
import { axios } from'@/util/axios';
63
-
64
59
// ...
65
60
66
61
exportinterfacePet {
@@ -116,21 +111,21 @@ export async function findPetsByStatus(
116
111
import { generate } from'oas-gen-ts';
117
112
118
113
generate({
119
-
// ...
114
+
// ...config
120
115
});
121
116
```
122
117
123
118
# Config
124
119
125
-
| Name | Type | Required | Description | Default |
0 commit comments