Skip to content

Commit a7eda48

Browse files
committed
Apply review comments
1 parent 26eca14 commit a7eda48

10 files changed

+36
-31
lines changed

docs/actions-docker.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,13 +236,16 @@ DATE=`date`
236236
echo "{ \"message\": \"Hello $NAME! It is $DATE.\" }"
237237
```
238238

239-
For the return result, not only support `dictionary` but also support `array`
239+
An action supports not only a JSON object but also a JSON array as a return value.
240240
```
241241
#!/bin/bash
242242
echo '["a", "b"]''
243243
```
244244

245-
And support array result for sequence action as well, the first action's array result can be used as next action's input parameter
245+
You can also create a sequence action with actions accepting an array param and returning an array result.
246+
247+
You can easily figure out the parameters with the following example:
248+
246249
```
247250
#!/bin/bash
248251
echo $1

docs/actions-dotnet.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ cd out
7979
zip -r -0 helloDotNet.zip *
8080
```
8181

82-
For the return result, not only support `dictionary` but also support `array`
82+
An action supports not only a JSON object but also a JSON array as a return value.
8383

8484
So a very simple `hello array` function would be:
8585

@@ -100,10 +100,9 @@ namespace Apache.OpenWhisk.Tests.Dotnet
100100
}
101101
}
102102
```
103+
You can also create a sequence action with actions accepting an array param and returning an array result.
103104

104-
And support array result for sequence action as well, the first action's array result can be used as next action's input parameter.
105-
106-
So the function can be:
105+
You can easily figure out the parameters with the following example:
107106

108107
```csharp
109108
using System;

docs/actions-go.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ func Main(obj map[string]interface{}) map[string]interface{} {
5858
}
5959
```
6060

61-
For the return result, not only support `map[string]interface{}` but also support `[]interface{}`
61+
An action supports not only a JSON object but also a JSON array as a return value.
6262

6363
So a very simple `hello array` function would be:
6464

@@ -71,9 +71,9 @@ func Main(event map[string]interface{}) []interface{} {
7171
}
7272
```
7373

74-
And support array result for sequence action as well, the first action's array result can be used as next action's input parameter.
74+
you can also create a sequence action with actions accepting an array param and returning an array result.
7575

76-
So the function can be:
76+
You can easily figure out the parameters with the following example:
7777

7878
```go
7979
package main

docs/actions-java.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,9 @@ public class Hello {
4848
}
4949
```
5050

51-
Not only support return JsonObject but also support return JsonArray, the main function would be:
51+
An action supports not only a JSON object but also a JSON array as a return value.
52+
53+
So the main function would be:
5254

5355
```java
5456
import com.google.gson.JsonArray;
@@ -63,9 +65,9 @@ public class HelloArray {
6365
}
6466
```
6567

66-
And support array result for sequence action as well, the first action's array result can be used as next action's input parameter.
68+
You can also create a sequence action with actions accepting an array param and returning an array result.
6769

68-
So the function would be:
70+
You can easily figure out the parameters with the following example:
6971

7072
```java
7173
import com.google.gson.JsonArray;

docs/actions-nodejs.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ and demonstrate how to bundle multiple JavaScript files and third party dependen
3131
}
3232
```
3333

34-
For the return result, not only support `dictionary` but also support `array`
34+
An action supports not only a JSON object but also a JSON array as a return value.
3535

3636
So a very simple `hello array` function would be:
3737

@@ -41,9 +41,9 @@ and demonstrate how to bundle multiple JavaScript files and third party dependen
4141
}
4242
```
4343

44-
And support array result for sequence action as well, the first action's array result can be used as next action's input parameter.
44+
You can also create a sequence action with actions accepting an array param and returning an array result.
4545

46-
So the function can be:
46+
You can easily figure out the parameters with the following example:
4747

4848
```javascript
4949
/**

docs/actions-php.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ function main(array $args) : array
4747
}
4848
```
4949

50-
For the return result, not only support `dictionary` but also support `array`
50+
An action supports not only a JSON object but also a JSON arary as a return value.
5151

5252
So a very simple `hello array` function would be:
5353

@@ -60,9 +60,9 @@ function main(array $args) : array
6060
}
6161
```
6262

63-
And support array result for sequence action as well, the first action's array result can be used as next action's input parameter.
63+
You can also create a sequence action with actions accepting an array param and returning an array result.
6464

65-
So the function can be:
65+
You can easily figure out the parameters with the following example:
6666

6767
```php
6868
<?php

docs/actions-python.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ def main(args):
3333
print(greeting)
3434
return {"greeting": greeting}
3535
```
36-
For the return result, not only support `dictionary` but also support `array`
36+
37+
An action supports not only a JSON object but also a JSON array as a return value.
3738

3839
So a very simple `hello array` function would be:
3940

@@ -42,14 +43,15 @@ def main(args):
4243
return ["a", "b"]
4344
```
4445

45-
And support array result for sequence action as well, the first action's array result can be used as next action's input parameter.
46+
You can also create a sequence action with actions accepting an array param and returning an array result.
4647

47-
So the function can be:
48+
You can easily figure out the parameters with the following example:
4849

4950
```python
5051
def main(args):
5152
return args
5253
```
54+
5355
Python actions always consume a dictionary and produce a dictionary.
5456
The entry method for the action is `main` by default but may be specified explicitly when creating
5557
the action with the `wsk` CLI using `--main`, as with any other action type.

docs/actions-ruby.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def main(args)
3939
end
4040
```
4141

42-
For the return result, not only support `dictionary` but also support `array`
42+
An action supports not only a JSON object but also a JSON array as a return value.
4343

4444
So a very simple `hello array` function would be:
4545

@@ -50,9 +50,9 @@ def main(args)
5050
end
5151
```
5252

53-
And support array result for sequence action as well, the first action's array result can be used as next action's input parameter.
53+
You can also create a sequence action with actions accepting an array param and returning an array result.
5454

55-
So the function can be
55+
You can easily figure out the parameters with the following example:
5656

5757
```ruby
5858
def main(args)

docs/actions-rust.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ pub fn main(args: Value) -> Result<Value, Error> {
5858

5959
Rust actions are mainly composed by a `main` function that accepts a JSON `serdes Value` as input and returns a `Result` including a JSON `serde Value`.
6060

61-
For the return result, not only support `A JSON serde Value` but also support `Array serde Value`
61+
An action supports not only a JSON object but also a JSON array as a return value.
6262

6363
So a simple `hello array` funtion would be:
6464

@@ -71,10 +71,9 @@ pub fn main(args: Value) -> Result<Value, Error> {
7171
serde_json::to_value(output)
7272
}
7373
```
74+
You can also create a sequence action with actions accepting an array param and returning an array result.
7475

75-
And support array result for sequence action as well, the first action's array result can be used as next action's input parameter.
76-
77-
So the function can be:
76+
You can easily figure out the parameters with the following example:
7877

7978
```rust
8079
extern crate serde_json;

docs/actions-swift.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ func main(args: Any) -> Any {
4646
```
4747
In this example the Swift action consumes a dictionary and produces a dictionary.
4848

49-
For the return result, not only support `dictionary`, but also support `array`
49+
An action supports not only a JSON object but also a JSON array as a return value.
5050

5151
So a very simple `hello array` function woule be:
5252

@@ -57,9 +57,9 @@ func main(args: Any) -> Any {
5757
}
5858
```
5959

60-
And support array result for sequence action as well, the first action's array result can be used as next action's input parameter.
60+
You can also create a sequence action with actions accepting an array param and returning an array result.
6161

62-
So the function can be:
62+
You can easily figure out the parameters with the following example:
6363

6464
```swift
6565
func main(args: Any) -> Any {

0 commit comments

Comments
 (0)