A TypeScript-first schema builder for runtime value parsing and validation with expressive, chainable APIs.
Yup is a JavaScript and TypeScript schema validation library that allows developers to define schemas for parsing, validating, and transforming data at runtime. It solves the problem of ensuring data integrity and structure in applications by providing an expressive API to model complex validation rules and type conversions.
JavaScript and TypeScript developers building applications that require robust data validation, such as form handling, API input validation, and configuration parsing.
Developers choose Yup for its seamless TypeScript integration, allowing automatic type inference from schemas, combined with a concise yet powerful API for defining validation logic, async support, and custom extensions.
Dead simple Object schema validation
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Yup automatically infers static types from schemas using InferType and allows enforcing schemas against existing TypeScript interfaces, as demonstrated in the README's type inference and ObjectSchema examples.
Supports asynchronous validation out of the box for both client-side and server-side scenarios, enabling complex async tests without extra setup, highlighted in the async validation sections.
Provides detailed validation errors and customizable messages, including i18n support via setLocale with function-based error objects, making debugging and localization straightforward.
Offers a plugin system with addMethod to extend schema types with custom type-safe methods, allowing for tailored validation logic, as shown in the extensibility documentation.
The README warns that values in custom transform functions are not guaranteed to be valid types, which can lead to runtime errors if not carefully handled, adding complexity to safe implementations.
Requires strictNullChecks to be enabled for type inference and recommends setting strictFunctionTypes to false, which may conflict with team standards or existing project linting rules.
All tests run asynchronously if any are async, introducing Promise overhead even for purely synchronous validations, which can impact performance in latency-sensitive applications.