windmill-labs/windmill · error
Received unsupported type `{other}`
Error message
Received unsupported type `{other}` What it means
`JsonPrimitiveType::from_str` parses a string (typically from JSON schema 'type' fields) into the JsonPrimitiveType enum. Windmill throws this error when the string is not one of the recognized primitive JSON type names (object, array, string, number, integer, boolean, null). It indicates an invalid or unexpected type name in schema input rather than a runtime failure.
Source
Thrown at backend/windmill-common/src/schema.rs:581
"number" => {
return Ok(JsonPrimitiveType::Number);
}
"integer" => {
return Ok(JsonPrimitiveType::Integer);
}
"object" => {
return Ok(JsonPrimitiveType::Object);
}
"array" => {
return Ok(JsonPrimitiveType::Array);
}
"boolean" => {
return Ok(JsonPrimitiveType::Boolean);
}
"null" => {
return Ok(JsonPrimitiveType::Null);
}
other => return Err(anyhow!("Received unsupported type `{other}`").into()),
}
}
}
#[cfg(test)]
mod tests {
use serde_json::json;
use super::*;
fn value_to_rawvalue_map(
value: Value,
) -> Result<HashMap<String, Box<RawValue>>, anyhow::Error> {
match value {
Value::Object(map) => {
let mut result = HashMap::new();
for (key, val) in map {
let raw = serde_json::to_string(&val)?; // Serialize the Value to a stringView on GitHub (pinned to e474e8803c)
Solutions
- Replace the unsupported type string with a standard JSON Schema primitive name: one of object, array, string, number, integer, boolean, null.
- If the type comes from another tool's export, pre-normalize the type names (e.g. map 'float'->'number', 'int'->'integer') before feeding it to Windmill.
- Trim whitespace and lowercase the string; the match is exact and case-sensitive.
- If the value should be optional or complex, restructure the schema instead of inventing a type name.
Example fix
// before
{"type": "float"}
// after
{"type": "number"} Defensive patterns
Strategy: validation
Validate before calling
const ALLOWED = new Set(["object","array","string","number","integer","boolean","null"]);
function isValidPrimitiveType(t) {
return typeof t === "string" && ALLOWED.has(t.trim().toLowerCase());
}
if (!isValidPrimitiveType(schemaType)) {
throw new Error(`Unsupported primitive type '${schemaType}'; use one of ${[...ALLOWED].join(", ")}`);
} Type guard
function isJsonPrimitiveType(t) {
return ["object","array","string","number","integer","boolean","null"]
.includes(t);
} Try / catch
try {
const t = JsonPrimitiveType.fromString(raw);
} catch (e) {
if (String(e).includes("unsupported type")) {
console.error(`Schema type '${raw}' is not a JSON primitive type; fix the schema definition.`);
}
throw e;
} Prevention
- Only emit the exact lowercase JSON primitive type names in schemas.
- Normalize vendor-specific type names (float→number, int→integer) at schema-import time.
- Trim and lowercase type strings before parsing.
- Validate schemas with a JSON Schema linter before importing into Windmill.
When it happens
Trigger: Calling `JsonPrimitiveType::from_str` (via serde deserialization of schema fields or direct FromStr use) with a type string like 'float', 'any', 'map', 'int32', a capitalized name like 'String', or a null/empty string instead of one of the exact lowercase JSON primitive type names.
Common situations: Hand-written JSON schemas using non-standard type names (e.g. 'float' or 'datetime' instead of 'number'/'string'); schemas generated by other tools with vendor-specific type names; importing scripts/apps from sources with divergent schema dialects; typos like 'boolean ' with whitespace or 'bool'.
Understand the failure class
Background: Schema validation failed / invalid input schema: payload rejected because its shape doesn't match the expected schema — this error's family across 28 libraries.
Related errors
- Completed jobs file must contain an array of jobs
- Queued jobs file must contain an array of jobs
- Invalid JSON for ${field}: ${errorMessage}
- Invalid flow modules:\n${errors.join('\n')}
- Invalid failure_module: only "rawscript" and "script" module
AI-assisted analysis of windmill-labs/windmill@e474e8803c (2026-09-03).
Data as JSON: /api/errors/afd457017c799c3a.
Report an issue: GitHub.