typestack/class-validator

Decorator-based property validation for classes.

View on GitHub ↗Jump to charts ↓

Summary Information

Updated 40 minutes ago
Added to GitGenius on September 5th, 2026
Created on October 3rd, 2015
Open Issues & Pull Requests: 319 (+0)
GitHub issues: Enabled
Number of forks: 848
Total Stargazers: 11,834 (+0)
Total Subscribers: 66 (+0)

Repository Insights (GitGenius)

Median issue/PR response: 9.8 days
Mean response time: 168.2 days
90th percentile: 392.5 days
Tracked items: 96

How this project is maintained

Around half of the issues opened in the past year never receive a reply. 99% of open issues come from outside the core team, so the backlog reflects real-world use rather than internal planning. Work labelled "type: question" is answered fastest, typically in about 3 days, while "flag: needs discussion" waits about 2 weeks. Only 2% of issues opened in the past year have been closed. Three people close 79% of everything that gets resolved.

Charts & Analytics

Fetching additional details & charts...

Issue Activity (beta)

Open issues: 89
New in 7 days: 1
Closed in 7 days: 1
Avg open age: 929 days
Stale 30+ days: 87
Stale 90+ days: 82

Recent activity

Opened in 7 days: 0
Closed in 7 days: 1
Comments in 7 days: 0
Events in 7 days: 0

Top labels

  • type: fix (54)
  • status: needs triage (50)
  • type: feature (44)
  • flag: needs discussion (35)
  • type: question (28)
  • priority: high (2)
  • status: has PR (1)
  • type: discussion (1)

Detailed Description

class-validator is a decorator-based validation library for TypeScript classes that works in both browser and Node.js environments.

The tool solves the problem of validating class properties by allowing developers to attach validation decorators directly to class fields. It internally uses validator.js to perform the actual validation checks. Developers can apply decorators like @IsEmail, @IsNotEmpty, and others to properties, then call the validate function on class instances to get back an array of ValidationError objects describing any failures. The library supports both decorator-based and non-decorator-based validation approaches.

The tool suits projects using TypeScript with class-based architectures, particularly those handling data validation in API servers or applications that need to validate user input against defined schemas. It handles complex scenarios including nested object validation, arrays, sets, maps, and promises. The library offers validation groups for conditional validation logic, custom validation decorators for domain-specific rules, and options for whitelisting unknown properties or skipping missing properties. A ValidatorOptions parameter controls validation behavior, with forbidUnknownValues set to true by default for security.

Development activity shows consistent maintenance with automated testing via CI workflows and code coverage tracking. The project maintains comprehensive documentation covering all validation decorators and usage patterns. Pull requests and issues receive attention, indicating active engagement with the user community. The codebase remains stable with established patterns for extending functionality through custom validators and service container integration.