title: Nestjs IsEnum dto validation and swagger
body: <p>This is working fine:</p>
  
  <pre class="lang-js prettyprint-override"><code>    import { IsIn } from 'class-validator';
      import { ApiProperty } from '@nestjs/swagger';
  
      export class createEventDto {
        @IsIn([0, 1, 2, 3, 4, 5])
        @ApiProperty({
          description: 'description of the severity property',
        })
        severity: number;
      }
  </code></pre>
  
  <p>and looks like this in swagger:
  <a href="https://i.stack.imgur.com/VZLfr.png" rel="noreferrer"><img src="https://i.stack.imgur.com/VZLfr.png" alt="swagger-number"></a></p>
  
  <p>I am trying to understand how can I change severity type to enum, what I've tried:</p>
  
  <pre class="lang-js prettyprint-override"><code>export enum Severity {
    Critical = 1,
    Major = 2,
    Minor = 3,
    Warning = 2,
    Info = 1,
    Clear = 0,
  }
  </code></pre>
  
  <pre class="lang-js prettyprint-override"><code>    import { IsEnum } from 'class-validator';
      import { ApiProperty } from '@nestjs/swagger';
      import { Severity} from '../enums/severities';
  
      export class createEventDto {
        @IsEnum(Severity)
        @ApiProperty({
          description: 'description of the severity property',
        })
        severity: Severity;
      }
  </code></pre>
  
  <p>Although it is working, swagger looks a bit off (example is incorrect and the description for severity in schema becomes nested in brackets:
  <a href="https://i.stack.imgur.com/6icgT.png" rel="noreferrer"><img src="https://i.stack.imgur.com/6icgT.png" alt="swagger-enum"></a></p>