Since some time I've the issue that @nestjs/swagger doesn't inference the types from typescript anymore.
For example I have the following DTO:
class UserBaseDto {
@ApiProperty({ example: "admin@example.com", description: "The email of the user" })
@IsEmail()
@IsNotEmpty()
@Expose()
email: string;
@Expose()
@ApiProperty({ example: UserRole.ADMIN, description: "The role of the user" })
role?: UserRole;
}
It won't recognize the UserRole as an enum until I explicitly set @ApiProperty({ enum: UserRole, example: UserRole.ADMIN, description: "The role of the user" }). The same goes for required: false.
What could have happened in a dependency upgrade, that @nestjs/swagger doesn't read the typescript anymore?