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
{{ message }}
Repository navigation
fix: fill {{response}} placeholders in networkRequest result actions - #506
The Set Value Action docs store a response with {'key': 'data', 'value': '{{response}}'} inside a StacNetworkResult, but nothing ever filled that placeholder in. {{...}} values are only resolved against the registry when widgets are built, so the registry ended up holding the literal string {{response}}.
StacNetworkRequestParser now fills {{response}} placeholders in the matching result's action from the response body just before the action runs:
{{response}} is the whole body. {{response.user.name}} reads a nested field, and {{response.items[0].id}} or {{response.items.0.id}} read list items, the same path styles dynamicView supports.
A value that is only a placeholder keeps its type, so the docs example stores the actual map. A placeholder inside longer text, such as "Hi {{response.user.name}}", is inserted as text.
A placeholder whose path isn't in the body is left unchanged.
Error responses work the same way, using the error body.
If a result's action is itself a networkRequest, its own results are left alone so their {{response}} refers to that inner response.
The Network Request docs get a short "Using the response" section describing this.
Verified locally: dart analyze reports no issues in packages/stac, and the issue's repro now stores the response body.
New feature (non-breaking change which adds functionality)
Bug fix (non-breaking change which fixes an issue)
Breaking change (fix or feature that would cause existing functionality to change)
Code refactor
Build configuration change
Documentation
Chore
Summary by CodeRabbit
New Features
Network request result actions can now use {{response}} placeholders to access the full response body or nested fields, including list items.
Placeholders preserve the original value type when used alone and become text when embedded in a string. Unmatched paths remain unchanged.
Response values are substituted before the action runs, including for error status codes. The documentation also explains how to store responses with setValue.
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.
📝 Walkthrough
The network request parser now resolves {{response}} placeholders in matched result actions before dispatch. It supports nested map paths and list indexes. The documentation describes whole-value and embedded substitutions, unresolved paths, and substitution for error status codes.
Changes: Response placeholder resolution
Layer / File(s)
Summary
Resolve response placeholders before dispatch packages/stac/lib/src/parsers/actions/stac_network_request/stac_network_request_parser.dart, docs/actions/network_request.mdx
The parser resolves placeholders against the response body before dispatching the matched action. Whole-value placeholders retain their type. Embedded values are substituted as text, with maps and lists JSON-encoded. The documentation describes supported paths and substitution behavior.
This change fills response placeholders in network request result actions and documents the behavior. No actionable merge-blocking risk remains.
Pre-merge checks: 5
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
The title clearly and concisely describes the main change: resolving {{response}} placeholders in networkRequest result actions.
Linked Issues check
Issue #496 requires substitution of {{response}} before a matching network result action runs, with nested paths as an optional enhancement. The reviewed parser resolves whole-body, nested dot paths…
Out of Scope Changes check
The supplied change summary and reviewed files show two connected changes: response placeholder resolution in StacNetworkRequestParser and documentation for that behavior in `docs/actions/network_re…
Docstring Coverage
No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Full details: Linked Issues check
Explanation
Issue #496 requires substitution of {{response}} before a matching network result action runs, with nested paths as an optional enhancement. The reviewed parser resolves whole-body, nested dot paths, and bracket or dotted list indexes. It preserves the type of a whole-placeholder value, interpolates embedded placeholders as text, preserves unresolved placeholders, uses response.data for error responses, and excludes nested network-request results. The reviewed Network Request documentation also describes the behavior and the existing Set Value example remains supported.
Full details: Out of Scope Changes check
Explanation
The supplied change summary and reviewed files show two connected changes: response placeholder resolution in StacNetworkRequestParser and documentation for that behavior in docs/actions/network_request.mdx. Both changes implement issue #496. No unrelated change is evidenced.
Full details: Docstring Coverage
Explanation
No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0 files. (2 skipped: 2 unsupported.)
✨ Finishing Touches
🧪 Generate unit tests (beta)
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
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
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
The Set Value Action docs store a response with
{'key': 'data', 'value': '{{response}}'}inside aStacNetworkResult, but nothing ever filled that placeholder in.{{...}}values are only resolved against the registry when widgets are built, so the registry ended up holding the literal string{{response}}.StacNetworkRequestParsernow fills{{response}}placeholders in the matching result's action from the response body just before the action runs:{{response}}is the whole body.{{response.user.name}}reads a nested field, and{{response.items[0].id}}or{{response.items.0.id}}read list items, the same path stylesdynamicViewsupports."Hi {{response.user.name}}", is inserted as text.networkRequest, its ownresultsare left alone so their{{response}}refers to that inner response.The Network Request docs get a short "Using the response" section describing this.
Verified locally:
dart analyzereports no issues inpackages/stac, and the issue's repro now stores the response body.Related Issues
Closes #496
Type of Change
Summary by CodeRabbit
{{response}}placeholders to access the full response body or nested fields, including list items.setValue.