Schema

The PANDIUM.yaml’s schema properties are a collection of string to object mappings that determine the name and type of each configuration in the connection settings page. The object to which the property name is mapped must contain the type prop. Pandium currently supports the following types, many of which can take additional props:

Boolean

bool_input:
  type: boolean
  default: true

In this example bool_input is the name of the config. When presented to the end user, they will see a checkbox that is checked because the default is set to true. When a run happens this config will be injected into the environment as PAN_CFG_BOOL_INPUT.

propvaluesnote

default

true or false

Integer

integer_input:
  type: integer
  default: 0
  min: -1
  max: 10

In this example, integer_input is the name of the config. When presented to the end user, they will see a number selector that is restricted to integers, with the value 0 being presented as the starting value. The end user will be able to enter an integer between -1 and 10. When a run happens, this config will be injected into the Environment as PAN_CFG_INTEGER_INPUT.

propvaluesnote

default

an integer

min

an integer

negatives allowed

max

an integer

Number

number_input:
  type: number
  default: 1.3333333

In the above example, number_input is the name of the config. When presented to the Integration Hub user, they will see a number selector with the value 1.3333 presented as the starting value. When a Run happens this config will be injected into the Environment as PAN_CFG_NUMBER_INPUT.

propvaluesnote

default

any number

min

any number

negatives allowed

max

any number

String

string_input:
  type: string

In the above example, string_input is the name of the config. When presented to the Integration Hub user, they will see a text box that is empty being the starting value. When a Run happens this config will be injected into the Environment as PAN_CFG_STRING_INPUT.

propvaluesnote

default

any valid unicode string

format

null || "date" || "time" || "date-time"

when null or undefined control renders as a text box. date renders as a date picker

time renders as a time picker and date-time renders a date and time control.

enum

an array of values

if you add an enum to the control, it will render as a dropdown.

Enum

string_enum_input:
  enum:
  - option 1
  - option 2
  - option 3
  type: string

In the above example, string_enum_input is the name of the config. When presented to the Integration Hub user, they will see a select box allowing them to choose between the given enum values. When a Run happens this config will be injected into the Environment as PAN_CFG_STRING_ENUM_INPUT.

Labeled Enum

labeled_enum:
  type: string
  oneOf:
    - title: Option 1 label
      const: option1
    - title: Option 2 label
      const: option2
    - title: Option 2 label
      const: option2

In the above example, labeled_enum is the name of the config. When presented to the Integration Hub user, they will see a select box with labeled values. When a Run happens this config will be injected into the Environment as PAN_CFG_LABELED_ENUM.

Array/Object

  array_input:
    type: array
    items:
      type: object
      properties:
        date:
          type: string
          format: date
        enum:
          enum:
          - foo
          - bar
          type: string
        message:
          type: string
          maxLength: 5

In the above example, array_inputis the name of the config. When presented to the user they will see a line with a combination of the three properties that make up each object in the list, the UI allows them to add or remove objects to the array. When a Run happens this config will be injected into the Environment as PAN_CFG_ARRAY_INPUT

Multi-Select Enum

string_enum_multi_input:
  items:
    options:
      - label: Option 1 label
        value: option1
      - label: Option 2 label
        value: option2
      - label: Option 2 label
        value: option2

propvaluenote

items

options: a list of objects where each has a label and value

Note: Like all the schema property types described here, the configuration’s property must be referenced in the scope of a uischema element for it to be displayed on the connection settings page. Unlike other schema property types, the UISschema element type for a multi select uischema must be MultiSelectControl, rather than Control. To learn more about how the UISchema determines how the configurations are displayed review this article.

Putting it all together

schema:
  type: object
  properties:
    bool_input:
      type: boolean
      default: true
    array_input:
      type: array
      items:
        type: object
        properties:
          date:
            type: string
            format: date
          enum:
            enum:
            - foo
            - bar
            type: string
          message:
            type: string
            maxLength: 5
    number_input:
      type: number
      default: 1.3333333
    string_input:
      type: string
    integer_input:
      max: 10
      min: -1
      type: integer
      default: 0
    string_enum_input:
      enum:
      - option 1
      - option 2
      - option 3
      type: string

Last updated