@@ -470,8 +470,9 @@ export class Server {
470470 }
471471
472472 // Use utility functions for enum and type config
473+ // For enums, only use enum property (not type property)
473474 const enumConfig = this . getEnumConfig ( item ) ;
474- const typeConfig = this . getTypeConfig ( modelFieldType , isArray ) ;
475+ const typeConfig = enumConfig ? '' : this . getTypeConfig ( modelFieldType , isArray ) ;
475476
476477 // Build mongoose configuration
477478 const mongooseConfig = reference
@@ -492,8 +493,8 @@ export class Server {
492493 description: '${ this . pascalCase ( propName ) + ( modelName ? ` of ${ this . pascalCase ( modelName ) } ` : '' ) } ',
493494 ${ enumConfig } isOptional: ${ item . nullable } ,
494495 mongoose: ${ mongooseConfig } ,
495- roles: RoleEnum.S_EVERYONE,
496- ${ typeConfig }
496+ roles: RoleEnum.S_EVERYONE,${ typeConfig ? `
497+ ${ typeConfig } ` : '' }
497498 })
498499 ${ propName } : ${ ( reference ? reference : schema ? schema : enumRef || modelClassType ) + ( isArray ? '[]' : '' ) } ${ undefinedString }
499500 ` ;
@@ -592,8 +593,9 @@ export class Server {
592593 }
593594
594595 // Use utility functions for enum and type config
596+ // For enums, only use enum property (not type property)
595597 const enumConfig = this . getEnumConfig ( item ) ;
596- const typeConfig = this . getTypeConfig ( inputFieldType , item . isArray ) ;
598+ const typeConfig = enumConfig ? '' : this . getTypeConfig ( inputFieldType , item . isArray ) ;
597599
598600 result += `
599601 /**
@@ -602,8 +604,8 @@ export class Server {
602604 @UnifiedField({
603605 description: '${ this . pascalCase ( name ) + propertySuffix + ( modelName ? ` of ${ this . pascalCase ( modelName ) } ` : '' ) } ',
604606 ${ enumConfig } isOptional: ${ nullable || item . nullable } ,
605- roles: RoleEnum.S_EVERYONE,
606- ${ typeConfig }
607+ roles: RoleEnum.S_EVERYONE,${ typeConfig ? `
608+ ${ typeConfig } ` : '' }
607609 })
608610 ${ overrideFlag + this . camelCase ( name ) } ${ nullable || item . nullable ? '?' : '' } : ${ inputClassType } ${ item . isArray ? '[]' : '' } ${ propertyUndefinedString }
609611 ` ;
0 commit comments