Repository navigation
Release 1.9
Bug Fix: Nested validation error paths missing parent prefix
Problem: When a DTO contained a nested object property (e.g. additionalInfo) before an array property (e.g. addresses), validation error paths lost the parent prefix. For example, an invalid address type would report as addresses[0].type instead of the correct client.addresses[0].type.
Root cause: ObjectType and ArrayType reset the denormalizer's pathPrefix to an empty string after processing nested objects, instead of restoring the previous value. This corrupted error paths for any sibling properties processed afterward.
Fix: Both ObjectType and ArrayType now save and restore the previous pathPrefix using a finally block, ensuring parent context is preserved across sibling properties at any nesting depth.
Files changed:
src/Types/ObjectType.phpsrc/Types/ArrayType.phptests/PathPrefixRestoreTest.php(7 new tests)