Properties
- title (
string) - minLength: 0 - maxLength: 100 - Form title - description (
string) - minLength: 2 - maxLength: 500 - Form description - questions (
array of object (min: , max: 40)) (required) - Question block component - formatting (
object)- textStyle (
object- style component reference) - cardStyle (
object- style component reference) - iconStyle (
object- style component reference)
- textStyle (
Schema
Copy
{
"$schema": "http://json-schema.org/draft-07/schema#",
"definitions": {},
"title": "Custom Form Component",
"type": "object",
"required": [
"questions"
],
"properties": {
"title": {
"type": "string",
"minLength": 0,
"maxLength": 100,
"description": "Form title"
},
"description": {
"type": "string",
"minLength": 2,
"maxLength": 500,
"description": "Form description"
},
"questions": {
"type": "array",
"maxItems": 40,
"additionalProperties": false,
"description": "Question block component",
"$comment": "Allow upto 20 questions.",
"items": {
"type": "object",
"required": [
"question",
"answer"
],
"additionalProperties": false,
"minProperties": 1,
"properties": {
"question": {
"type": "string",
"maxLength": 200,
"minLength": 3
},
"questionDescription": {
"type": "string",
"maxLength": 300
},
"privacyNote": {
"type": "string",
"maxLength": 300
},
"answer": {
"type": "object",
"additionalProperties": false,
"required": [
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"shortAnswer",
"paragraph",
"multipleChoice",
"checkbox",
"dropdown",
"linearScale",
"dateFormat",
"timeFormat",
"email",
"phoneNumber",
"starRating",
"emoji",
"likeDislike",
"uploadFile",
"signature"
]
},
"data": {
"type": [
"string",
"object",
"array"
]
}
},
"allOf": [
{
"if": {
"properties": {
"type": {
"const": "multipleChoice"
}
}
},
"then": {
"properties": {
"data": {
"$ref": "form_input.json#/properties/multipleOptions"
}
}
}
},
{
"if": {
"properties": {
"type": {
"const": "checkbox"
}
}
},
"then": {
"properties": {
"data": {
"$ref": "form_input.json#/properties/multipleOptions"
}
}
}
},
{
"if": {
"properties": {
"type": {
"const": "linearScale"
}
}
},
"then": {
"properties": {
"data": {
"$ref": "form_input.json#/properties/linearScale"
}
}
}
},
{
"if": {
"properties": {
"type": {
"const": "dateFormat"
}
}
},
"then": {
"properties": {
"data": {
"$ref": "form_input.json#/properties/dateFormat"
}
}
}
},
{
"if": {
"properties": {
"type": {
"const": "timeFormat"
}
}
},
"then": {
"properties": {
"data": {
"$ref": "form_input.json#/properties/timeFormat"
}
}
}
},
{
"if": {
"properties": {
"type": {
"const": "starRating"
}
}
},
"then": {
"properties": {
"data": {
"$ref": "form_input.json#/properties/feedback"
}
}
}
},
{
"if": {
"properties": {
"type": {
"const": "emoji"
}
}
},
"then": {
"properties": {
"data": {
"$ref": "form_input.json#/properties/feedback"
}
}
}
},
{
"if": {
"properties": {
"type": {
"const": "likeDislike"
}
}
},
"then": {
"properties": {
"data": {
"$ref": "form_input.json#/properties/feedback"
}
}
}
},
{
"if": {
"properties": {
"type": {
"const": "uploadFile"
}
}
},
"then": {
"properties": {
"data": {
"$ref": "form_input.json#/properties/uploadFile"
}
}
}
},
{
"if": {
"properties": {
"type": {
"const": "signature"
}
}
},
"then": {
"properties": {
"data": {
"$ref": "form_input.json#/properties/signature"
}
}
}
}
]
},
"isRequired": {
"type": "boolean",
"default": false
}
}
}
},
"formatting": {
"type": "object",
"additionalProperties": false,
"properties": {
"textStyle": {
"$ref": "style/text.json"
},
"cardStyle": {
"$ref": "style/card.json"
},
"iconStyle": {
"$ref": "style/icon.json"
}
}
}
}
}