Skip to content

Commit

Permalink
array_append: Added number type for labels to be consistent with …
Browse files Browse the repository at this point in the history
…other processes. Default to numerical index instead of string. (#478)
  • Loading branch information
m-mohr authored Oct 27, 2023
1 parent 4fd92b2 commit ab4a62e
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 7 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [2.0.0-rc.1] - 2023-05-25

### Fixed

- `array_append`: Added `number` type for labels to be consistent with other processes. Default to numerical index instead of string. Clarify that the `label` parameter only applies to labeled arrays.

### Added

- New processes in proposal state:
Expand Down
22 changes: 15 additions & 7 deletions array_append.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,20 @@
},
{
"name": "label",
"description": "If the given array is a labeled array, a new label for the new value should be given. If not given or `null`, the array index as string is used as the label. If in any case the label exists, a `LabelExists` exception is thrown.",
"description": "Provides a label for the new value. If not given or `null`, the natural next array index as number is used as the label. If in any case the label exists, a `LabelExists` exception is thrown.\n\nThis parameter only applies if the given array is a labeled array. If a non-null values is provided and the array is not labeled, an `ArrayNotLabeled` exception is thrown.",
"optional": true,
"default": null,
"schema": {
"type": [
"string",
"null"
]
}
"schema": [
{
"type": "number"
},
{
"type": "string"
},
{
"type": "null"
}
]
}
],
"returns": {
Expand All @@ -48,6 +53,9 @@
"exceptions": {
"LabelExists": {
"message": "An array element with the specified label already exists."
},
"ArrayNotLabeled": {
"message": "A label can't be provided as the given array is not labeled."
}
},
"examples": [
Expand Down

0 comments on commit ab4a62e

Please sign in to comment.