Skip to content

Release 1.5.1

Choose a tag to compare

@igorpocta igorpocta released this 10 Feb 08:29
· 72 commits to main since this release

Uninitialized Property Validation
Breaking Change: The validator no longer silently skips uninitialized typed properties that have validation attributes. Previously, sending empty data (e.g. {}) to a DTO with #[NotBlank], #[Valid], or other assert attributes would pass validation even though the properties were never set. This is now correctly reported as "This field is required.".

What changed:

  • Uninitialized properties with validation attributes now fail with "This field is required."
  • Uninitialized properties without validation attributes behave as before (silently skipped)
  • Validation group filtering is respected — only attributes matching active groups trigger the required check

New: #[SkipValidation] attribute to explicitly opt out of all validation on a property, including the uninitialized check. Use this for properties that are populated after construction or managed by other logic.

#[SkipValidation]
#[NotBlank] // ← ignored
public string $computedField;

Migration: If you relied on uninitialized properties passing validation, either set a default value or add #[SkipValidation].