{ "$schema": "http://json-schema.org/draft-07/schema#", "title": "yaml-form form definition", "description": "YAML form definition accepted by yaml-form. Constraints the schema cannot express (unique ids, descriptor counts, rule keys) are checked at generation time.", "type": "object", "properties": { "title": { "type": "string", "minLength": 1 }, "lang": { "default": "en", "type": "string", "pattern": "^[A-Za-z]{2,3}(-[A-Za-z0-9]{1,8})*$" }, "messages": { "type": "object", "properties": { "required": { "type": "string", "minLength": 1 }, "required_row": { "type": "string", "minLength": 1 }, "required_legend": { "type": "string", "minLength": 1 }, "submit": { "type": "string", "minLength": 1 }, "submitting": { "type": "string", "minLength": 1 }, "submit_failed": { "type": "string", "minLength": 1 }, "submit_success": { "type": "string", "minLength": 1 }, "comment": { "type": "string", "minLength": 1 }, "noscript_warning": { "type": "string", "minLength": 1 }, "clear_selection": { "type": "string", "minLength": 1 }, "draft_restored": { "type": "string", "minLength": 1 }, "draft_discard": { "type": "string", "minLength": 1 }, "draft_discarded": { "type": "string", "minLength": 1 } }, "additionalProperties": false }, "autosave": { "default": true, "type": "boolean" }, "noindex": { "default": true, "type": "boolean" }, "nofollow": { "default": true, "type": "boolean" }, "id": { "type": "string", "minLength": 1 }, "version": { "type": "string", "minLength": 1 }, "description": { "type": "string" }, "links": { "type": "array", "items": { "type": "object", "properties": { "title": { "type": "string", "minLength": 1 }, "url": { "type": "string", "minLength": 1 }, "target": { "type": "string", "enum": [ "self", "blank" ] } }, "required": [ "title", "url" ], "additionalProperties": false } }, "actions": { "anyOf": [ { "type": "array", "items": { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "const": "log" } }, "required": [ "type" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "post" }, "url": { "type": "string", "minLength": 1 } }, "required": [ "type", "url" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "mailto" }, "to": { "type": "string", "minLength": 1 }, "subject": { "type": "string" } }, "required": [ "type", "to" ], "additionalProperties": false } ] } }, { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "const": "log" } }, "required": [ "type" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "post" }, "url": { "type": "string", "minLength": 1 } }, "required": [ "type", "url" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "mailto" }, "to": { "type": "string", "minLength": 1 }, "subject": { "type": "string" } }, "required": [ "type", "to" ], "additionalProperties": false } ] } ] }, "post_submit": { "type": "object", "properties": { "message": { "type": "string" }, "links": { "type": "array", "items": { "type": "object", "properties": { "title": { "type": "string", "minLength": 1 }, "url": { "type": "string", "minLength": 1 }, "target": { "type": "string", "enum": [ "self", "blank" ] } }, "required": [ "title", "url" ], "additionalProperties": false } } }, "additionalProperties": false }, "items": { "minItems": 1, "type": "array", "items": { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "const": "constant" }, "title": { "type": "string", "minLength": 1 }, "id": { "type": "string", "minLength": 1 }, "description": { "type": "string" }, "required": { "default": false, "type": "boolean" }, "visible_when": { "type": "string" }, "value": { "type": "string" }, "from_url": { "default": false, "type": "boolean" }, "hidden": { "default": false, "type": "boolean" } }, "required": [ "type", "title", "id", "value" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "default": "short_text", "type": "string", "const": "short_text" }, "title": { "type": "string", "minLength": 1 }, "id": { "type": "string", "minLength": 1 }, "description": { "type": "string" }, "required": { "default": false, "type": "boolean" }, "visible_when": { "type": "string" }, "input_type": { "type": "string", "enum": [ "email", "tel", "url", "number" ] }, "autocomplete": { "type": "string", "minLength": 1 } }, "required": [ "title", "id" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "long_text" }, "title": { "type": "string", "minLength": 1 }, "id": { "type": "string", "minLength": 1 }, "description": { "type": "string" }, "required": { "default": false, "type": "boolean" }, "visible_when": { "type": "string" } }, "required": [ "type", "title", "id" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "choice" }, "title": { "type": "string", "minLength": 1 }, "id": { "type": "string", "minLength": 1 }, "description": { "type": "string" }, "required": { "default": false, "type": "boolean" }, "visible_when": { "type": "string" }, "choices": { "minItems": 1, "type": "array", "items": { "anyOf": [ { "type": "string", "minLength": 1 }, { "type": "object", "properties": { "title": { "type": "string", "minLength": 1 }, "value": { "type": "string", "minLength": 1 } }, "required": [ "title" ], "additionalProperties": false } ] } }, "multiple": { "default": false, "type": "boolean" } }, "required": [ "type", "title", "id", "choices" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "choice_table" }, "title": { "type": "string", "minLength": 1 }, "id": { "type": "string", "minLength": 1 }, "description": { "type": "string" }, "required": { "default": false, "type": "boolean" }, "visible_when": { "type": "string" }, "items": { "minItems": 1, "type": "array", "items": { "anyOf": [ { "type": "string", "minLength": 1 }, { "type": "object", "properties": { "title": { "type": "string", "minLength": 1 }, "id": { "type": "string", "minLength": 1 } }, "required": [ "title" ], "additionalProperties": false } ] } }, "choices": { "minItems": 1, "type": "array", "items": { "anyOf": [ { "type": "string", "minLength": 1 }, { "type": "object", "properties": { "title": { "type": "string", "minLength": 1 }, "value": { "type": "string", "minLength": 1 } }, "required": [ "title" ], "additionalProperties": false } ] } }, "multiple": { "default": false, "type": "boolean" } }, "required": [ "type", "title", "id", "items", "choices" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "rubric" }, "title": { "type": "string", "minLength": 1 }, "id": { "type": "string", "minLength": 1 }, "description": { "type": "string" }, "required": { "default": false, "type": "boolean" }, "visible_when": { "type": "string" }, "items": { "minItems": 1, "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1 }, "title": { "type": "string", "minLength": 1 }, "descriptors": { "minItems": 1, "type": "array", "items": { "type": "string" } } }, "required": [ "title", "descriptors" ], "additionalProperties": false } }, "choices": { "minItems": 1, "type": "array", "items": { "anyOf": [ { "type": "string", "minLength": 1 }, { "type": "object", "properties": { "title": { "type": "string", "minLength": 1 }, "value": { "type": "string", "minLength": 1 } }, "required": [ "title" ], "additionalProperties": false } ] } }, "comment_per_row": { "default": false, "type": "boolean" } }, "required": [ "type", "title", "id", "items", "choices" ], "additionalProperties": false } ] } } }, "required": [ "title", "items" ], "additionalProperties": false }