Download Latest Version Released version 1.3.6 source code.zip (23.7 kB)
Email in envelope

Get an email when there's a new version of nette Schema

Home / v1.3.6
Name Modified Size InfoDownloads / Week
Parent folder
README.md 2026-08-17 2.0 kB
Released version 1.3.6 source code.tar.gz 2026-08-17 15.6 kB
Released version 1.3.6 source code.zip 2026-08-17 23.7 kB
Totals: 3 Items   41.3 kB 0

A round of fixes to the corners of the validation pipeline that only bite once your schema gets interesting: nullable arrays, invalid keys, deprecated items and anyOf() branches. On top of that, castTo() now speaks backed enums.

✨ New Features

  • castTo() now accepts a backed enum – Expect::string()->castTo(Status::class) converts the value via Status::from() and, when it doesn't match, reports a proper validation error listing all allowed cases instead of blowing up with a ValueError. Pure (non-backed) enums are rejected up front with a clear message.
  • Casting to a class that can't swallow the given value no longer surfaces as a bare Error – you get an InvalidStateException naming the target class, so you know what failed to be constructed.

🐛 Bug Fixes

  • A null value for a nullable array is finally left as null. Previously the "NEON can't tell null from an empty array" workaround kicked in even for schemas explicitly declared nullable(), silently turning your null into [].
  • Items with an invalid key are now dropped instead of being merged together – all failing keys used to collapse into a single '' entry, quietly overwriting each other's values.
  • Processor::getWarnings() no longer dies with an error when called before anything was processed; it simply returns an empty array.
  • deprecated() on a required structure no longer emits a warning when the item isn't present in the input at all – you only get warned about deprecated items you actually used.
  • anyOf() stopped losing information in the winning branch: dynamic parameters found inside are propagated to the outer context again (they used to be silently forgotten, so DI never validated them), and skipDefaults is now honored inside the branch. A DynamicParameter schema also no longer registers itself for deferred validation.
  • Error messages keep unknown %placeholders% intact instead of tripping over an undefined index.
Source: README.md, updated 2026-08-17