Skip to content

Commit

Permalink
Update swagger.md
Browse files Browse the repository at this point in the history
  • Loading branch information
kamilmysliwiec authored May 14, 2020
1 parent 8868b4a commit d7d0640
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions content/recipes/swagger.md
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ export class CreateCatDto {
We can pick a set of properties from this class using the `PickType()` utility function:

```typescript
export class UpdateCatAgeDto extends PickType(CreateCatDto, ['age']) {}
export class UpdateCatAgeDto extends PickType(CreateCatDto, ['age'] as const) {}
```

> info **Hint** The `PickType()` function is imported from the `@nestjs/swagger` package.
Expand All @@ -245,7 +245,7 @@ export class CreateCatDto {
We can generate a derived type that has every property **except** `name` as shown below. In this construct, the second argument to `OmitType` is an array of property names.

```typescript
export class UpdateCatDto extends OmitType(CreateCatDto, ['name']) {}
export class UpdateCatDto extends OmitType(CreateCatDto, ['name'] as const) {}
```

> info **Hint** The `OmitType()` function is imported from the `@nestjs/swagger` package.
Expand Down Expand Up @@ -282,7 +282,7 @@ The type mapping utility functions are composable. For example, the following wi

```typescript
export class UpdateCatDto extends PartialType(
OmitType(CreateCatDto, ['name']),
OmitType(CreateCatDto, ['name'] as const),
) {}
```

Expand Down

0 comments on commit d7d0640

Please sign in to comment.