{"record":{"id":"2a95ca8a64d3df15","repo":"jdx/mise","slug":"bootstrap-macos-dock-apps-expected-an-array-of-application","errorCode":null,"errorMessage":"[bootstrap.macos.dock].apps: expected an array of application paths","messagePattern":"\\[bootstrap\\.macos\\.dock\\]\\.apps: expected an array of application paths","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/defaults/dock.rs","lineNumber":9,"sourceCode":"//! Application layout semantics for the friendly Dock setting. Raw defaults remain exact.\nuse std::path::{Component, Path, PathBuf};\n\nuse super::DefaultsValue;\nuse crate::result::Result;\n\npub(super) fn paths(value: &DefaultsValue) -> Result<Vec<PathBuf>> {\n    let DefaultsValue::Array(values) = value else {\n        eyre::bail!(\"[bootstrap.macos.dock].apps: expected an array of application paths\");\n    };\n    let mut paths = Vec::new();\n    let mut seen = std::collections::HashSet::new();\n    for value in values {\n        let DefaultsValue::Str(value) = value else {\n            eyre::bail!(\"[bootstrap.macos.dock].apps: expected an array of application paths\");\n        };\n        let path = if let Some(rest) = value.strip_prefix(\"~/\") {\n            eyre::ensure!(\n                !Path::new(rest).has_root(),\n                \"[bootstrap.macos.dock].apps: expected a path relative to home: {value}\"\n            );\n            crate::env::HOME.join(rest)\n        } else {\n            PathBuf::from(value)\n        };\n        eyre::ensure!(\n            path.is_absolute()","sourceCodeStart":1,"sourceCodeEnd":27,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/system/defaults/dock.rs#L1-L27","documentation":"Validation error in `dock::paths`: the value configured under `bootstrap.macos.dock` key `apps` is not a `DefaultsValue::Array`. The library expects an array of application path strings to reconcile against the Dock's `persistent-apps`, and refuses to proceed otherwise.","triggerScenarios":"Calling `paths` (via `matches` or `reconcile`) with a `DefaultsValue` that is a Str, Bool, Integer, Table, etc. — i.e. the TOML/config set `apps` to a single string or another non-array type instead of an array of paths.","commonSituations":"Writing `apps = \"/Applications/Safari.app\"` (bare string) instead of `apps = [\"/Applications/Safari.app\"]` in the config; quoting or templating mistakes collapsing an array into a string; passing the wrong key's value into the dock reconciler.","solutions":["Change the config so `bootstrap.macos.dock.apps` is an array of strings: `apps = [\"/Applications/Safari.app\"]`.","Check for templating/interpolation that turns the list into a single joined string and fix the expression.","Ensure you are reading the correct key (`apps`) and not a sibling scalar value when constructing the DefaultsRequest."],"exampleFix":"// before\n[bootstrap.macos.dock]\napps = \"/Applications/Safari.app\"\n// after\n[bootstrap.macos.dock]\napps = [\"/Applications/Safari.app\"]","handlingStrategy":"validation","validationCode":"let apps = &config[\"bootstrap\"][\"macos\"][\"dock\"][\"apps\"];\nassert!(apps.is_array(), \"bootstrap.macos.dock.apps must be an array of path strings\");","typeGuard":"fn is_app_paths(v: &serde_json::Value) -> bool {\n    v.is_array() && v.as_array().map_or(false, |a| a.iter().all(|i| i.is_string()))\n}","tryCatchPattern":null,"preventionTips":["Always write apps as a TOML array, even for a single app.","Validate config with the project schema before applying dock changes.","Watch for templating that joins arrays into one string."],"tags":["macos","dock","config-validation","type-mismatch"],"backgroundTag":"config-type-mismatch","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"}