Skip to content

#117 - MappingTransformer: deprecate nested path target properties on an array destination - #256

Merged
njoubert-cleverage merged 2 commits into
mainfrom
117
Oct 9, 2026
Merged

njoubert-cleverage merged 2 commits into
mainfrom
117

Conversation

@njoubert-cleverage

Copy link
Copy Markdown
Member

Description

Refs #117.

On an array destination, a target property that is not writable by the PropertyAccessor is added as a literal key. This fallback is needed for simple names (name gives the name key, the most common usage), but a nested path such as address.city (or address[city], [address].city) silently creates an address.city literal key instead of a nested array or an error.

This PR deprecates this case: the literal key is still set, with a deprecation explaining the alternatives, and it will throw an \UnexpectedValueException in v6.0 (consistent with \stdClass destinations since #244).

  • [address.city]: literal key, no deprecation
  • [address][city]: nested array, no deprecation
  • name: name key, no deprecation

The other point of #117 (a missing source index returns null) depends on framework.property_access.throw_exception_on_invalid_index, already documented in the MappingTransformer reference; changing that default would break configurations relying on null for optional keys, so it is left for v6.0.

Checked end-to-end in process-bundle-demo with a demo.mapping_array_target_path process (the deprecation is logged for address.city only).

Requirements

  • Documentation updates
    • Reference
    • Cookbooks
    • Changelog
  • Unit tests

Breaking changes

None: deprecation only.

🤖 Generated with Claude Code

njoubert-cleverage and others added 2 commits October 9, 2026 14:29
… path target property (e.g. address.city) as a literal key of an array destination, it will throw in v6.0

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@njoubert-cleverage
njoubert-cleverage merged commit 4892095 into main Oct 9, 2026
17 checks passed
@njoubert-cleverage
njoubert-cleverage deleted the 117 branch October 9, 2026 12:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant