{"record":{"id":"4bfa3c8832e9e315","repo":"hasura/graphql-engine","slug":"error-at-path-path","errorCode":null,"errorMessage":"{error} at path {path}","messagePattern":"(.+?) at path (.+?)","errorType":"validation","errorClass":"OpenDdDeserializeError","httpStatus":null,"severity":"error","filePath":"v3/crates/open-dds/src/traits.rs","lineNumber":249,"sourceCode":"                // Only generate an $id if an $id is not already present and if a title has been set.\n                // Downstream tooling doesn't handle $id without a title well and if a schema doesn't have a title,\n                // then it likely isn't significant enough to warrant an $id.\n                if metadata.id.is_none() && metadata.title.is_some() {\n                    metadata.id = Some(format!(\n                        \"https://hasura.io/jsonschemas/metadata/{schema_name}\"\n                    ));\n                }\n            }\n        }\n    }\n\n    deduplicate_definitions(&mut root_schema);\n    root_schema\n}\n\n/// Error type for deserializing OpenDd types from JSON values.\n#[derive(Debug, thiserror::Error)]\n#[error(\"{error} at path {path}\")]\npub struct OpenDdDeserializeError {\n    #[source]\n    pub error: serde_json::Error,\n    pub path: jsonpath::JSONPath,\n}\n\n#[cfg(test)]\nmod tests {\n    use crate::traits;\n    use opendds_derive::OpenDd;\n    use pretty_assertions::assert_eq;\n    use serde_json;\n\n    #[test]\n    fn test_parse_versioned_enum() {\n        #[derive(Debug, PartialEq, OpenDd)]\n        struct MyStruct {\n            name: String,","sourceCodeStart":231,"sourceCodeEnd":267,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/v3/crates/open-dds/src/traits.rs#L231-L267","documentation":"OpenDd deserialize error from the open-dds crate: converting a JSON value into an OpenDd type failed at a specific JSON path. The serde_json error says what failed to parse; the path tells you where in the document it happened.","triggerScenarios":"Calling OpenDd deserialization helpers (e.g. open_dd_root_from_json / the traits in open-dds/src/traits.rs) on a JSON document where the value at `path` does not match the expected schema — wrong field type, unknown/missing required key, malformed structure.","commonSituations":"Hand-editing .hml/json metadata and introducing a typo or wrong value type (string where number expected); feeding a CI-exported JSON produced by an older/newer CLI version whose schema changed; forgetting to regenerate metadata after a breaking change.","solutions":["Look at the reported path and fix the value at that exact location in the JSON/hml file","Regenerate metadata with the CLI version matching your project instead of hand-editing","Upgrade/downgrade the open-dds crate to match the metadata schema version you are consuming"],"exampleFix":"// before\n{ \"kind\": \"Model\", \"name\": 123 }\n// after\n{ \"kind\": \"Model\", \"name\": \"user\" }","handlingStrategy":"try-catch","validationCode":"// Validate against the expected shape with a JSON Schema before deserializing\njsonschema::validate(&schema, &json_value)?;","typeGuard":null,"tryCatchPattern":"match open_dd::traits::OpenDdSubTypes::from_json_value(value) {\n    Err(e @ OpenDdDeserializeError { .. }) => {\n        eprintln!(\"{} at {}\", e.error, e.path); // fix the document at e.path\n    }\n    Ok(v) => v,\n}","preventionTips":["Never hand-edit generated metadata; regenerate instead","Pin CLI and open-dds crate versions together"],"tags":["deserialization","json","schema","open-dds","hasura"],"backgroundTag":"json-schema-validation-failed","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}