Skip to content

Commit

Permalink
return array always (#163)
Browse files Browse the repository at this point in the history
Co-authored-by: “jdattatr-tibco” <“jdattatr@tibco.com”>
  • Loading branch information
jdattatr-tibco and “jdattatr-tibco” committed Jan 15, 2024
1 parent be76c55 commit abdae8e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
6 changes: 3 additions & 3 deletions function/json/descriptor.json
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,8 @@
},
{
"name": "jq",
"description": "process the JSON inputs based on a provided query and return the filtered output",
"example": "json.jq(inputJSON, \"query\") => output",
"description": "process the JSON inputs based on a provided query and return the filtered array output",
"example": "json.jq(inputJSON, \"query\") => [output1, output2 ...]]",
"args": [
{
"name": "inputJSON",
Expand All @@ -155,7 +155,7 @@
}
],
"return": {
"type": "any"
"type": "array"
},
"display": {
"visible": true
Expand Down
3 changes: 0 additions & 3 deletions function/json/jq.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,5 @@ func (jq) Eval(params ...interface{}) (interface{}, error) {
result = append(result, v)
}

if len(result) == 1 {
return result[0], nil
}
return result, nil
}

0 comments on commit abdae8e

Please sign in to comment.