Skip to content

Commit ace07b5

Browse files
lixingwangFrank Martinez
authored and
Frank Martinez
committed
Update function example to have => split function and it's return
1 parent 7efec72 commit ace07b5

File tree

7 files changed

+59
-76
lines changed

7 files changed

+59
-76
lines changed

function/array/descriptor.json

+6-23
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
{
99
"name": "append",
1010
"description": "Append item to exist array",
11-
"example": "array.append($activity[xxx].array, \"new Item\")\nReturns\n [$activity.array, \"new Item\"]",
11+
"example": "array.append($activity[xxx].array, \"new Item\") => [$activity.array, \"new Item\"]",
1212
"args": [
1313
{
1414
"name": "items",
@@ -28,7 +28,7 @@
2828
{
2929
"name": "contains",
3030
"description": "Returns true if the item is found in the given array else returns false. The item type must match with the array type.",
31-
"example": "array.contains(array.create(\"A\",\"B\",\"C\"), \"B\")\nReturns\ntrue",
31+
"example": "array.contains(array.create(\"A\",\"B\",\"C\"), \"B\") => true",
3232
"args": [
3333
{
3434
"name": "array",
@@ -47,7 +47,7 @@
4747
{
4848
"name": "count",
4949
"description": "Count the length of an array",
50-
"example": "array.count($activity.array)\nReturns\n 2",
50+
"example": "array.count($activity.array) => 2",
5151
"args": [
5252
{
5353
"name": "items",
@@ -62,7 +62,7 @@
6262
{
6363
"name": "create",
6464
"description": "Create an array of *primitive types* from the given items. All items must be same primitive types e.g. string, integer etc and must match with the field type where this function is used.",
65-
"example": "array.create(\"A\",\"B\",\"C\")\nReturns\n[\"A\",\"B\",\"C\"]",
65+
"example": "array.create(\"A\",\"B\",\"C\") => [\"A\",\"B\",\"C\"]",
6666
"varArgs": true,
6767
"args": [
6868
{
@@ -82,7 +82,7 @@
8282
{
8383
"name": "delete",
8484
"description": "Delete the specific index of item in an array",
85-
"example": "array.delete(array.create(\"item1\",\"item2\"), 1)\nReturns\n [item1]",
85+
"example": "array.delete(array.create(\"item1\",\"item2\"), 1) => [item1]",
8686
"args": [
8787
{
8888
"name": "items",
@@ -99,27 +99,10 @@
9999
"valueType": "any"
100100
}
101101
},
102-
{
103-
"name": "forEach",
104-
"description": "Specify a source array argument to iterate through the array, or provide no argument to create a single-item array.",
105-
"example": "array.forEach($TriggerData.parameters.headers)\nReturns\nvoid\narray.forEach()\nReturns\nvoid",
106-
"args": [
107-
{
108-
"name": "input",
109-
"required": false,
110-
"type": "array",
111-
"valueType": "any"
112-
}
113-
],
114-
"return": {
115-
"type": "array",
116-
"valueType": "any"
117-
}
118-
},
119102
{
120103
"name": "get",
121104
"description": "Get the specify index of item in an array",
122-
"example": "array.get(array.create(\"item1\",\"item2\"), 1)\nReturns\n item2",
105+
"example": "array.get(array.create(\"item1\",\"item2\"), 1) => item2",
123106
"args": [
124107
{
125108
"name": "items",

function/coerce/descriptor.json

+12-12
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
{
1010
"name": "toType",
1111
"description": "convert value to specified type",
12-
"example": "coerce.toType(\"123\",\"int\")\nReturns\n123",
12+
"example": "coerce.toType(\"123\",\"int\") => 123",
1313
"args": [
1414
{
1515
"name": "value",
@@ -27,7 +27,7 @@
2727
{
2828
"name": "toString",
2929
"description": "convert value to a string",
30-
"example": "coerce.toString(123)\nReturns\n\"123\"",
30+
"example": "coerce.toString(123) => \"123\"",
3131
"args": [
3232
{
3333
"name": "value",
@@ -41,7 +41,7 @@
4141
{
4242
"name": "toInt",
4343
"description": "convert value to an int",
44-
"example": "coerce.toInt(\"333\")\nReturns\n333",
44+
"example": "coerce.toInt(\"333\") => 333",
4545
"args": [
4646
{
4747
"name": "value",
@@ -55,7 +55,7 @@
5555
{
5656
"name": "toInt32",
5757
"description": "convert value to an int32",
58-
"example": "coerce.toInt32(\"333\")\nReturns\n333",
58+
"example": "coerce.toInt32(\"333\") => 333",
5959
"args": [
6060
{
6161
"name": "value",
@@ -69,7 +69,7 @@
6969
{
7070
"name": "toInt64",
7171
"description": "convert value to a int64",
72-
"example": "coerce.toInt64(\"333\")\nReturns\n333",
72+
"example": "coerce.toInt64(\"333\") => 333",
7373
"args": [
7474
{
7575
"name": "value",
@@ -83,7 +83,7 @@
8383
{
8484
"name": "toFloat32",
8585
"description": "convert value to a float32",
86-
"example": "coerce.toFloat32(\"3.3\")\nReturns\n3.3",
86+
"example": "coerce.toFloat32(\"3.3\") => 3.3",
8787
"args": [
8888
{
8989
"name": "value",
@@ -97,7 +97,7 @@
9797
{
9898
"name": "toFloat64",
9999
"description": "convert value to a float64",
100-
"example": "coerce.toFloat64(\"3.3\")\nReturns\n3.3",
100+
"example": "coerce.toFloat64(\"3.3\") => 3.3",
101101
"args": [
102102
{
103103
"name": "value",
@@ -111,7 +111,7 @@
111111
{
112112
"name": "toBool",
113113
"description": "convert value to a bool",
114-
"example": "coerce.toBool(\"true\")\nReturns\ntrue",
114+
"example": "coerce.toBool(\"true\") => true",
115115
"args": [
116116
{
117117
"name": "value",
@@ -125,7 +125,7 @@
125125
{
126126
"name": "toBytes",
127127
"description": "convert value to bytes",
128-
"example": "coerce.toBytes(\"hello\")\nReturns\n3byte data",
128+
"example": "coerce.toBytes(\"hello\") => byte data",
129129
"args": [
130130
{
131131
"name": "value",
@@ -139,7 +139,7 @@
139139
{
140140
"name": "toParams",
141141
"description": "convert value to params",
142-
"example": "coerce.toParams($activity[xxx].xxx)\nReturns\nstring name-value map",
142+
"example": "coerce.toParams($activity[xxx].xxx) => string name-value map",
143143
"args": [
144144
{
145145
"name": "value",
@@ -152,7 +152,7 @@
152152
},
153153
{
154154
"name": "toObject",
155-
"example": "coerce.toObject($activity[xxx].xxx)\nReturns\n Json object",
155+
"example": "coerce.toObject($activity[xxx].xxx) => Json object",
156156
"description": "convert value to an object",
157157
"args": [
158158
{
@@ -167,7 +167,7 @@
167167
{
168168
"name": "toArray",
169169
"description": "convert value to an array",
170-
"example": "coerce.toArray($activity[xxx].xxx)\nReturns\n Json array",
170+
"example": "coerce.toArray($activity[xxx].xxx) => Json array",
171171
"args": [
172172
{
173173
"name": "value",

function/datetime/descriptor.json

+7-7
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
{
99
"name": "currentDate",
1010
"description": "Returns the current date with UTC time zone.",
11-
"example": "datetime.currentDate()\nReturns 2017-05-13+00:00",
11+
"example": "datetime.currentDate() => 2017-05-13+00:00",
1212
"args": [],
1313
"return": {
1414
"type": "string"
@@ -17,7 +17,7 @@
1717
{
1818
"name": "currentDatetime",
1919
"description": "Returns the current datetime with UTC timezone.",
20-
"example": "datetime.currentDatetime()\nReturns 2017-05-13T22:27:54+00:00",
20+
"example": "datetime.currentDatetime() => 2017-05-13T22:27:54+00:00",
2121
"args": [],
2222
"return": {
2323
"type": "string"
@@ -26,7 +26,7 @@
2626
{
2727
"name": "currentTime",
2828
"description": "Returns the current time with UTC timezone.",
29-
"example": "datetime.currentTime()\nReturns 22:27:54+00:00",
29+
"example": "datetime.currentTime() => 22:27:54+00:00",
3030
"args": [],
3131
"return": {
3232
"type": "string"
@@ -35,7 +35,7 @@
3535
{
3636
"name": "formatDate",
3737
"description": "Format the date according to the specified format.",
38-
"example": "datetime.formatDate(\"02/08/2017\", string.dateFormat())\nReturns\n 2017-02-08+00:00",
38+
"example": "datetime.formatDate(\"02/08/2017\", \"dd-MM-yyyy\")=> 08-02-2017",
3939
"args": [
4040
{
4141
"name": "date",
@@ -53,7 +53,7 @@
5353
{
5454
"name": "formatDatetime",
5555
"description": "Format the datetime according to the specified format.",
56-
"example": "datetime.formatDatetime(\"2017-04-10T22:17:32.000+0000\", string.datetimeFormat())\nReturns\n 2017-04-10T22:17:32+00:00",
56+
"example": "datetime.formatDatetime(\"2017-04-10T22:17:32.000+0700\", \"dd/MM/yyyy T hh:mm:ss\") => 10/04/2017 T 22:17:32",
5757
"args": [
5858
{
5959
"name": "datetime",
@@ -71,7 +71,7 @@
7171
{
7272
"name": "formatTime",
7373
"description": "Format the time according to the specified format.",
74-
"example": "datetime.formatTime(\"10:11:05.00000\", string.timeFormat())\nReturns\n 10:11:05+00:00",
74+
"example": "datetime.formatTime(\"10:11:05.00000\", \"hh-mm-ss\") => 10-11-05",
7575
"args": [
7676
{
7777
"name": "time",
@@ -89,7 +89,7 @@
8989
{
9090
"name": "now",
9191
"description": "Returns the current time with UTC timezone.",
92-
"example": "datetime.now()\nReturns 2017-05-13T15:59:41+00:00",
92+
"example": "datetime.now() => 2017-05-13T15:59:41+00:00",
9393
"args": [],
9494
"return": {
9595
"type": "string"

function/json/descriptor.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
{
1010
"name": "path",
1111
"description": "apply a json path to an object",
12-
"example": "json.path(\"$.key\",$activity[xxx].data)\nReturns\nvalue",
12+
"example": "json.path(\"$.key\",$activity[xxx].data) => value",
1313
"args": [
1414
{
1515
"name": "path",

function/number/descriptor.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
{
1010
"name": "random",
1111
"description": "generate a random number",
12-
"example": "number.random(100)\nReturns\n90",
12+
"example": "number.random(100) => 90",
1313
"varArgs": true,
1414
"args": [
1515
{

0 commit comments

Comments
 (0)