fix(swift): resolve only top-level path and call objects as bindings - #2326
Open
andrewkolos wants to merge 1 commit into
Open
fix(swift): resolve only top-level path and call objects as bindings#2326andrewkolos wants to merge 1 commit into
andrewkolos wants to merge 1 commit into
Conversation
resolveDynamicValue recursed into every plain object and array, so a literal value that merely contained a nested path key was rewritten to a data lookup (usually null) and a nested call key executed its function during value resolution. The TS core resolves only single DynamicValue objects, matching the schema rule that prevents arbitrary nesting; the Swift resolver now does the same, and non-binding containers pass through unchanged.
Contributor
There was a problem hiding this comment.
Code Review
This pull request simplifies the resolveDynamicValue function in DataContext.swift by removing recursive resolution for nested dictionaries and arrays. Now, only top-level path or call objects are treated as bindings, while other containers pass through unchanged. The unused OrderedCollections import was removed, and the unit tests were updated to verify this pass-through behavior. I have no feedback to provide.
pinieb
approved these changes
Aug 18, 2026
andrewkolos
enabled auto-merge (squash)
August 18, 2026 19:01
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.
DataContext.resolveDynamicValuerecursed into every plain object and array, treating any nested"path"or"call"key as a binding. Two consequences for legal payloads:"path"string key was rewritten by a data-model lookup:{"icon": {"path": "M12 2L2 7"}}resolved to{"icon": null}. Elements of literal arrays got the same treatment everywhere arrays are legal."call"key executed its catalog function during value resolution, so a function embedded in a literal ran on every tree rebuild, meaning on every data update, rather than when something invoked it.resolveDynamicValuenow treats only a top-level"path"or"call"object as a binding and passes every other value through unchanged. This is compliant with the schema, which restricts values to singleDynamicValuetypes and "prevents arbitrary nesting."Pre-launch Checklist
One time:
For this PR:
If you need help, consider asking for advice on the discussion board.