What's Changed
Added
- Slice validation:
Slice,SliceProperty,Each, andEachPropertyfor validating slices with per-element constraints. - HasUniqueValuesBy: Constraint to ensure slice elements are unique by a key function.
- Validate method on constraints: Constraints can now be used directly with
EachandThis.
Changed
- Validator initialization: Global validator replaced with atomic pointer for thread-safe usage. Use new validator setup methods in tests.
- CheckNoViolations: Now accepts variadic
errorsfor improved error handling and termination conditions. - Documentation: README restructured with installation, custom constraints, and property paths; expanded custom constraints guide with interface details and examples.
- Skill docs: SKILLS.md removed; new reference and skill documentation for adding validation constraints.
Fixed
- Correct handling of single violations returned from validatable objects in
validateIt.
Breaking Changes
- Tests using
CheckNoViolationsor validator setup need to be updated to the new signatures and helpers.
Full Changelog: v0.18.0...v0.19.0