awesome-repositories.com
Blog
awesome-repositories.com

Entdecke die besten Open-Source-Repositories mit KI-gestützter Suche.

EntdeckenKuratierte SuchenOpen-Source-AlternativenSelf-hosted SoftwareBlogSitemap
ProjektÜber unsRanking-MethodikPresseMCP-Server
RechtlichesDatenschutzAGB
© 2026 Bringes Technology SRL·VAT RO45896025·hello@awesome-repositories.com
·
typestack avatar

typestack/class-validator

0
View on GitHub↗
11,796 Stars·845 Forks·TypeScript·MIT·5 Aufrufe

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.

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.

Star-Verlauf

Star-Verlauf für typestack/class-validatorStar-Verlauf für typestack/class-validator

KI-Suche

Entdecke weitere awesome Repositories

Beschreibe in einfachen Worten, was du brauchst — die KI bewertet tausende kuratierte Open-Source-Projekte nach Relevanz.

Start searching with AI

Open-Source-Alternativen zu Class Validator

Ähnliche Open-Source-Projekte, sortiert nach der Anzahl der gemeinsamen Funktionen mit Class Validator.
  • hapijs/joiAvatar von hapijs

    hapijs/joi

    21,192Auf GitHub ansehen↗

    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
    Auf GitHub ansehen↗21,192
  • open-circle/valibotAvatar von open-circle

    open-circle/valibot

    8,769Auf GitHub ansehen↗

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

    TypeScriptbundle-sizemodularparsing
    Auf GitHub ansehen↗8,769
  • jquense/yupAvatar von jquense

    jquense/yup

    23,673Auf GitHub ansehen↗

    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
    Auf GitHub ansehen↗23,673
  • go-ozzo/ozzo-validationAvatar von go-ozzo

    go-ozzo/ozzo-validation

    4,072Auf GitHub ansehen↗

    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
    Auf GitHub ansehen↗4,072
Alle 30 Alternativen zu Class Validator anzeigen→

Häufig gestellte Fragen

Was macht 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.

Was sind die Hauptfunktionen von typestack/class-validator?

Die Hauptfunktionen von typestack/class-validator sind: Data Validation, Class Property Validation, Property Whitelisting, Asynchronous Validators, Contextual Validation Groups, Recursive Hierarchy Validation, Strict Schema Enforcers, Asynchronous Validation.

Welche Open-Source-Alternativen gibt es zu typestack/class-validator?

Open-Source-Alternativen zu typestack/class-validator sind unter anderem: 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…