If you’ve run into this error:
Expected '${dataModelPointer}' to be of one of these types: [string, object]
You’re likely binding a boolean to a UI property that expects text or an object.
A common scenario is using ${data.error} for error-message, which expects a user-readable message, not a true/false value.
Quick Fix
If you're binding a boolean to a property like error-message, you'll get this error. These properties only accept string or object types, not booleans.
To fix it, either change the schema to a string:
"error": {
"type": "string",
"__example__": "Invalid file format"
}
Or use a conditional expression that resolves to a string:
"error-message": "${data.error ? 'Something went wrong' : ''}"
The Problem
Here’s what’s wrong:
"error": {
"type": "boolean",
"__example__": true
},
...
"error-message": "${data.error}"
The error-message property is trying to use a boolean (true/false) as a string. That’s not allowed.
The Solution
You have two options:
Option 1: Change the schema to a string
If error is meant to contain a message, make it a string:
"error": {
"type": "string",
"__example__": "File upload failed"
}
Then use:
"error-message": "${data.error}"
Option 2: Convert boolean to string using a ternary
If you want to show an error based on a boolean condition:
"error": {
"type": "boolean",
"__example__": true
}
Then do:
"error-message": "${data.error ? 'Please upload a valid ID' : ''}"
This keeps your schema clean and your UI error messaging user-friendly.
When in doubt, inspect the type your widget expects and make sure your data binding delivers exactly that. Type mismatches like this are small but common, and easy to prevent with clear schema planning.
For more troubleshooting insights related to WhatsApp Business API, check out heltar.com/blogs.