Troubleshoot

Fixing "INVALID_SCREEN_DATA: Missing the schema for property 'items' in array" Error in Your Screen Configuration on WhatsApp API

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.

Book a Demo

Get in touch with our CEO for all your WhatsApp API needs!

Heltar

Automate WhatsApp for Businesses! Heltar is a growth engine for everyone. we help you with Bulk Messaging at scale, AI Agents and Workflow Automations; Team Inbox for all your agents, and Voice Agents cross-functionally with WhatsApp capabilities.