{"record":{"id":"fd5b2c446d9cea3b","repo":"gitbutlerapp/gitbutler","slug":"error-when-registering-schema-for-type-regis-fd5b2c","errorCode":null,"errorMessage":"Error when registering schema {} for type {} registered at {}\n\nMissing dependent type {}. Consider deriving `JsonSchema` on the type and registering it with `register_sdk_type!()`.\n","messagePattern":"Error when registering schema (.+?) for type (.+?) registered at (.+?)\n\nMissing dependent type (.+?)\\. Consider deriving `JsonSchema` on the type and registering it with `register_sdk_type!\\(\\)`\\.\n","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/but-ts/src/main.rs","lineNumber":362,"sourceCode":"    for t in &types {\n        if let Some(obj) = t.schema.as_object()\n            && let Some(serde_json::Value::Object(defs)) =\n                obj.get(\"$defs\").or_else(|| obj.get(\"definitions\"))\n        {\n            for (def_name, def_schema) in defs {\n                if let Some(entry) = existing_names.get(&def_name.as_ref()) {\n                    let entry_schema = entry.schema.clone().to_value();\n                    if !root_equals_def(&entry_schema, def_schema, def_name) {\n                        bail!(\n                            \"Error when registering schema {} for type {} registered at {}\\n\\nThe registered dependent type {} has a different signature than what is expected. This indicates a potential name collision. Consider renaming one of the types with either `#[serde(rename = ...)]` or `#[schemars(rename = ...)]`.\\n\",\n                            t.name,\n                            t.type_name,\n                            t.registration_location,\n                            def_name\n                        )\n                    }\n                } else {\n                    bail!(\n                        \"Error when registering schema {} for type {} registered at {}\\n\\nMissing dependent type {}. Consider deriving `JsonSchema` on the type and registering it with `register_sdk_type!()`.\\n\",\n                        t.name,\n                        t.type_name,\n                        t.registration_location,\n                        def_name\n                    )\n                }\n            }\n        }\n    }\n\n    // Order output types by name\n    types.sort_by(|a, b| a.name.cmp(&b.name));\n\n    Ok(types\n        .into_iter()\n        .map(|s| (s.name.to_string(), s.schema))\n        .collect())","sourceCodeStart":344,"sourceCodeEnd":380,"githubUrl":"https://github.com/gitbutlerapp/gitbutler/blob/caf1f223d3cfb94488c9198ad34487c6006c648f/crates/but-ts/src/main.rs#L344-L380","documentation":"Error \"Error when registering schema {} for type {} registered at {}\n\nMissing dependent type {}. Consider deriving `JsonSchema` on the type and registering it with `register_sdk_type!()`.\n\" thrown in gitbutlerapp/gitbutler.","triggerScenarios":"Thrown at crates/but-ts/src/main.rs:362 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"caf1f223d3cfb94488c9198ad34487c6006c648f","analyzedAt":"2026-08-20T07:55:40.983Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}