Download the PHP package uuki/schemable-validator without Composer
On this page you can find all versions of the php package uuki/schemable-validator. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download uuki/schemable-validator
More information about uuki/schemable-validator
Files in uuki/schemable-validator
Package schemable-validator
Short Description Schema based validation plugin.
License MIT
Informations about the package schemable-validator
Schemable Validator
A dependency-free PHP form validation library. Define constraints once with a fluent API, validate server-side with zero external packages, and optionally export the same rules as JSON Schema for client-side consumption.
✨ Features
-
Define once, use everywhere. Server-side validation rules act as the single source of truth. Export them as JSON Schema (draft 2020-12) via
toJson()and share the same constraints with any frontend — built-in Zod and Valibot adapters included. Rules are defined through a fluent method-chain API. -
Pluggable engine and driver architecture. The built-in engine (
NativeAdapter) provides a fluent-interface-style API with zero dependencies. Swap inRespectAdapteror any customBackendAdapterwhen you need a different validation engine. Domain-specific logic — phone numbers, postal codes, image constraints, CAPTCHA (reCAPTCHA v3, hCaptcha, Turnstile) — is implemented as injectable drivers and can be replaced independently. - Zero dependencies, framework-agnostic. Built on plain PHP and TypeScript with no framework coupling. Reduces dependency lock-in and keeps the library easy to remove when your project outgrows it.
📦 Packages
| Package | Description |
|---|---|
uuki/schemable-validator |
PHP core library (framework-agnostic, zero dependencies) |
wp-schemable-validator |
WordPress plugin — REST endpoint, helpers, Schema Editor admin UI |
@uuki/schemable-validator-client |
TypeScript client — validates against JSON Schema output |
🚀 Quick start
1. Define constraints (PHP)
2. Server-side validation
3. Expose as REST endpoint (WordPress)
4. Client-side validation (TypeScript)
Or with Zod / Valibot adapters:
⚙️ Architecture
Constraints that cannot be expressed in JSON Schema (file uploads, custom rules) are recorded in x-unmapped-fields and validated server-side only.
🔧 Installation
See Installation for full setup.
📖 Documentation
Full documentation: uuki.github.io/schemable-validator
| Overview | Features, architecture |
| Installation | Requirements, package structure |
| SchemaBuilder | Fluent API, JSON Schema output, mergeJsonSchema() |
| Feature Guide | Validator, file validation, CAPTCHA, CSRF |
| Backend Adapters | Swapping the validation engine, custom adapters |
| Custom Validation | SV::custom(), escape hatches, x-unmapped-fields |
| MessageDict | Localisation, custom error messages |
🔗 Dependencies
The PHP core requires only PHP >= 7.4 and symfony/polyfill-php80.
No validation engine is bundled by default.
Optional engine packages are only loaded when explicitly installed:
- respect/validation ^2.2 — enables
RespectAdapterand the Respect driver (RespectRules,postalCode,creditCard,iban) - opis/json-schema ^2.6 — enables
OpisAdapter(strict JSON Schema semantics, no coercion)
📄 License
This project is open-sourced software licensed under the MIT License.