diff --git a/proposals/POEM-support-array-result.md b/proposals/POEM-support-array-result.md new file mode 100644 index 00000000000..652be2dbe9f --- /dev/null +++ b/proposals/POEM-support-array-result.md @@ -0,0 +1,70 @@ + +# Title + +Currently, OpenWhisk supports returning a JSON object only, e.g. +```shell +# wsk action invoke hello -r +{ + "greeting": "Hello stranger!" +} +``` +It is necessary to support returning an array too as an array is also a proper JSON object, e.g. +```shell +# wsk action invoke hello-array -r +[ + "a", + "b" +] +``` +The sequence action should be considered support as well. + +# Status +* Current state: In-progress +* Author(s): @ningyougang + +# Summary and Motivation + +This POEM proposes a new feature that allows user to write their own action which supports an array result. +So actions would be able to return a JSON object or an array. + +# Proposed changes +## Openwhisk main repo +Make controller and invoker support both a JSON object and an array result. + +## Runtime repos +All runtime images should support an array result. e.g. + +* nodejs (supports by default) +* go +* java +* python +* php +* shell +* docker +* ruby +* dotnet +* rust +* swift +* deno +* ballerina + +## Openwhisk-cli repo +* The `wsk` CLI needs to support parsing an array result when executing actions. +* The `wsk` CLI needs to support parsing an array result when getting activations.