{"id":15176823,"url":"https://github.com/hungtcs/nest-validation-pipe","last_synced_at":"2026-02-16T03:34:18.406Z","repository":{"id":49775733,"uuid":"508649707","full_name":"hungtcs/nest-validation-pipe","owner":"hungtcs","description":"Inherits ValidationPipe of @nestjs/common, but provides override options decorator.","archived":false,"fork":false,"pushed_at":"2022-07-26T10:39:36.000Z","size":21,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-10T06:06:31.077Z","etag":null,"topics":["nestjs","validation","validation-pipe"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hungtcs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-06-29T10:43:46.000Z","updated_at":"2022-06-29T11:07:37.000Z","dependencies_parsed_at":"2022-09-11T15:30:20.301Z","dependency_job_id":null,"html_url":"https://github.com/hungtcs/nest-validation-pipe","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/hungtcs/nest-validation-pipe","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hungtcs%2Fnest-validation-pipe","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hungtcs%2Fnest-validation-pipe/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hungtcs%2Fnest-validation-pipe/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hungtcs%2Fnest-validation-pipe/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hungtcs","download_url":"https://codeload.github.com/hungtcs/nest-validation-pipe/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hungtcs%2Fnest-validation-pipe/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29499615,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-16T02:07:14.481Z","status":"online","status_checked_at":"2026-02-16T02:03:22.852Z","response_time":115,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["nestjs","validation","validation-pipe"],"created_at":"2024-09-27T13:42:53.698Z","updated_at":"2026-02-16T03:34:18.384Z","avatar_url":"https://github.com/hungtcs.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Nest Validation Pipe\n\nInherits `ValidationPipe` of `@nestjs/common`, but provides override options decorator.\n\nRelated:\n\n- https://github.com/nestjs/nest/issues/2390\n- https://github.com/nestjs/nest/issues/7779\n\n## Installation\n\n```shell\nnpm install nest-validation-pipe\n```\n\n## Usage\n\n```typescript\nimport { ValidationPipe } from 'nest-validation-pipe';\n\nasync function bootstrap() {\n  const app = await NestFactory.create(AppModule);\n\n  app.useGlobalPipes(\n    new ValidationPipe({\n      whitelist: true,\n      transform: true,\n    }),\n  );\n}\n```\n\n```typescript\nimport { ValidationOptions } from 'nest-validation-pipe';\n\n@ValidationOptions({\n  // Override global validation options\n  whitelist: false,\n})\nexport class SomeDTO {\n\n}\n```\n\n## Implementation Principle\n\n\u003chttps://github.com/nestjs/nest/blob/master/packages/common/pipes/validation.pipe.ts\u003e\n\n```typescript\nimport { ValidatorOptions, validate } from 'class-validator';\nimport { Injectable, SetMetadata, ValidationPipe as NestValidationPipe } from '@nestjs/common';\n\n@Injectable()\nexport class ValidationPipe extends NestValidationPipe {\n\n  protected validate(object: object, validatorOptions?: ValidatorOptions) {\n    const overrideOptions = Reflect.getMetadata(VALIDATION_OPTIONS, object.constructor);\n    return validate(object, { ...validatorOptions, ...overrideOptions });\n  }\n\n}\n\nexport const VALIDATION_OPTIONS = Symbol('VALIDATION_OPTIONS');\n\nexport function ValidationOptions(options: { whitelist?: boolean }) {\n  return SetMetadata(VALIDATION_OPTIONS, options);\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhungtcs%2Fnest-validation-pipe","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhungtcs%2Fnest-validation-pipe","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhungtcs%2Fnest-validation-pipe/lists"}