consumerParameters
The consumerParameters
is an array of objects. Each object defines a field and has the following structure:
Attribute | Type | Description | Required |
---|---|---|---|
name | string | The parameter name (this is sent as HTTP param or key towards algo) | ✅ |
type | string | The field type (text, number, boolean, select) | ✅ |
label | string | The field label which is displayed | ✅ |
required | boolean | If customer input for this field is mandatory. | ✅ |
description | string | The field description. | ✅ |
default | string , number , or boolean | The field default value. For select types, string key of default option. | ✅ |
options | Array of option | For select types, a list of options. | ☑️ (required for select types) |
Each option
is an object
containing a single key: value pair where the key is the option name, and the value is the option value.
[
{
"name": "hometown",
"type": "text",
"label": "Hometown",
"required": true,
"description": "What is your hometown?",
"default": "Nowhere"
},
{
"name": "age",
"type": "number",
"label": "Age",
"required": false,
"description": "Please fill your age",
"default": 0
},
{
"name": "developer",
"type": "boolean",
"label": "Developer",
"required": false,
"description": "Are you a developer?",
"default": false
},
{
"name": "languagePreference",
"type": "select",
"label": "Language",
"required": false,
"description": "Do you like NodeJs or Python",
"default": "nodejs",
"options": [
{
"nodejs": "I love NodeJs"
},
{
"python": "I love Python"
}
]
}
]