File tree Expand file tree Collapse file tree 3 files changed +7
-2
lines changed
Expand file tree Collapse file tree 3 files changed +7
-2
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ ' openapi-ts-request ' : patch
3+ ---
4+
5+ fix: fix schema is undefined when mark schema
Original file line number Diff line number Diff line change @@ -367,7 +367,7 @@ export default class ServiceGenerator {
367367 // 判断哪些 schema 需要添加进 type, schemas 渲染数组
368368 if (
369369 isEmpty ( this . config . allowedTags ) ||
370- ( schema as ICustomSchemaObject ) . isAllowed
370+ ( schema as ICustomSchemaObject ) ? .isAllowed
371371 ) {
372372 const isEnum = result . isEnum as boolean ;
373373 const typeName = resolveTypeName ( schemaKey ) ;
Original file line number Diff line number Diff line change @@ -412,7 +412,7 @@ export function markAllowSchema(
412412 refPaths [ refPaths . length - 1 ]
413413 ] as ICustomSchemaObject ;
414414
415- if ( ! schema ? .isAllowed ) {
415+ if ( schema && ! schema . isAllowed ) {
416416 schema . isAllowed = true ;
417417 markAllowSchema ( JSON . stringify ( schema ) , schemas ) ;
418418 }
You can’t perform that action at this time.
0 commit comments