With modern versions of bash, you'd simply use mapfile in conjunction with the -c option of jq (as illustrated in several other SO threads, e.g. Convert a JSON array to a bash array of strings)
With older versions of bash, you would still use the -c option but would build up the array one item at a time, along the lines of:
while read -r line ; do
ary+=("$line")
done < <(jq -c .......)
Example
#!/bin/bash
function json {
cat<<EOF
[
{ "key" : "value1" },
{ "key" : "value2" },
{ "key" : "value3" }
]
EOF
}
while read -r line ; do
ary+=("$line")
done < <(json | jq -c .[])
printf "%s\n" "${ary[@]}"
Output:
{"key":"value1"}
{"key":"value2"}
{"key":"value3"}
declare -p bashArrayto your question.