When working with screen configuration files, you might encounter the error:
INVALID_SCREEN_DATA: Missing the schema for property 'items' in array.
This happens when you've declared a property as an array but skipped specifying what type of items that array should contain. The schema of ‘array’ type must have ‘items’ property.
Quick Fix
To resolve this error, add the items property to your array schema. Here’s the corrected structure:
{
"type": "array",
"items": {
"type": "string"
},
"__example__": ["example item"]
}
The Problem
Here’s a broken snippet that triggers the error:
{
"type": "array",
"__example__": []
}
This is invalid because the system needs to know what each item in the array should look like. Without the items key, the schema is incomplete.
The Solution
Always define the structure of the array’s elements using the items keyword. Most commonly, it looks like this:
{
"type": "array",
"items": {
"type": "string"
},
"__example__": ["example item"]
}
If your array holds objects, update items accordingly:
{
"type": "array",
"items": {
"type": "object",
"properties": {
"label": { "type": "string" },
"value": { "type": "number" }
}
},
"__example__": [{ "label": "Item A", "value": 1 }]
}
Without items, your config is ambiguous, leading to runtime errors and broken UIs. Defining items ensures both human and machine know exactly what to expect.
For more troubleshooting insights related to WhatsApp Business API, check out heltar.com/blogs.