Skip to main content

Check out Port for yourselfย 

Array

Array is an input for lists of data.

๐Ÿ’ก Common array usageโ€‹

The array input type can be used to store any list of data, for example:

  • Configuration parameters
  • Ordered values

API definitionโ€‹

{
"myArrayInput": {
"title": "My array input",
"icon": "My icon",
"description": "My array input",
"type": "array",
"default": [1, 2, 3]
}
}

Check out Port's API reference to learn more.

Terraform definitionโ€‹

resource "port_action" "myAction" {
# ...action properties
user_properties {
identifier = "myArrayInput"
title = "My array input"
description = "My array input"
type = "array"
}
}

Validate arrayโ€‹

Array validations support the following operators:

  • minItems
  • maxItems
  • uniqueItems
tip

Array validations follow the JSON schema model, refer to the JSON schema docs to learn about all of the available validations

{
"myArrayInput": {
"title": "My array input",
"icon": "My icon",
"description": "My array input ",
"type": "array",
"minItems": 0,
"maxItems": 5,
"uniqueItems": false
}
}