Repository navigation
Add jsonField() resolver - #1317
Open
jsskeen-utah wants to merge 1 commit into
Open
jsskeen-utah wants to merge 1 commit into
jsskeen-utah wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
✅ No new issues found.
Approach: Sound: a core resolver reuses the AWS JSON lookup implementation rather than introducing different path rules.
Reviewed changes cover the resolver, shared utility move, AWS integration, tests, documentation, and release entries.
- JSON extraction: Adds
jsonField(source, path)with nested lookup, exact dotted-key precedence, empty-source handling, and resolution errors. - Shared lookup: Moves the helper and its tests into
packages/utils, preserving AWS extraction behavior. - Documentation and validation: Documents usage and error behavior. All 122 resolver tests and 11 lookup tests passed; the AWS plugin build succeeded.
gpt-6.1-sol | 𝕏
This branch has not been deployed
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
Adds a
jsonField(source, path)resolver that picks one field out of a JSON value:sourcecan be JSON text or any resolver that produces it.pathis a dot-separated path with the same rules as the nested-key lookup inawsSecret()andawsParam()(#1291):An empty or undefined source resolves to undefined. Invalid JSON, or a missing key, is a resolution error. The error lists the keys available where the path stopped.
The lookup moved from the AWS plugin into
packages/utilsso the plugin and the core resolver share one implementation. The plugin's behavior does not change.Testing
jsonField()cases for nested paths, exact dotted keys, objects and arrays, empty source, invalid JSON, and a missing key. The packed build also returns the expected values throughvarlock load.aws-vault exportsource all resolve as expected.@env-spec/utilstests pass, including the moved lookup tests.Docs
The new section is in
reference/functions.mdx, afterdomainFromUrl().