You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+7Lines changed: 7 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,12 @@
1
1
# CHANGELOG
2
2
3
+
## [v4.3.1] - 2026-05-04
4
+
5
+
### Fixed
6
+
7
+
-**`fromJson()` list-rooted JSON rejection now matches the docblock contract.** Inputs that, after `trim`, begin with `[` and are not exactly `[]` throw `InvalidJsonException` at the start of `fromJson()`. Previously such inputs failed indirectly via downstream `RequiredValueException` during property resolution; catch sites that depended on the old exception type must be updated. The empty literal `[]` is intentionally permitted to preserve `toJson()` → `fromJson()` round-trips when `#[SkipOnNull]` empties an associative DTO (PHP's `json_encode([])` cannot disambiguate empty object from empty array).
8
+
-**Sub-DTO JSON-string parsing symmetry.** Construction-path sub-DTO properties already accepted JSON-like strings via `buildResolver()`; the union dispatch path (`valueDecide()`) now applies the same `is_string && jsonLike => fromJson()` rule, eliminating the inconsistency where `Foo $foo` accepted `'{...}'` but `Foo|Bar $foo` rejected the same input.
`InvalidJsonException` - The JSON string cannot be parsed into an object: malformed JSON, or non-empty list-rooted JSON (e.g. `[1,2,3]`). The empty literal `[]` is permitted to preserve `toJson()` → `fromJson()` round-trips when `#[SkipOnNull]` empties an associative DTO.
0 commit comments