{"record":{"id":"4fee15eed66cc7a7","repo":"jdx/mise","slug":"unknown-idiomatic-file-field-key","errorCode":null,"errorMessage":"unknown idiomatic file field: {key}","messagePattern":"unknown idiomatic file field: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/registry.rs","lineNumber":499,"sourceCode":"                .map(parse_registry_idiomatic_file)\n                .collect()\n        })\n        .transpose()\n        .map(Option::unwrap_or_default)\n}\n\nfn parse_registry_idiomatic_file(value: &toml::Value) -> Result<RegistryIdiomaticFile> {\n    match value {\n        toml::Value::String(path) => Ok(RegistryIdiomaticFile {\n            path: leak_string(path.clone()),\n            version_regex: None,\n            version_json_path: None,\n            version_expr: None,\n            deprecated: None,\n        }),\n        toml::Value::Table(table) => {\n            for key in table.keys() {\n                ensure!(\n                    matches!(\n                        key.as_str(),\n                        \"path\"\n                            | \"version_regex\"\n                            | \"version_json_path\"\n                            | \"version_expr\"\n                            | \"deprecated\"\n                    ),\n                    \"unknown idiomatic file field: {key}\"\n                );\n            }\n            let string = |key: &str| -> Result<Option<&'static str>> {\n                table\n                    .get(key)\n                    .map(|value| {\n                        value\n                            .as_str()\n                            .map(|value| leak_string(value.to_string()))","sourceCodeStart":481,"sourceCodeEnd":517,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/registry.rs#L481-L517","documentation":"This error is thrown while parsing the idiomatic version-file section of a registry tool. When the section is a TOML table, every key must be one of the known fields (path, version_regex, version_json_path, version_expr, ...); any other key is rejected. This catches typos and unsupported options early instead of silently ignoring them.","triggerScenarios":"Writing an idiomatic-file table in registry TOML containing a key outside the allowlist, e.g. `version-file = { path = \"...\", verssion_regex = \"...\" }` (typo) or a made-up field.","commonSituations":"Typos in field names; copying fields from a different config schema (e.g. generic tool config) into the idiomatic file section; following outdated documentation.","solutions":["Rename the unknown key to one of the allowed fields: path, version_regex, version_json_path, version_expr (plus any others in the allowlist)","Check for typos in the field name at the reported key","Remove the key if it was not actually a supported option"],"exampleFix":"// before\n[tools.python.version-file]\npath = \".python-version\"\nversion_pattern = \"^(\\\\d+\\\\.\\\\d+)\"\n// after\n[tools.python.version-file]\npath = \".python-version\"\nversion_regex = \"^(\\\\d+\\\\.\\\\d+)\"","handlingStrategy":"validation","validationCode":"const IDIOMATIC_FILE_FIELDS: &[&str] = &[\"path\", \"version_regex\", \"version_json_path\", \"version_expr\"];\nfn validate_idiomatic_file(table: &toml::Value) -> Result<(), String> {\n    if let Some(t) = table.get(\"version-file\").and_then(|v| v.as_table()) {\n        for key in t.keys() {\n            if !IDIOMATIC_FILE_FIELDS.contains(&key.as_str()) {\n                return Err(format!(\"unknown idiomatic file field: {key}\"));\n            }\n        }\n    }\n    Ok(())\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Copy field names from the schema/docs rather than by memory","Run schema validation on registry TOML in CI to catch typos","Prefer the string shorthand form when only a path is needed"],"tags":["registry","toml","validation","unknown-field"],"backgroundTag":"schema-validation-failed","analyzedSha":"533346cc374382b41ec5ff70536252b2e96e725c","analyzedAt":"2026-09-17T13:35:38.149Z","contentChangedAt":"2026-09-17T13:35:38.149Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}