Skip to content

Commit 09c2731

Browse files
authored
feat: add allowedTags and allowedPaths (#111)
* feat: add allowedTags and allowedPaths
1 parent 1519420 commit 09c2731

File tree

12 files changed

+1324
-13
lines changed

12 files changed

+1324
-13
lines changed

.changeset/twelve-mails-shout.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'openapi-ts-request': patch
3+
---
4+
5+
support priorityRule

README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,12 @@ openapi --i ./spec.json --o ./apis
168168
| schemaPath || string | - | Swagger2/OpenAPI3 地址 |
169169
| serversPath || string | './src/apis' | 生成结果的文件夹路径 |
170170
| requestLibPath || string | 'axios' | 自定义请求方法路径,例如:'@/request'、'node-fetch' |
171-
| allowedTags || string[] | - | 根据指定的 tags 生成代码 |
171+
| enableLogging || boolean | false | 是否开启日志 |
172+
| priorityRule || string | 'exclude' | 模式规则,可选allowed/exclude/include |
173+
| allowedTags || (string\|RegExp)[] | - | 根据指定的 tags 生成代码 |
174+
| allowedPaths || (string\|RegExp)[] | - | 根据指定的 paths 生成代码 |
175+
| excludeTags || (string\|RegExp)[] | - | 根据指定的 tags 不生成代码 |
176+
| excludePaths || (string\|RegExp)[] | - | 根据指定的 paths 不生成代码 |
172177
| requestOptionsType || string | '{ [key: string]: unknown }' | 自定义请求方法 options 参数类型 |
173178
| requestImportStatement || string | - | 自定义请求方法表达式,例如:"const request = require('@/request')" |
174179
| apiPrefix || string | - | api path的前缀,例如:'api'(动态变量), "'api'"(字符串) |

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
"js-yaml": "^4.1.0",
4848
"lodash": "^4.17.21",
4949
"memoizee": "^0.4.17",
50+
"minimatch": "^10.0.1",
5051
"mockjs": "^1.1.0",
5152
"nunjucks": "^3.2.4",
5253
"prettier": "^3.3.2",
@@ -75,6 +76,7 @@
7576
"husky": "^9.0.11",
7677
"lint-staged": "^15.2.5",
7778
"openapi-types": "^12.1.3",
79+
"ts-node": "^10.9.2",
7880
"typescript": "5.6.3"
7981
},
8082
"keywords": [

pnpm-lock.yaml

Lines changed: 114 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)