{"record":{"id":"2332a1922146d967","repo":"windmill-labs/windmill","slug":"field-properties-should-be-an-object","errorCode":null,"errorMessage":"Field properties should be an object","messagePattern":"Field properties should be an object","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"backend/windmill-common/src/schema.rs","lineNumber":77,"sourceCode":"                    if encoding == \"base64\" {\n                        schema_rules.push(SchemaValidationRule::IsBytes);\n                    }\n                }\n            }\n\n            JsonPrimitiveType::Number => {\n                schema_rules.push(SchemaValidationRule::IsNumber);\n            }\n            JsonPrimitiveType::Integer => {\n                schema_rules.push(SchemaValidationRule::IsInteger);\n            }\n            JsonPrimitiveType::Object => {\n                let mut obj_rules = vec![];\n\n                if let Some(properties) = val.get(\"properties\") {\n                    let properties = properties\n                        .as_object()\n                        .ok_or(anyhow!(\"Field properties should be an object\"))?;\n\n                    for (key, v) in properties {\n                        obj_rules.push((key.clone(), SchemaValidationRule::from_value(v)?))\n                    }\n\n                    schema_rules.push(SchemaValidationRule::IsObject(obj_rules));\n                } else if let Some(one_of) = val.get(\"oneOf\") {\n                    let one_of = one_of\n                        .as_array()\n                        .ok_or(anyhow!(\"`oneOf` needs to be an array\"))?;\n                    let mut rules_map: HashMap<String, Vec<SchemaValidationRule>> = HashMap::new();\n\n                    for variant in one_of {\n                        let variant_label = variant\n                            .get(\"title\")\n                            .ok_or(anyhow!(\n                                \"oneOf variant definition should have a `title` field\"\n                            ))?","sourceCodeStart":59,"sourceCodeEnd":95,"githubUrl":"https://github.com/windmill-labs/windmill/blob/e474e8803ce2ff5c2df09a58dab51d45f5c922ca/backend/windmill-common/src/schema.rs#L59-L95","documentation":"During JSON-schema ingestion, `SchemaValidationRule::from_primitive` found a `properties` key on an object-typed schema whose value is not a JSON object. The parser expects `{ \"properties\": { name: <schema> } }`; anything else (string, array, number) cannot be turned into per-field validation rules, so parsing fails.","triggerScenarios":"Deploying a script/flow/app whose input schema (or app JSON schema) declares `type: \"object\"` with a `properties` field that is not a mapping, e.g. `\"properties\": \"...\"` or `\"properties\": []`.","commonSituations":"Hand-edited JSON schemas, code-generated schemas with a malformed `properties` node, copy-paste errors, or tools emitting draft-schema features Windmill's parser does not accept.","solutions":["Change `properties` to a JSON object mapping field names to schema definitions.","If you meant a union of shapes, use `oneOf`/`anyOf` instead of a non-object `properties`.","Validate the JSON schema with a standard validator (e.g. jsonschema) before deploying."],"exampleFix":"// before\n{ \"type\": \"object\", \"properties\": [\"a\", \"b\"] }\n// after\n{ \"type\": \"object\", \"properties\": { \"a\": { \"type\": \"string\" }, \"b\": { \"type\": \"number\" } } }","handlingStrategy":"validation","validationCode":"const s = JSON.parse(schemaRaw);\nif (s.type === \"object\" && \"properties\" in s && (typeof s.properties !== \"object\" || s.properties === null || Array.isArray(s.properties))) {\n  throw new Error(\"`properties` must be an object mapping field names to schemas\");\n}","typeGuard":"function hasValidProperties(s) {\n  return typeof s === \"object\" && s !== null &&\n    (typeof s.properties !== \"undefined\" ? (typeof s.properties === \"object\" && !Array.isArray(s.properties)) : true);\n}","tryCatchPattern":"try {\n  deployScript({ schema });\n} catch (e) {\n  if (String(e.message).includes(\"properties should be an object\")) {\n    console.error(\"Fix the JSON schema: `properties` must be an object\", e);\n  } else throw e;\n}","preventionTips":["Run schemas through a JSON Schema validator before deploying.","Never hand-edit `properties` without re-validating the whole schema.","Keep schemas in version control and lint them in CI."],"tags":["json-schema","validation","rust","windmill"],"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-08T10:18:20.063Z"}