{
    "$schema": "http://json-schema.org/draft-07/schema#",
    "type": "object",
    "additionalProperties": false,
    "properties": {
        "label": {
            "type": "string",
            "description": "The field label displayed in the edit screen",
            "minLength": 1
        },
        "type": {
            "type": "string",
            "enum": [
                "repeater"
            ],
            "description": "Field type identifier. Must be \"repeater\" for this field type."
        },
        "name": {
            "type": "string",
            "description": "The field name used to save/load data. Auto-generated from label if not provided.",
            "pattern": "^[a-z_][a-z0-9_]*$"
        },
        "key": {
            "type": "string",
            "description": "Unique field key. Auto-generated if not provided.",
            "pattern": "^field_[a-z0-9]+$"
        },
        "instructions": {
            "type": "string",
            "description": "Instructions displayed to editors below the field label"
        },
        "required": {
            "type": "boolean",
            "description": "Whether this field is required",
            "default": false
        },
        "conditional_logic": {
            "type": [
                "boolean",
                "array"
            ],
            "description": "Conditional logic rules. Set to false to disable, or provide rules array.",
            "default": false
        },
        "wrapper": {
            "type": "object",
            "description": "HTML wrapper attributes",
            "properties": {
                "width": {
                    "type": "string",
                    "description": "Width percentage (e.g., \"50\")"
                },
                "class": {
                    "type": "string",
                    "description": "Custom CSS classes"
                },
                "id": {
                    "type": "string",
                    "description": "Custom HTML ID"
                }
            }
        },
        "default_value": {
            "type": [
                "string",
                "number",
                "boolean",
                "null"
            ],
            "description": "Default value when creating new content"
        },
        "placeholder": {
            "type": "string",
            "description": "Placeholder text shown in empty fields"
        },
        "prepend": {
            "type": "string",
            "description": "Text to prepend before the input"
        },
        "append": {
            "type": "string",
            "description": "Text to append after the input"
        },
        "maxlength": {
            "type": "integer",
            "description": "Maximum character length (if applicable)",
            "minimum": 1
        },
        "allow_in_bindings": {
            "type": "boolean",
            "description": "Whether this field can be used in block bindings",
            "default": false
        },
        "sub_fields": {
            "type": "array",
            "description": "Array of field configuration objects that can be repeated. Each sub field should follow the standard field creation schema with properties like label, name, type, etc.",
            "items": {
                "type": "object"
            },
            "default": []
        },
        "min": {
            "type": "integer",
            "description": "Minimum number of rows required",
            "default": 0,
            "minimum": 0
        },
        "max": {
            "type": "integer",
            "description": "Maximum number of rows allowed (0 for unlimited)",
            "default": 0,
            "minimum": 0
        },
        "layout": {
            "type": "string",
            "description": "Display style for the repeating rows",
            "enum": [
                "table",
                "block",
                "row"
            ],
            "default": "table"
        },
        "button_label": {
            "type": "string",
            "description": "Custom text for the \"Add Row\" button",
            "default": "Add Row"
        },
        "collapsed": {
            "type": "string",
            "description": "Field key of a sub field to display when rows are collapsed (improves UI for many rows)",
            "default": ""
        },
        "rows_per_page": {
            "type": "integer",
            "description": "Number of rows to display per page when pagination is enabled",
            "default": 20,
            "minimum": 1
        }
    },
    "required": [
        "label",
        "type"
    ]
}