{"record":{"id":"afd457017c799c3a","repo":"windmill-labs/windmill","slug":"received-unsupported-type-other","errorCode":null,"errorMessage":"Received unsupported type `{other}`","messagePattern":"Received unsupported type `(.+?)`","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"backend/windmill-common/src/schema.rs","lineNumber":581,"sourceCode":"            \"number\" => {\n                return Ok(JsonPrimitiveType::Number);\n            }\n            \"integer\" => {\n                return Ok(JsonPrimitiveType::Integer);\n            }\n            \"object\" => {\n                return Ok(JsonPrimitiveType::Object);\n            }\n            \"array\" => {\n                return Ok(JsonPrimitiveType::Array);\n            }\n            \"boolean\" => {\n                return Ok(JsonPrimitiveType::Boolean);\n            }\n            \"null\" => {\n                return Ok(JsonPrimitiveType::Null);\n            }\n            other => return Err(anyhow!(\"Received unsupported type `{other}`\").into()),\n        }\n    }\n}\n\n#[cfg(test)]\nmod tests {\n    use serde_json::json;\n\n    use super::*;\n\n    fn value_to_rawvalue_map(\n        value: Value,\n    ) -> Result<HashMap<String, Box<RawValue>>, anyhow::Error> {\n        match value {\n            Value::Object(map) => {\n                let mut result = HashMap::new();\n                for (key, val) in map {\n                    let raw = serde_json::to_string(&val)?; // Serialize the Value to a string","sourceCodeStart":563,"sourceCodeEnd":599,"githubUrl":"https://github.com/windmill-labs/windmill/blob/e474e8803ce2ff5c2df09a58dab51d45f5c922ca/backend/windmill-common/src/schema.rs#L563-L599","documentation":"`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.","triggerScenarios":"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.","commonSituations":"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'.","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."],"exampleFix":"// before\n{\"type\": \"float\"}\n// after\n{\"type\": \"number\"}","handlingStrategy":"validation","validationCode":"const ALLOWED = new Set([\"object\",\"array\",\"string\",\"number\",\"integer\",\"boolean\",\"null\"]);\nfunction isValidPrimitiveType(t) {\n  return typeof t === \"string\" && ALLOWED.has(t.trim().toLowerCase());\n}\nif (!isValidPrimitiveType(schemaType)) {\n  throw new Error(`Unsupported primitive type '${schemaType}'; use one of ${[...ALLOWED].join(\", \")}`);\n}","typeGuard":"function isJsonPrimitiveType(t) {\n  return [\"object\",\"array\",\"string\",\"number\",\"integer\",\"boolean\",\"null\"]\n    .includes(t);\n}","tryCatchPattern":"try {\n  const t = JsonPrimitiveType.fromString(raw);\n} catch (e) {\n  if (String(e).includes(\"unsupported type\")) {\n    console.error(`Schema type '${raw}' is not a JSON primitive type; fix the schema definition.`);\n  }\n  throw e;\n}","preventionTips":["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."],"tags":["schema","validation","json"],"backgroundTag":"schema-validation-failed","analyzedSha":"e474e8803ce2ff5c2df09a58dab51d45f5c922ca","analyzedAt":"2026-09-03T12:38:19.024Z","contentChangedAt":"2026-09-03T12:38:19.024Z","schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}