{
"type": "object",
"properties": {
"title": { "type": "string", "minLength": 3, "maxLength": 80 },
"layout": { "type": "string", "enum": ["single_column", "two_column"] },
"fields": {
"type": "array",
"minItems": 1,
"maxItems": 20,
"items": {
"type": "object",
"properties": {
"name": { "type": "string", "pattern": "^[a-z][a-z0-9_]*$" },
"label": { "type": "string", "minLength": 1, "maxLength": 50 },
"component": {
"type": "string",
"enum": ["text", "email", "number", "select", "textarea", "checkbox"]
},
"required": { "type": "boolean" },
"placeholder": { "type": "string", "maxLength": 80 },
"options": {
"type": "array",
"items": { "type": "string", "minLength": 1, "maxLength": 40 },
"maxItems": 20
}
},
"required": ["name", "label", "component", "required"],
"additionalProperties": false,
"allOf": [
{
"if": { "properties": { "component": { "const": "select" } } },
"then": { "required": ["options"] }
}
]
}
}
},
"required": ["title", "layout", "fields"],
"additionalProperties": false
}