Examples

Six schemas, real problems.

Signup, request bodies, orders, localization, arrays of records, and conditional fields. Click through, then open the playground to run them.

Required fields with chained string rules. The first failing rule per field wins, so password reports one clear reason.

user-signup.schema.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", "message": "add an uppercase letter" },
        { "rule": "hasDigit", "message": "add a number" }
      ] }
  ]
}