Nestjs Api Standards
ASecurityDecorate nested object or array properties with both `@ValidateNested()` and `@Type(() => NestedDto)`, then enable transformation and validation at the application boundary. ```ts export class AddressDto { @IsString() street!: string; } export class CreateUserDto { @ValidateNested() @Type(() => AddressDto) address!: AddressDto; @ValidateNested({ each: true }) @Type(() => AddressDto) addresses!: AddressDto[]; } app.useGlobalPipes(new ValidationPipe({ transform: true, whitelist: true, forbidNon...
- 584 stars
- 0 votes
- 0 copies
- 2 views
- Added September 5, 2026
Security analysis
100/100Pro scans all 11 files and shows the line behind each finding
npx -y skills add HoangNguyen0403/agent-skills-standard --skill nestjs-api-standards --agent claude-codeAre you the author of Nestjs Api Standards?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/hoangnguyen0403-nestjs-api-standards-4a05c916)Decorate nested object or array properties with both `@ValidateNested()` and `@Type(() => NestedDto)`, then enable transformation and validation at the application boundary.
```ts
export class AddressDto {
@IsString()
street!: string;
}
export class CreateUserDto {
@ValidateNested()
@Type(() => AddressDto)
address!: AddressDto;
@ValidateNested({ each: true })
@Type(() => AddressDto)
addresses!: AddressDto[];
}
app.useGlobalPipes(new ValidationPipe({
transform: true,
whitelist: true,
forbidNonWhitelisted: true,
}));
```
Without `@Type`, `class-transformer` cannot instantiate the nested DTO reliably, so its validators may not run. Keep nested DTOs separate from ORM entities and map validated input before persistence.
Files in this skill
- eval-1.baseline.md
- eval-1.with-skill.md
- eval-2.baseline.md
- eval-2.with-skill.md
- eval-3.baseline.md
- eval-3.with-skill.md
- trigger-1.md
- trigger-2.md
- trigger-3.md
- trigger-4.md
Attribution
Related skills
View all in development →Comments
Loading comments…
Newsletter
Get the weekly list of safe new skills, and the ones we pulled.