{"record":{"id":"686c45cb5a7f6d4f","repo":"windmill-labs/windmill","slug":"unknown-type-s","errorCode":null,"errorMessage":"Unknown type `{s}`","messagePattern":"Unknown type `(.+?)`","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"backend/parsers/windmill-parser-java/src/lib.rs","lineNumber":111,"sourceCode":"}\n\nfn find_typ<'a>(typ_node: Node<'a>, code: &str) -> anyhow::Result<(Typ, Option<Value>)> {\n    let null = Some(serde_json::Value::Null);\n    let res = match typ_node.kind() {\n        #[rustfmt::skip]\n        \"type_identifier\" => {\n            match typ_node.utf8_text(code.as_bytes()) {\n                Ok(\"String\")      => (Typ::Str(None), null),\n                Ok(\"Byte\")        => (Typ::Bytes, null),\n                Ok(\"Short\")       => (Typ::Int, null),\n                Ok(\"Integer\")     => (Typ::Int, null),\n                Ok(\"Long\")        => (Typ::Int, null),\n                Ok(\"Float\")       => (Typ::Float, null),\n                Ok(\"Double\")      => (Typ::Float, null),\n                Ok(\"Boolean\")     => (Typ::Bool, null),\n                Ok(\"Character\")   => (Typ::Str(None), null),\n                Ok(\"Object\")      => (Typ::Object(ObjectType::new(None, Some(vec![]))),null), // TODO: Complete the object type\n                Ok(s)       => bail!(\"Unknown type `{s}`\"),\n                Err(e) => bail!(\"Error getting type name: {}\", e),\n            }\n        }\n        #[rustfmt::skip]\n        \"integral_type\" => {\n            match typ_node.utf8_text(code.as_bytes()) {\n                Ok(\"byte\")   => (Typ::Bytes, None),\n                Ok(\"short\")  => (Typ::Int, None),\n                Ok(\"int\")    => (Typ::Int, None),\n                Ok(\"long\")   => (Typ::Int, None),\n                Ok(\"char\")   => (Typ::Str(None), None),\n                Ok(s)  => bail!(\"Unknown type `{s}`\"),\n                Err(e) => bail!(\"Error getting type name: {}\", e),\n            }\n        }\n        \"floating_point_type\" => {\n            match typ_node.utf8_text(code.as_bytes()) {\n                Ok(\"float\") => (Typ::Float, None),","sourceCodeStart":93,"sourceCodeEnd":129,"githubUrl":"https://github.com/windmill-labs/windmill/blob/e474e8803ce2ff5c2df09a58dab51d45f5c922ca/backend/parsers/windmill-parser-java/src/lib.rs#L93-L129","documentation":"The Java parser maps type_identifier nodes (wrapper/reference types) to Windmill internal types via an allowlist (String, Integer, Long, Float, Double, Boolean, Character, Object). Any other type name hits the catch-all `Ok(s) => bail!(\"Unknown type \\`{s}\\`\")`, meaning the script's signature uses a Java type the parser cannot translate to a Windmill Typ.","triggerScenarios":"Parsing a Java script whose parameters or return type reference a class type not in the allowlist — e.g. custom classes, BigDecimal, List<String>, Map<...>, or a fully-qualified type — passed to find_typ on a `type_identifier` node.","commonSituations":"Hub or user Java scripts typed with collection interfaces (List, ArrayList), boxed numerics beyond the allowlist (BigInteger, Short), or user-defined POJOs; windmill sync / script validation against the workspace.","solutions":["Change the script's parameter/return types to allowlisted ones: use String, Integer/Long, Float/Double, Boolean, Character, or Object.","Type collections as `Object` (the parser maps Object to a generic ObjectType) and document the shape.","If you own the parser, extend the match arms in backend/parsers/windmill-parser-java/src/lib.rs to map more type names (search ADD_NEW_LANG-style lists) or fall back to Typ::Object instead of bailing.","Read the exact `{s}` in the error to identify which offending type name to replace."],"exampleFix":"// before (Java script signature)\npublic static List<String> main(String input) { ... }\n// after\npublic static Object main(String input) { ... } // List returned as Object","handlingStrategy":"validation","validationCode":"# validate Java script signatures before pushing\nALLOWED = {\"String\",\"Integer\",\"Long\",\"Float\",\"Double\",\"Boolean\",\"Character\",\"Object\"}\nimport re\nfor t in re.findall(r\"(?:public|private|protected)[^({]*\\(([^)]*)\\)\", java_src):\n    for p in t.split(\",\"):\n        typ = p.strip().split()[-2] if len(p.split()) >= 2 else None\n        if typ and typ not in ALLOWED:\n            raise ValueError(f\"parameter type {typ} not supported by the Java parser; use Object\")","typeGuard":"function isParserSupportedJavaType(t: string): boolean {\n  return [\"String\",\"Integer\",\"Long\",\"Float\",\"Double\",\"Boolean\",\"Character\",\"Object\"].includes(t);\n}","tryCatchPattern":"// when calling the parser programmatically\nmatch parse_java_typ(...) {\n  Err(e) if e.to_string().starts_with(\"Unknown type\") => {\n    // fall back to Typ::Object or surface a friendly UI message\n  }\n  other => other?,\n}","preventionTips":["Restrict Java script signatures to the allowlisted types; use Object for collections and custom classes.","Validate signatures in CI before windmill sync push.","Read the offending type name from the error message and map it to the closest supported type."],"tags":["java","parser","type-mapping","rust"],"backgroundTag":"unsupported-type-mapping","analyzedSha":"e474e8803ce2ff5c2df09a58dab51d45f5c922ca","analyzedAt":"2026-09-03T12:38:19.024Z","contentChangedAt":"2026-09-03T12:38:19.024Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}