File tree Expand file tree Collapse file tree 2 files changed +14
-2
lines changed
Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ ' openapi-ts-request ' : patch
3+ ---
4+
5+ fix: 修复配置includePaths时,没有按照includePaths进行type过滤,而是生成了全量的type
Original file line number Diff line number Diff line change @@ -445,6 +445,7 @@ export default class ServiceGenerator {
445445 const schemas = this . openAPIData . components ?. schemas ;
446446 const lastTypes : Array < ITypeItem > = this . interfaceTPConfigs ;
447447 const includeTags = this . config ?. includeTags || [ ] ;
448+ const includePaths = this . config ?. includePaths || [ ] ;
448449
449450 // 强行替换掉请求参数params的类型,生成方法对应的 xxxxParams 类型
450451 keys ( this . openAPIData . paths ) . forEach ( ( pathKey ) => {
@@ -461,7 +462,11 @@ export default class ServiceGenerator {
461462
462463 const tags = hookCustomFileNames ( operationObject , pathKey , method ) ;
463464
464- if ( isEmpty ( includeTags ) || ( ! isEmpty ( includeTags ) && isEmpty ( tags ) ) ) {
465+ if (
466+ isEmpty ( includeTags ) ||
467+ ( ! isEmpty ( includeTags ) && isEmpty ( tags ) ) ||
468+ isEmpty ( includePaths )
469+ ) {
465470 return ;
466471 }
467472
@@ -475,7 +480,9 @@ export default class ServiceGenerator {
475480 includeTags
476481 ) ;
477482
478- if ( ! flag ) {
483+ const pathFlag = this . validateRegexp ( pathKey , includePaths ) ;
484+
485+ if ( ! flag || ! pathFlag ) {
479486 return ;
480487 }
481488
You can’t perform that action at this time.
0 commit comments