I need to do some CURLs from which I'm building one output JSON. This is how I managed to perform a merge using a function:
...
ADDITIONALJSONDATA="{\"$DATATYPE\" : "$DATA"}"
MERGEDENTRY=$(echo $SOURCE | jq --argjson json "$ADDITIONALJSONDATA" '. += $json' | tr -d '\r\n')
...
It seems when JSON inside $DATA is big enough then I'm getting Argument list too long error. Is it possible (in a nice way) to treat JSON to merge as a single argument here?