Conversation
…jection Co-authored-by: intel352 <77607+intel352@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add support for non-string value references in json_response
feat(json_response): support Feb 27, 2026
_from references for raw value injection in body templates
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds support for _from references in step.json_response body templates to inject raw values from pipeline context without stringification. This enables composing multi-field API responses like {data: [...rows], meta: {total: N}} where data contains an array of objects rather than a stringified representation.
Changes:
- Introduced
resolveBodyValuemethod that recursively processes body values with special handling for{"_from": "path.to.value"}maps - Modified
resolveResponseBodyto use per-keyresolveBodyValueinstead ofResolveMapto enable raw value injection throughout the body tree - Added comprehensive test coverage for the new feature including nested structures, missing paths, and composite responses
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| module/pipeline_step_json_response.go | Implements recursive resolveBodyValue method that detects _from references (single-key maps) and injects raw values; replaces ResolveMap with manual iteration |
| module/pipeline_step_json_response_test.go | Adds three test cases covering basic _from usage, nested structures with mixed literal/reference values, and missing reference paths |
Contributor
|
@copilot apply changes based on the comments in this thread address all linter errors, ensure all tests pass. |
Co-authored-by: intel352 <77607+intel352@users.noreply.github.com>
Contributor
|
@copilot I'm still seeing linter errors |
Co-authored-by: intel352 <77607+intel352@users.noreply.github.com>
Contributor
Author
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.
_fromreferences instep.json_responsebodyresolveBodyValuemethod onJSONResponseStepto handle_frommap referencesresolveResponseBodyto useresolveBodyValuefor nested_fromresolution_frominside arrays (TestJSONResponseStep_BodyFromRefInArray)resolveBodyValuedoc comment explaining_fromsemantics and limitationexistsvariable in missing-path test)💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.