{"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/afd2eddd3a50c16190efc1c7e94404b48f72af57/src/registry.rs#L481-L517","documentation":"When a registry tool's idiomatic-file configuration is given as a TOML table, mise only accepts a fixed set of keys: path, version_regex, version_json_path, version_expr, and related known fields. Any other key in that table is rejected with this error naming the offending key. This strictness catches typos that would otherwise silently disable idiomatic version detection.","triggerScenarios":"parse_registry_idiomatic_file encountering a TOML table for idiomatic_files (per-tool version-from-file config) containing an unknown key such as `regex` (instead of `version_regex`) or `file` (instead of `path`).","commonSituations":"Registry contributors misspell a field name, invent a field not yet supported by the schema, or copy a key from a different config section (e.g. backend fields) into the idiomatic-file table.","solutions":["Replace the unknown key with the correct supported field name (check the registry schema: path, version_regex, version_json_path, version_expr, deprecated).","Common fixes: `regex` -> `version_regex`, `file`/`file_path` -> `path`, `json_path` -> `version_json_path`, `expr` -> `version_expr`.","Validate the tool TOML against the schema before submitting; remove fields the current mise version does not support."],"exampleFix":"// before\n[[tools.node.idiomatic_files]]\nfile = \".nvmrc\"\nregex = \"v(\\d+\\.\\d+\\.\\d+)\"\n\n// after\n[[tools.node.idiomatic_files]]\npath = \".nvmrc\"\nversion_regex = \"v(\\d+\\.\\d+\\.\\d+)\"","handlingStrategy":"validation","validationCode":"// allow-list idiomatic-file keys before parsing\nconst ALLOWED: [&str; 5] = [\"path\", \"version_regex\", \"version_json_path\", \"version_expr\", \"deprecated\"];\nfor key in table.keys() {\n    assert!(ALLOWED.contains(&key.as_str()), \"unknown idiomatic file field: {key}\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Validate tool TOMLs against the registry schema in CI before merging.","Stick to documented field names; do not invent keys in idiomatic_files tables.","When copying config between tools, re-check each key against the schema for the target section."],"tags":["registry","toml","validation","unknown-field"],"backgroundTag":"schema-validation-failed","analyzedSha":"afd2eddd3a50c16190efc1c7e94404b48f72af57","analyzedAt":"2026-09-09T01:38:25.179Z","contentChangedAt":"2026-09-09T01:38:25.179Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}