# Nest.js API Decorators

Set of decorators that can simplify DTO creation.

## Install the library

```bash
yarn add @pixelplex/api-decorators
```

## Use the library

### Example of usage

```typescript
import { ApiPropertyString, ApiPropertyArray } from '@pixelplex/api-decorators';

export class MyBodyDTO {

  @ApiPropertyString()
  comment: string;

  @ApiPropertyArray({ type: 'enum', enumValue: USER_ROLE, isNotEmpty: true, isUnique: true })
  roles: USER_ROLE[];
}
```

### List of decorators:

```typescript
ApiPropertyArray
ApiPropertyBigint
ApiPropertyBoolean
ApiPropertyDate
ApiPropertyEmail
ApiPropertyEnum
ApiPropertyFloat
ApiPropertyHash
ApiPropertyId
ApiPropertyJwt
ApiPropertyNumber
ApiPropertyPassword
ApiPropertyPhoneNumber
ApiPropertyString
```
