fix(parsers.json_v2): reset sub-path results for each object config#19222
Open
larrasket wants to merge 1 commit into
Open
fix(parsers.json_v2): reset sub-path results for each object config#19222larrasket wants to merge 1 commit into
larrasket wants to merge 1 commit into
Conversation
processObjects appended every object config's field/tag path results to the shared subPathResults slice without clearing it between objects. The recorded indexes are byte offsets within each object's own scoped JSON, so when two objects had structurally similar sub-documents, a field in a later object matched an earlier object's entry and took its rename and type. With two objects each selecting a field at the same relative path, both fields were emitted under the first object's rename. Reset subPathResults at the start of each object iteration so path results are only matched within the object they belong to.
Contributor
|
Thanks so much for the pull request! |
Author
|
!signed-cla |
Contributor
|
Download PR build artifacts for linux_amd64.tar.gz, darwin_arm64.tar.gz, and windows_amd64.zip. 📦 Click here to get additional PR build artifactsArtifact URLs |
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.
Summary
processObjectsappended object config's field/tag path results to the sharedsubPathResultsslice without clearing it between objects. The recorded indexes are byte offsets within each object's own scoped JSON, when two objects had structurally similar sub-documents, a field in a later object matched an earlier object's entry and took its rename and type. With two objects each selecting a field at the same relative path, both fields were emitted under the first object's rename.this resets
subPathResultsat the start of each object iteration so path results are only matched within the object they belong to.Checklist
Related issues
resolves #16361