{}
json-schematics
-v2
Docs
Reference
Examples
Tests
GitHub
Playground
Playground
← back to docs
Example
Email validation
Password strength
Username rules
URL must be HTTPS
UUID
Enum (inOptions)
Slug (matchRegex)
Age range (between)
Positive price
Integer quantity
Date within a range
Must be in the future
Before a fixed date
Tags: min + unique
Items in options
Max items
Trim + capitalize
Uppercase
Price math (×1.2, round)
Default value
Array to object
Conditional required
Depends on another field
Field-present gate
User signup
HTTP request body
E-commerce order
Array of users (row ids)
Localized error (ar)
schema.json
JSON
{ "version": "2.0", "fields": [ { "target": "name", "required": true, "validate": [ { "rule": "notEmpty" }, { "rule": "maxLength", "args": { "max": 60 } } ] }, { "target": "email", "required": true, "validate": [ { "rule": "email" } ] }, { "target": "password", "required": true, "validate": [ { "rule": "minLength", "args": { "min": 8 } }, { "rule": "hasUpper" }, { "rule": "hasDigit" } ] } ] }
data.json
JSON
{ "name": "", "email": "bad", "password": "weak" }
▶ Validate
⚙ Operate
{ } Format JSON
29 examples · runs against the live Go library
Ready
Pick an example, then hit Validate or Operate.