Repository navigation
#117 - MappingTransformer: deprecate nested path target properties on an array destination - #256
Merged
Merged
Conversation
… 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>
Merged
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 (
namegives thenamekey, the most common usage), but a nested path such asaddress.city(oraddress[city],[address].city) silently creates anaddress.cityliteral 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
\UnexpectedValueExceptionin v6.0 (consistent with\stdClassdestinations since #244).[address.city]: literal key, no deprecation[address][city]: nested array, no deprecationname:namekey, no deprecationThe other point of #117 (a missing source index returns
null) depends onframework.property_access.throw_exception_on_invalid_index, already documented in the MappingTransformer reference; changing that default would break configurations relying onnullfor optional keys, so it is left for v6.0.Checked end-to-end in process-bundle-demo with a
demo.mapping_array_target_pathprocess (the deprecation is logged foraddress.cityonly).Requirements
Breaking changes
None: deprecation only.
🤖 Generated with Claude Code