Skip to content

Commit abdae8e

Browse files
jdattatr-tibco“jdattatr-tibco”
and
“jdattatr-tibco”
authored
return array always (#163)
Co-authored-by: “jdattatr-tibco” <“[email protected]”>
1 parent be76c55 commit abdae8e

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

function/json/descriptor.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,8 @@
142142
},
143143
{
144144
"name": "jq",
145-
"description": "process the JSON inputs based on a provided query and return the filtered output",
146-
"example": "json.jq(inputJSON, \"query\") => output",
145+
"description": "process the JSON inputs based on a provided query and return the filtered array output",
146+
"example": "json.jq(inputJSON, \"query\") => [output1, output2 ...]]",
147147
"args": [
148148
{
149149
"name": "inputJSON",
@@ -155,7 +155,7 @@
155155
}
156156
],
157157
"return": {
158-
"type": "any"
158+
"type": "array"
159159
},
160160
"display": {
161161
"visible": true

function/json/jq.go

-3
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,5 @@ func (jq) Eval(params ...interface{}) (interface{}, error) {
6161
result = append(result, v)
6262
}
6363

64-
if len(result) == 1 {
65-
return result[0], nil
66-
}
6764
return result, nil
6865
}

0 commit comments

Comments
 (0)