47 个仓库
Libraries for validating data structures, schemas, and business logic.
Explore 47 awesome GitHub repositories matching part of an awesome list · Data Validation. Refine with filters or upvote what's useful.
Zod is a TypeScript-first schema declaration and validation library designed to ensure end-to-end data integrity. It functions as a runtime type guard, allowing developers to define complex data structures through a declarative, chainable syntax. By using these schema definitions, the library automatically derives static TypeScript types, eliminating the need for manual type duplication and ensuring that runtime data matches expected application contracts. The library distinguishes itself through functional schema composition, which enables the creation of hierarchical structures by nesting a
TypeScript-first schema validation.
Pydantic is a data validation and serialization library that enforces schema constraints and performs type conversion on complex data structures. It utilizes standard Python type annotations to define data models, allowing developers to establish structured schemas that automatically enforce business rules and constraints without the need for custom domain-specific languages. The library distinguishes itself by transforming high-level model definitions into optimized code during initialization to minimize runtime overhead. It supports recursive validation for nested data structures and employ
Data validation using Python type hints.
Validator.js is a library of pure, stateless functions designed for the validation and sanitization of string data within any JavaScript environment. It provides a modular suite of tools to verify that user-provided information conforms to specific formats, such as emails, URLs, and dates, while simultaneously cleaning untrusted input to mitigate security risks. The library distinguishes itself through a design that avoids platform-specific APIs, ensuring consistent execution across browsers, servers, and edge runtimes. By utilizing a pre-compiled regular expression engine and a pure data tra
Library for string validation.
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
Minimalist object schema validation.
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
Object schema description and validation language.
Ajv is a JSON Schema validator and schema compilation engine used to verify that JavaScript objects conform to specific JSON Schema definitions. It functions as a data coercer and localization tool, allowing for the application of default values and the translation of validation error messages into different languages. The project converts declarative JSON Schema definitions into optimized JavaScript functions to increase validation speed. It supports the extension of validation logic through custom keywords and the generation of standalone validation code that executes without external depen
High-performance JSON Schema 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 field
Decorator-based class property validation.
async-validator 是一个 JavaScript 模式验证库和异步数据验证引擎。它通过应用递归规则和非阻塞的、基于 Promise 的执行来验证复杂的对象结构和嵌套数组,以确保数据完整性。 该库既充当对象约束验证器,也充当数据转换流水线。它允许通过在主要验证过程之前和之后运行的一系列函数来对输入值进行清洗、强制转换和格式化。 该引擎涵盖了一系列功能,包括递归嵌套验证、标准模式约束的强制执行,以及通过定制验证器函数集成自定义业务逻辑。它还提供了通过静态字符串或动态函数进行错误消息自定义和本地化的工具。
Asynchronous data validation.
Valibot is a modular, type-safe schema library for validating and parsing structural data in TypeScript environments.
Deno Valide gathers detailed information about every schema violation during data validation for comprehensive reporting.
Superstruct is a JavaScript and TypeScript data validation library used to verify that data structures match defined shapes and types. It functions as a composable schema builder and a TypeScript schema validator, ensuring that runtime data checks remain synchronized with static type definitions. The library features a data coercion engine that transforms input values or injects default values before the validation process is executed. It enables the creation of complex validation rules by nesting, merging, or omitting properties from existing structures. Its capabilities cover the validatio
Composable data validation for JS and TS.
本项目是一个 JSON Schema 验证库和框架,用于验证数据实例是否符合声明性定义。它作为一个验证引擎,强制执行结构约束和数据类型,同时也作为一个元验证器,确保模式定义本身在语法上符合官方元模式。 该库专为可扩展性而设计,允许用户通过将模式关键字映射到专门的可调用函数来定义自定义验证逻辑。它包括一个基于注册表的引用解析器,用于管理内部和外部 URI 引用,以便在不同文档间重用子模式。 该系统涵盖了广泛的验证功能,包括数据类型验证、针对电子邮件和 UUID 等类型的字符串格式检查,以及全面的错误报告。诊断工具提供嵌套错误跟踪和启发式过滤,以识别数据结构中最相关的失败。
Implementation of the JSON Schema specification.
v8n 是一款 JavaScript 数据验证库,用于验证值、对象和数组是否符合特定标准。它作为一个基于模式的验证器和异步验证引擎,利用流畅的 API 构建可链式调用的规则和约束序列。 该框架因其能够在验证过程中执行 Promise 和网络请求以确定值是否有效而脱颖而出。它允许创建可重用的验证模式,并提供了一个可自定义的规则框架,用户可以在其中定义自己的逻辑并配置如何返回错误结果。 该库涵盖了广泛的验证功能,包括针对原始类型和原型的数据类型验证、通过正则表达式和字符集的字符串内容验证,以及数值约束。它还支持复杂的对象验证、集合和数组元素验证,以及用于反转规则或处理可选值的条件逻辑。 该系统专为详细的错误收集而设计,根据每个定义的规则评估值,以收集完整的失败列表,而不是在第一个错误处停止。
Fluent JavaScript validation library.
Lightweight, extensible data validation library for Python
Lightweight and extensible data validation.
Schema validation just got Pythonic
Pythonic schema validation library.
该库是一个 PHP 框架,用于通过根据预定义约束验证标量值和复杂对象结构来强制执行数据完整性和业务规则。它提供了一种检查对象图和属性元数据的结构化方法,确保数据在被应用处理之前符合预期要求。 该框架的特色在于元数据驱动的映射系统,它使用反射或配置文件将规则直接应用于对象属性。它支持上下文规则编排,允许开发者将约束组织成逻辑组,根据应用状态或数据生命周期有选择地触发。该系统还采用基于访问者的遍历模式来检查复杂对象结构,并使用惰性加载仅在需要时实例化验证规则。 除了核心验证外,该库还包括用于数据格式化、时间比较和输入清理的实用程序。它具有解耦的架构,将约束定义与执行逻辑分离开来,从而能够创建可重用的、特定于领域的规则。错误处理通过翻译抽象层进行管理,该层将违规结果映射为本地化消息,以实现国际化的报告。
Validates values and object properties against predefined rule sets to ensure compliance with business logic.
JSON schema validator, which is designed to be fast and simple to use. JSON Schema versions through draft-07 are fully supported.
JSON Schema validation tool.
CONTRIBUTIONS ONLY: Voluptuous, despite the name, is a Python data validation library.
Data validation library for complex structures.
The validatorjs library makes data validation in JavaScript very easy in both the browser and Node.js. This library was inspired by the Laravel framework's Validator.
Data validation inspired by Laravel.
ForgJs is a javascript lightweight object validator.
Lightweight object validation.
A robust email syntax and deliverability validation library for Python.
Robust email syntax and deliverability validation.