mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-01-13 20:53:30 +01:00
[PR #297] [MERGED] Add an option to allow jsonpath/xpath to return as array #219
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/mountain-loop/yaak/pull/297
Author: @majcn
Created: 11/12/2025
Status: ✅ Merged
Merged: 11/13/2025
Merged by: @gschier
Base:
main← Head:fix/json_path_array📝 Commits (5)
fab1430Add an option to allow json/xpath to return as arraya5831d3Merge branch 'refs/heads/main' into fork/majcn/fix/json_path_arrayfbc0a0bMerge branch 'main' into fix/json_path_arrayc278310Merge remote-tracking branch 'majcn/fix/json_path_array' into fork/majcn/fix/json_path_array092b67aSwitch to select and refactor/improve a bunch of the plugin system📊 Changes
34 files changed (+797 additions, -335 deletions)
View changed files
📝
package-lock.json(+1 -6)📝
packages/plugin-runtime-types/src/bindings/gen_events.ts(+4 -2)📝
packages/plugin-runtime-types/src/plugins/AuthenticationPlugin.ts(+21 -6)📝
packages/plugin-runtime-types/src/plugins/TemplateFunctionPlugin.ts(+23 -13)📝
packages/plugin-runtime-types/src/plugins/index.ts(+5 -2)📝
packages/plugin-runtime/src/PluginInstance.ts(+17 -44)➕
packages/plugin-runtime/src/common.ts(+56 -0)📝
packages/plugin-runtime/src/migrations.ts(+2 -5)➕
packages/plugin-runtime/tests/common.test.ts(+150 -0)📝
plugins/auth-aws/src/index.ts(+1 -9)📝
plugins/auth-oauth2/src/index.ts(+2 -0)📝
plugins/template-function-fs/src/index.ts(+4 -4)📝
plugins/template-function-json/package.json(+1 -0)📝
plugins/template-function-json/src/index.ts(+88 -18)📝
plugins/template-function-response/package.json(+1 -6)📝
plugins/template-function-response/src/index.ts(+118 -65)📝
plugins/template-function-xml/package.json(+1 -0)📝
plugins/template-function-xml/src/index.ts(+56 -10)📝
src-tauri/src/plugin_events.rs(+1 -1)📝
src-tauri/yaak-models/src/db_context.rs(+3 -3)...and 14 more files
📄 Description
In case like this:
if you put
$..nameit only returned first value: "111"I understand why this behavior is expected since JsonPath is always returning array, that's why I added new checkbox to force return as array
The other option I was considering was to just simply check if array length is > 1, but this can be a bit misleading when only a single value is returned in results like
$..name🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.