@@ -1052,8 +1052,8 @@ export class JsonSchemaGenerator {
10521052 return ! (
10531053 decls &&
10541054 decls . filter ( ( decl ) => {
1055- const mods = decl . modifiers ;
1056- return mods && mods . filter ( ( mod ) => mod . kind === ts . SyntaxKind . PrivateKeyword ) . length > 0 ;
1055+ const mods = ( decl as any ) . modifiers ;
1056+ return mods && mods . filter ( ( mod : any ) => mod . kind === ts . SyntaxKind . PrivateKeyword ) . length > 0 ;
10571057 } ) . length > 0
10581058 ) ;
10591059 } ) ;
@@ -1154,7 +1154,7 @@ export class JsonSchemaGenerator {
11541154 const requiredProps = props . reduce ( ( required : string [ ] , prop : ts . Symbol ) => {
11551155 const def = { } ;
11561156 this . parseCommentsIntoDefinition ( prop , def , { } ) ;
1157- const allUnionTypesFlags : number [ ] = ( < any > prop ) . type ?. types ?. map ?.( ( t : any ) => t . flags ) || [ ] ;
1157+ const allUnionTypesFlags : number [ ] = ( < any > prop ) . links ?. type ?. types ?. map ?.( ( t : any ) => t . flags ) || [ ] ;
11581158 if (
11591159 ! ( prop . flags & ts . SymbolFlags . Optional ) &&
11601160 ! ( prop . flags & ts . SymbolFlags . Method ) &&
@@ -1373,7 +1373,7 @@ export class JsonSchemaGenerator {
13731373
13741374 if ( definition . type === undefined ) {
13751375 // if users override the type, do not try to infer it
1376- if ( typ . flags & ts . TypeFlags . Union ) {
1376+ if ( typ . flags & ts . TypeFlags . Union && ( node === null || node . kind !== ts . SyntaxKind . EnumDeclaration ) ) {
13771377 this . getUnionDefinition ( typ as ts . UnionType , unionModifier , definition ) ;
13781378 } else if ( typ . flags & ts . TypeFlags . Intersection ) {
13791379 if ( this . args . noExtraProps ) {
0 commit comments