InputForm.json Syntax

{
  "$id": "#ica-pipeline-input-form",
  "$schema": "http://json-schema.org/draft-07/schema#",
  "title": "ICA Pipeline Input Forms",
  "description": "Describes the syntax for defining input setting forms for ICA pipelines",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "fields": {
      "description": "The list of setting fields",
      "type": "array",
      "items": {
        "$ref": "#/definitions/ica_pipeline_input_form_field"
      }
    }
  },
  "required": [
    "fields"
  ],
  "definitions": {
    "ica_pipeline_input_form_field": {
      "$id": "#ica_pipeline_input_form_field",
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "id": {
          "description": "The unique identifier for this field. Will be available with this key to the pipeline script.",
          "type": "string",
          "pattern": "^[a-zA-Z-0-9\\-_\\.\\s\\+\\[\\]]+$"
        },
        "type": {
          "type": "string",
          "enum": [
            "textbox",
            "checkbox",
            "radio",
            "select",
            "number",
            "integer",
            "data",
            "section",
            "text",
            "fieldgroup"
          ]
        },
        "label": {
          "type": "string"
        },
        "minValues": {
          "description": "The minimal amount of values that needs to be present. Default is 0 when not provided. Set to >=1 to make the field required.",
          "type": "integer",
          "minimum": 0
        },
        "maxValues": {
          "description": "The maximal amount of values that needs to be present. Default is 1 when not provided.",
          "type": "integer",
          "exclusiveMinimum": 0
        },
        "minMaxValuesMessage": {
          "description": "The error message displayed when minValues or maxValues is not adhered to. When not provided a default message is generated.",
          "type": "string"
        },
        "helpText": {
          "type": "string"
        },
        "placeHolderText": {
          "description": "An optional short hint (a word or short phrase) to aid the user when the field has no value."
          "type": "string"
        },
        "value": {},
        "minLength": {
          "type": "integer",
          "minimum": 0
        },
        "maxLength": {
          "type": "integer",
          "exclusiveMinimum": 0
        },
        "min": {
          "type": "number"
        },
        "max": {
          "type": "number"
        },
        "choices": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/ica_pipeline_input_form_field_choice"
          }
        },
        "fields": {
          "description": "The list of setting sub fields for type fieldgroup",
          "type": "array",
          "items": {
            "$ref": "#/definitions/ica_pipeline_input_form_field"
          }
        },
        "dataFilter": {
          "description": "For defining the filtering when type is 'data'.",
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "nameFilter": {
              "description": "Optional data filename filter pattern that input files need to adhere to when type is 'data'. Eg parts of the expected filename",
              "type": "string"
            },
            "dataFormat": {
              "description": "Optional dataformat name array that input files need to adhere to when type is 'data'",
              "type": "array",
              "contains": {
                "type": "string"
              }
            },
            "dataType": {
              "description": "Optional data type (file or directory) that input files need to adhere to when type is 'data'",
              "type": "string",
              "enum": [
                "file",
                "directory"
              ]
            }
          }
        },
        "regex": {
          "type": "string"
        },
        "regexErrorMessage": {
          "type": "string"
        },
        "hidden": {
          "type": "boolean"
        },
        "disabled": {
          "type": "boolean"
        },
        "emptyValuesAllowed": {
          "type": "boolean",
          "description": "When maxValues is 1 or not set and emptyValuesAllowed is true, the values may contain null entries. Default is false."
        },
        "updateRenderOnChange": {
          "type": "boolean",
          "description": "When true, the onRender javascript function is triggered ech time the user changes the value of this field. Default is false."
        }
      },
      "required": [
        "id",
        "type"
      ],
      "allOf": [
        {
          "if": {
            "description": "When type is 'textbox' then 'dataFilter', 'fields', 'choices', 'max' and 'min' are not allowed",
            "properties": {
              "type": {
                "enum": [
                  "textbox"
                ]
              }
            },
            "required": [
              "type"
            ]
          },
          "then": {
            "propertyNames": {
              "not": {
                "enum": [
                  "dataFilter",
                  "fields",
                  "choices",
                  "max",
                  "min"
                ]
              }
            }
          }
        },
        {
          "if": {
            "description": "When type is 'checkbox' then 'dataFilter', 'fields', 'choices', 'placeHolderText', 'regex', 'regexErrorMessage', 'maxLength', 'minLength', 'max' and 'min' are not allowed",
            "properties": {
              "type": {
                "enum": [
                  "checkbox"
                ]
              }
            },
            "required": [
              "type"
            ]
          },
          "then": {
            "propertyNames": {
              "not": {
                "enum": [
                  "dataFilter",
                  "fields",
                  "choices",
                  "placeHolderText",
                  "regex",
                  "regexErrorMessage",
                  "maxLength",
                  "minLength",
                  "max",
                  "min"
                ]
              }
            }
          }
        },
        {
          "if": {
            "description": "When type is 'radio' then 'dataFilter', 'fields', 'placeHolderText', 'regex', 'regexErrorMessage', 'maxLength', 'minLength', 'max' and 'min' are not allowed",
            "properties": {
              "type": {
                "enum": [
                  "radio"
                ]
              }
            },
            "required": [
              "type"
            ]
          },
          "then": {
            "propertyNames": {
              "not": {
                "enum": [
                  "dataFilter",
                  "fields",
                  "placeHolderText",
                  "regex",
                  "regexErrorMessage",
                  "maxLength",
                  "minLength",
                  "max",
                  "min"
                ]
              }
            }
          }
        },
        {
          "if": {
            "description": "When type is 'select' then 'dataFilter', 'fields', 'regex', 'regexErrorMessage', 'maxLength', 'minLength', 'max' and 'min' are not allowed",
            "properties": {
              "type": {
                "enum": [
                  "select"
                ]
              }
            },
            "required": [
              "type"
            ]
          },
          "then": {
            "propertyNames": {
              "not": {
                "enum": [
                  "dataFilter",
                  "fields",
                  "regex",
                  "regexErrorMessage",
                  "maxLength",
                  "minLength",
                  "max",
                  "min"
                ]
              }
            }
          }
        },
        {
          "if": {
            "description": "When type is 'number' or 'integer' then 'dataFilter', 'fields', 'choices', 'regex', 'regexErrorMessage', 'maxLength' and 'minLength' are not allowed",
            "properties": {
              "type": {
                "enum": [
                  "number",
                  "integer"
                ]
              }
            },
            "required": [
              "type"
            ]
          },
          "then": {
            "propertyNames": {
              "not": {
                "enum": [
                  "dataFilter",
                  "fields",
                  "choices",
                  "regex",
                  "regexErrorMessage",
                  "maxLength",
                  "minLength"
                ]
              }
            }
          }
        },
        {
          "if": {
            "description": "When type is 'data' then 'dataFilter' is required and 'fields', 'choices', 'placeHolderText', 'regex', 'regexErrorMessage', 'maxLength', 'minLength', 'max' and 'min' are not allowed",
            "properties": {
              "type": {
                "enum": [
                  "data"
                ]
              }
            },
            "required": [
              "type"
            ]
          },
          "then": {
            "required": [
              "dataFilter"
            ],
            "propertyNames": {
              "not": {
                "enum": [
                  "fields",
                  "choices",
                  "placeHolderText",
                  "regex",
                  "regexErrorMessage",
                  "max",
                  "min",
                  "maxLength",
                  "minLength"
                ]
              }
            }
          }
        },
        {
          "if": {
            "description": "When type is 'section' or 'text' then 'disabled', 'fields', 'updateRenderOnChange', 'classification', 'value', 'minValues', 'maxValues', 'minMaxValuesMessage', 'dataFilter', 'choices', 'placeHolderText', 'regex', 'regexErrorMessage', 'maxLength', 'minLength', 'max' and 'min' are not allowed",
            "properties": {
              "type": {
                "enum": [
                  "section",
                  "text"
                ]
              }
            },
            "required": [
              "type"
            ]
          },
          "then": {
            "propertyNames": {
              "not": {
                "enum": [
                  "disabled",
                  "fields",
                  "updateRenderOnChange",
                  "classification",
                  "value",
                  "minValues",
                  "maxValues",
                  "minMaxValuesMessage",
                  "dataFilter",
                  "choices",
                  "regex",
                  "placeHolderText",
                  "regexErrorMessage",
                  "maxLength",
                  "minLength",
                  "max",
                  "min"
                ]
              }
            }
          }
        },
        {
          "if": {
            "description": "When type is 'fieldgroup' then 'fields' is required and then 'dataFilter', 'choices', 'placeHolderText', 'regex', 'regexErrorMessage', 'maxLength', 'minLength', 'max' and 'min' are not allowed",
            "properties": {
              "type": {
                "enum": [
                  "fieldgroup"
                ]
              }
            },
            "required": [
              "type",
              "fields"
            ]
          },
          "then": {
            "propertyNames": {
              "not": {
                "enum": [
                  "dataFilter",
                  "choices",
                  "placeHolderText",
                  "regex",
                  "regexErrorMessage",
                  "maxLength",
                  "minLength",
                  "max",
                  "min"
                ]
              }
            }
          }
        }
      ]
    },
    "ica_pipeline_input_form_field_choice": {
      "$id": "#ica_pipeline_input_form_field_choice",
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "value": {},
        "text": {
          "type": "string"
        },
        "selected": {
          "type": "boolean"
        },
        "disabled": {
          "type": "boolean"
        },
        "parent": {
          "description": "Value of the parent choice item. Can be used to build hierarchical choice trees."
        }
      },
      "required": [
        "value",
        "text"
      ]
    }
  }
}

Last updated