awesome-repositories.com
Blog
awesome-repositories.com

Descubre los mejores repositorios open-source con nuestra búsqueda potenciada por IA.

ExplorarBúsquedas curadasAlternativas open-sourceSoftware autohospedableBlogMapa del sitio
ProyectoAcerca deCómo clasificamosPrensaServidor MCP
Aviso legalPrivacidadTérminos
© 2026 Bringes Technology SRL·VAT RO45896025·hello@awesome-repositories.com
·
typestack avatar

typestack/class-validator

0
View on GitHub↗

Class Validator

class-validator is a TypeScript class validation library that uses decorators to define constraints and rules for object properties. It functions as a decorator-based schema validator that ensures data integrity and structural correctness through a combination of synchronous checks and promise-based asynchronous rules.

The library provides a recursive validation system for checking complex data hierarchies, including nested classes and individual elements within collections. It includes an object property whitelist utility capable of stripping undocumented properties or blocking unknown fields from entering a validated class instance.

The framework covers a broad range of capabilities, including custom validation rule definition, conditional execution, and validation grouping for context-specific schemas. It also supports dynamic error message interpolation and the integration of external services via dependency injection for custom constraints.

Búsqueda con IA

Explora más repositorios increíbles

Describe lo que necesitas en lenguaje sencillo: la IA clasifica miles de proyectos open-source curados por relevancia.

Start searching with AI

Features

  • Data Validation - Ensures TypeScript class properties meet specific criteria using decorators to maintain data integrity and type safety.
  • Class Property Validation - Checks that class properties meet specific criteria using decorators to ensure data integrity before processing.
  • Property Whitelisting - Compares object keys against decorated class properties to strip or block non-whitelisted data.
  • Asynchronous Validators - Supports promise-based asynchronous rules for verifying data against external sources or databases.
  • Contextual Validation Groups - Assigns decorators to specific groups to apply different validation schemas to the same object in different contexts.
  • Recursive Hierarchy Validation - Provides a recursive validation system for checking complex data hierarchies and individual elements within collections.
  • Strict Schema Enforcers - Blocks objects containing properties not defined in the class to ensure strict adherence to the data schema.
  • Asynchronous Validation - Wraps validation checks in promises to allow for network requests or database lookups before returning results.
  • Schema Tree Traversers - Recursively walks through nested objects and collections to apply validation rules across deep data hierarchies.
  • Custom Validation Rules - Allows defining reusable validation logic by implementing constraint interfaces and registering them globally.
  • Nested Object Validation - Recursively checks properties that are instances of other decorated classes or multi-dimensional arrays.
  • Recursive Object Validation - Implements a recursive validation system for verifying complex data hierarchies, including nested classes and collections.
  • Decorator-Based Validation - Uses TypeScript decorators to define constraints and rules for object properties as metadata.
  • Validation Grouping - Filters which validation constraints to run by matching active group names against metadata tags.
  • Validation Libraries - Offers a comprehensive library of decorator-driven rules for verifying data integrity and structural correctness in TypeScript classes.
  • Additional Property Filtering - Removes properties without decorators from an object or triggers errors when non-whitelisted properties are found.
  • Metadata Collection - Uses TypeScript decorators to store validation constraints as metadata for runtime retrieval.
  • Conditional Validation Rules - Allows skipping specific property checks based on boolean condition functions or property-level triggers.
  • Conditional Enforcement - Supports applying specific sets of validation constraints based on active group tags for context-dependent schemas.
  • Dependency-Injected Constraints - Enables providing external tools and data to custom validation constraint classes via a service container.
  • Input Sanitization - Includes an object property whitelist utility to strip undocumented properties and prevent unknown fields from entering the system.
  • Property Strictness - Provides a whitelist utility that ensures objects contain only specified keys by stripping or prohibiting extra properties.
  • Array Schema Validation - Applies validation rules to every individual element within arrays, sets, or maps.
  • Dependency Injection Containers - Integrates a service container to resolve custom validation logic and provide external dependencies to validators.
  • Request Validation - Provides utilities to validate incoming request data against class-based schemas to ensure security and correctness.
  • External Data Validation - Processes properties that return promises to allow for validation requiring external data or API calls.
  • Data Validation - Decorator-based class property validation.
11,796 estrellas·845 forks·TypeScript·MIT·8 vistas

Historial de estrellas

Gráfico del historial de estrellas de typestack/class-validatorGráfico del historial de estrellas de typestack/class-validator

Preguntas frecuentes

¿Qué hace typestack/class-validator?

class-validator is a TypeScript class validation library that uses decorators to define constraints and rules for object properties. It functions as a decorator-based schema validator that ensures data integrity and structural correctness through a combination of synchronous checks and promise-based asynchronous rules.

¿Cuáles son las características principales de typestack/class-validator?

Las características principales de typestack/class-validator son: Data Validation, Class Property Validation, Property Whitelisting, Asynchronous Validators, Contextual Validation Groups, Recursive Hierarchy Validation, Strict Schema Enforcers, Asynchronous Validation.

¿Qué alternativas de código abierto existen para typestack/class-validator?

Las alternativas de código abierto para typestack/class-validator incluyen: hapijs/joi — Joi is a JavaScript data validation library used to define schemas that validate, cast, and sanitize data objects. It… open-circle/valibot — Valibot is a modular, type-safe schema library for validating and parsing structural data in TypeScript environments. jquense/yup — Yup is a JavaScript schema validation library used to define data shapes and validate runtime values. It functions as… go-ozzo/ozzo-validation — ozzo-validation is a programmable data validation library for Go that verifies structs, maps, and primitive types… yiminghe/async-validator — async-validator is a JavaScript schema validation library and asynchronous data validation engine. It verifies complex… neoremind/fluent-validator — Fluent-validator is a Java validation framework designed to enforce data integrity through declarative constraints and…

Alternativas open-source a Class Validator

Proyectos open-source similares, clasificados según cuántas características comparten con Class Validator.
  • hapijs/joiAvatar de hapijs

    hapijs/joi

    21,192Ver en GitHub↗

    Joi is a JavaScript data validation library used to define schemas that validate, cast, and sanitize data objects. It functions as an object schema validator and parser, ensuring that input data matches specific types and formats before it is processed by an application. The library features a conditional validation engine capable of dynamic schema enforcement, where validation logic and dependencies change based on the values of other keys within an object. It also serves as a data casting and sanitization tool, transforming input values into target types and removing sensitive keys from the

    JavaScripthapijavascriptschema
    Ver en GitHub↗21,192
  • open-circle/valibotAvatar de open-circle

    open-circle/valibot

    8,769Ver en GitHub↗

    Valibot is a modular, type-safe schema library for validating and parsing structural data in TypeScript environments.

    TypeScriptbundle-sizemodularparsing
    Ver en GitHub↗8,769
  • jquense/yupAvatar de jquense

    jquense/yup

    23,673Ver en GitHub↗

    Yup is a JavaScript schema validation library used to define data shapes and validate runtime values. It functions as an object schema validator and a data coercion engine, allowing developers to transform raw input values into desired types before performing validation checks. The library is distinguished by its support for dynamic schema validation, where rules can be adjusted at runtime based on sibling field values or external context. It also enables recursive data structuring for polymorphic fields and provides a system for extracting static TypeScript interfaces from runtime schema def

    TypeScript
    Ver en GitHub↗23,673
  • go-ozzo/ozzo-validationAvatar de go-ozzo

    go-ozzo/ozzo-validation

    4,072Ver en GitHub↗

    ozzo-validation is a programmable data validation library for Go that verifies structs, maps, and primitive types using a declarative, rule-based approach. It functions as an interface-based validator, allowing for the recursive checking of nested data structures and custom types without the use of struct tags. The framework distinguishes itself as a context-aware validation engine, supporting the propagation of request-scoped data to rules that depend on external state. It provides extensive extensibility through custom rule definitions and the ability to override default failure text with l

    Gogogolangozzo
    Ver en GitHub↗4,072
Ver las 30 alternativas a Class Validator→