From c91eab357d2712849853750dc4c6cd2a0b3792fe Mon Sep 17 00:00:00 2001 From: Dan Jackson Date: Sun, 30 Nov 2025 11:17:54 -0800 Subject: [PATCH 1/2] Convert values to strings before using join function for jq 1.5 support Signed-off-by: Dan Jackson --- padd.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/padd.sh b/padd.sh index 21e3c4c..94469ed 100755 --- a/padd.sh +++ b/padd.sh @@ -353,7 +353,7 @@ GetPADDData() { # Using "paths(scalars | true)" will return null and false values. # We also check if the value is exactly `null` and, in this case, return the # string "null", as jq would return an empty string for nulls. - padd_data=$(echo "${response}" | jq -r 'paths(scalars | true) as $p | [$p | join(".")] + [if getpath($p)!=null then getpath($p) else "null" end] | join("=")' 2>/dev/null) + padd_data=$(echo "${response}" | jq -r 'paths(scalars | true) as $p | [[$p | .[] | tostring] | join(".")] + [if getpath($p)!=null then (getpath($p) | tostring) else "null" end] | join("=")' 2>/dev/null) fi } From e68a767af54383ea449d500e5463996f9103e763 Mon Sep 17 00:00:00 2001 From: yubiuser Date: Tue, 10 Mar 2026 13:11:29 +0100 Subject: [PATCH 2/2] Add tostring explanation Signed-off-by: yubiuser --- padd.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/padd.sh b/padd.sh index 94469ed..8917714 100755 --- a/padd.sh +++ b/padd.sh @@ -353,6 +353,7 @@ GetPADDData() { # Using "paths(scalars | true)" will return null and false values. # We also check if the value is exactly `null` and, in this case, return the # string "null", as jq would return an empty string for nulls. + # 'tostring' is necessary because jq < 1.6 does not convert numbers and bools automatically padd_data=$(echo "${response}" | jq -r 'paths(scalars | true) as $p | [[$p | .[] | tostring] | join(".")] + [if getpath($p)!=null then (getpath($p) | tostring) else "null" end] | join("=")' 2>/dev/null) fi }