Type Mismatch
Q-1-11 — Type Mismatch
A value in the YAML document has the wrong type for the property the schema expects.
What this means
Each schema-validated property in Quarto’s configuration has an
expected type: a string, a number, a boolean, an object, an array,
or null. This error fires when the value at that property is a
different YAML type from the one the schema expects.
The terminal message names both types: the type the schema asked
for (expected) and the type your YAML actually contains (got).
Why this happens
Three frequent patterns:
- Forgotten quotes around a string that looks like a number or
boolean. YAML reads
2024as a number andyesas a boolean by default. If the schema expects a string, that’s a type mismatch. - A scalar where the schema expects a list. Writing
categories: newsinstead ofcategories: [news]gives the property a string value, but the schema may require an array. - An object where the schema expects a scalar (or vice versa). Indenting properties under a key that the schema treats as a simple value will turn it into an object.
How to fix
Re-read the value at the path the error reports, and compare its shape to the schema’s expected type.
If the schema wants a string and YAML inferred a number or boolean, quote the value:
version: "2024" # string, not number
draft: "false" # string, not booleanIf the schema wants an array, write the value as a list:
categories:
- news
- researchIf the schema wants a scalar, remove the nested keys and put the value directly after the colon.