-
Notifications
You must be signed in to change notification settings - Fork 17
/
array_create_labeled.json
46 lines (46 loc) · 1.56 KB
/
array_create_labeled.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
{
"id": "array_create_labeled",
"summary": "Create a labeled array",
"description": "Creates a new labeled array by using the values from the `labels` array as labels and the values from the `data` array as the corresponding values.\n\nThe exception `ArrayLengthMismatch` is thrown, if the number of the values in the given arrays don't match exactly.\n\nThe primary use case here is to be able to transmit labeled arrays from the client to the server as JSON doesn't support this data type.",
"categories": [
"arrays"
],
"experimental": true,
"parameters": [
{
"name": "data",
"description": "An array of values to be used.",
"schema": {
"description": "Any data type is allowed."
}
},
{
"name": "labels",
"description": "An array of labels to be used.",
"schema": {
"type": "array",
"items": {
"type": [
"number",
"string"
]
}
}
}
],
"returns": {
"description": "The newly created labeled array.",
"schema": {
"type": "array",
"subtype": "labeled-array",
"items": {
"description": "Any data type is allowed."
}
}
},
"exceptions": {
"ArrayLengthMismatch": {
"message": "The number of values in the parameters `data` and `labels` don't match."
}
}
}