{"record":{"id":"149032a0017de9d4","repo":"zed-industries/zed","slug":"should-be-an-object","errorCode":null,"errorMessage":"should be an object","messagePattern":"should be an object","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/languages/src/python.rs","lineNumber":2414,"sourceCode":"                            schema_entry.insert(\n                                \"type\".to_string(),\n                                serde_json::Value::String(json_type.to_string()),\n                            );\n                        }\n                    }\n\n                    current.insert(part.to_string(), serde_json::Value::Object(schema_entry));\n                } else {\n                    let next_current = current\n                        .entry(part.to_string())\n                        .or_insert_with(|| {\n                            serde_json::json!({\n                                \"type\": \"object\",\n                                \"properties\": {}\n                            })\n                        })\n                        .as_object_mut()\n                        .expect(\"should be an object\")\n                        .entry(\"properties\")\n                        .or_insert_with(|| serde_json::json!({}))\n                        .as_object_mut()\n                        .expect(\"properties should be an object\");\n\n                    current = next_current;\n                }\n            }\n        }\n\n        serde_json::json!({\n            \"type\": \"object\",\n            \"properties\": root_properties\n        })\n    }\n}\n\n#[cfg(target_os = \"macos\")]","sourceCodeStart":2396,"sourceCodeEnd":2432,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/languages/src/python.rs#L2396-L2432","documentation":"Asserts an internal invariant while converting a JSON schema path into nested schema objects: an intermediate entry inserted as {\"type\":\"object\",\"properties\":{}} must be a JSON object when re-entered via .as_object_mut. It can only fail if a concurrently-inserted value under the same key is a non-object (e.g., a leaf schema placed where a container was expected) — i.e., a name collision between a leaf setting and an object setting in dotted paths.","triggerScenarios":"Thrown at crates/languages/src/python.rs:2414 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Detect the collision and log both the offending path and existing value type before converting","Skip or rename the conflicting leaf key so container/leaf roles never collide","Use entry() with a match to merge rather than unwrap when the existing value is already present"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f4178619acd0d47ea1f76a2025c42962c6d6638c","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}