Skip to content

Commit 3014b87

Browse files
authored
[Proposal] POEM: provide array result for all runtime images (#5244)
* POEM support array result * Add missing runtime * Apply review comment
1 parent c507069 commit 3014b87

File tree

1 file changed

+70
-0
lines changed

1 file changed

+70
-0
lines changed
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
<!--
2+
#
3+
# Licensed to the Apache Software Foundation (ASF) under one or more
4+
# contributor license agreements. See the NOTICE file distributed with
5+
# this work for additional information regarding copyright ownership.
6+
# The ASF licenses this file to You under the Apache License, Version 2.0
7+
# (the "License"); you may not use this file except in compliance with
8+
# the License. You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing, software
13+
# distributed under the License is distributed on an "AS IS" BASIS,
14+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
# See the License for the specific language governing permissions and
16+
# limitations under the License.
17+
#
18+
-->
19+
# Title
20+
21+
Currently, OpenWhisk supports returning a JSON object only, e.g.
22+
```shell
23+
# wsk action invoke hello -r
24+
{
25+
"greeting": "Hello stranger!"
26+
}
27+
```
28+
It is necessary to support returning an array too as an array is also a proper JSON object, e.g.
29+
```shell
30+
# wsk action invoke hello-array -r
31+
[
32+
"a",
33+
"b"
34+
]
35+
```
36+
The sequence action should be considered support as well.
37+
38+
# Status
39+
* Current state: In-progress
40+
* Author(s): @ningyougang
41+
42+
# Summary and Motivation
43+
44+
This POEM proposes a new feature that allows user to write their own action which supports an array result.
45+
So actions would be able to return a JSON object or an array.
46+
47+
# Proposed changes
48+
## Openwhisk main repo
49+
Make controller and invoker support both a JSON object and an array result.
50+
51+
## Runtime repos
52+
All runtime images should support an array result. e.g.
53+
54+
* nodejs (supports by default)
55+
* go
56+
* java
57+
* python
58+
* php
59+
* shell
60+
* docker
61+
* ruby
62+
* dotnet
63+
* rust
64+
* swift
65+
* deno
66+
* ballerina
67+
68+
## Openwhisk-cli repo
69+
* The `wsk` CLI needs to support parsing an array result when executing actions.
70+
* The `wsk` CLI needs to support parsing an array result when getting activations.

0 commit comments

Comments
 (0)