Skip to content

v1.0.0

Choose a tag to compare

@opheus2 opheus2 released this 25 Mar 21:52
· 11 commits to main since this release
719f6b0

Form Schema Validator PHP v1.0.0

v1.0.0 is the first stable release of the PHP validation package for Form Builder schemas and submissions.

Highlights

  • Validates published form schemas with support for pages, sections, fields, and supported field types
  • Validates submission payloads against schema-defined field rules, required flags, and field constraints
  • Supports field-aware rule parameters using {field:...} references
  • Supports runtime validation extensions for custom field behaviour and custom rule resolution
  • Supports direct callable-based field validation with boolean or message-style results
  • Covers common form field types, including text, numbers, dates, booleans, options, tags, email, URL, phone, country, and file inputs

Validation Support

  • Required and conditional required rules
  • String, numeric, boolean, date, time, and datetime validation
  • Comparison rules such as gt, gte, lt, lte, before, and after
  • Membership and range rules such as in, not_in, between, and not_between
  • Pattern and string-shape rules such as regex, starts_with, and ends_with
  • Constraint-driven validation for text length, numeric limits, option selections, allowed email domains, country allow/block lists, and file upload limits
  • Regex support for both delimited and plain schema-style patterns

Runtime Extension Hooks

  • fields: add extra runtime validations per field
  • rules: register custom schema rule resolvers
  • validate => callable: run direct custom validation logic and return:
    • true or null to pass
    • false to fail with fallback message
    • a string to fail with a custom message
    • ['valid' => bool, 'message' => ...] for explicit structured results

Developer Experience

  • Clear separation between schema field validations and runtime validation extensions
  • Lightweight API with SchemaValidator, SubmissionValidator, and ValidationResult
  • Tested behaviour across built-in rules, constraints, regex normalisation, and custom runtime validation hooks

Stability

  • Full package test suite passing for v1.0.0

Full Changelog: https://github.com/opheus2/form-schema-validator/commits/v1.0.0