{"record":{"id":"1329695970a85ecb","repo":"zeroclaw-labs/zeroclaw","slug":"google-workspace-allowed-operations-i-methods-132969","errorCode":null,"errorMessage":"google_workspace.allowed_operations[{i}].methods[{j}] contains invalid characters: {normalized}","messagePattern":"google_workspace\\.allowed_operations\\[(.+?)\\]\\.methods\\[(.+?)\\] contains invalid characters: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/zeroclaw-config/src/schema.rs","lineNumber":21915,"sourceCode":"                    RequiredFieldEmpty,\n                    format!(\"google_workspace.allowed_operations[{i}].methods\"),\n                    \"google_workspace.allowed_operations[{i}].methods must not be empty\"\n                );\n            }\n\n            let mut seen_methods = std::collections::HashSet::new();\n            for (j, method) in operation.methods.iter().enumerate() {\n                let normalized = method.trim();\n                if normalized.is_empty() {\n                    anyhow::bail!(\n                        \"google_workspace.allowed_operations[{i}].methods[{j}] must not be empty\"\n                    );\n                }\n                if !normalized\n                    .chars()\n                    .all(|c| c.is_ascii_alphanumeric() || c == '_' || c == '-')\n                {\n                    anyhow::bail!(\n                        \"google_workspace.allowed_operations[{i}].methods[{j}] contains invalid characters: {normalized}\"\n                    );\n                }\n                if !seen_methods.insert(normalized.to_string()) {\n                    anyhow::bail!(\n                        \"google_workspace.allowed_operations[{i}].methods contains duplicate entry: {normalized}\"\n                    );\n                }\n            }\n\n            let sub_key = operation\n                .sub_resource\n                .as_deref()\n                .map(str::trim)\n                .unwrap_or(\"\");\n            let operation_key = format!(\"{service}:{resource}:{sub_key}\");\n            if !seen_gws_operations.insert(operation_key.clone()) {\n                anyhow::bail!(","sourceCodeStart":21897,"sourceCodeEnd":21933,"githubUrl":"https://github.com/zeroclaw-labs/zeroclaw/blob/88bb9c8533fc57ed7a03e36ca7c9ed2bf8336dcc/crates/zeroclaw-config/src/schema.rs#L21897-L21933","documentation":"Config::validate() restricts each allowed_operations[].methods element to ASCII alphanumerics (camelCase allowed), '_' and '-' after trimming. Method names like quickAdd or batchUpdate are camelCase in the Google APIs, so uppercase is accepted, but dots, slashes, spaces and other punctuation are rejected because they cannot appear in the runtime tool identifiers the allowlist matches.","triggerScenarios":"An operation entry with a method like \"files.list\", \"get/list\", or \"patch \" inside the methods array failing the character check during Config::validate().","commonSituations":"Transcribing RPC-style dotted names (\"calendarList.get\") from API docs; pasting HTTP path segments; smart quotes or non-breaking spaces introduced by rich-text editors.","solutions":["Use the bare camelCase method name (\"get\", \"list\", \"quickAdd\")","Strip dots/slashes: \"files.list\" becomes either \"list\" or \"files_list\" depending on which segment is the method","Re-run validation after the fix"],"exampleFix":"# before\n[[google_workspace.allowed_operations]]\nservice = \"calendar\"\nresource = \"events\"\nmethods = [\"quickAdd\", \"events.list\"]\n\n# after\n[[google_workspace.allowed_operations]]\nservice = \"calendar\"\nresource = \"events\"\nmethods = [\"quickAdd\", \"list\"]","handlingStrategy":"validation","validationCode":"fn is_valid_gws_method(m: &str) -> bool {\n    m.chars().all(|c| c.is_ascii_alphanumeric() || c == '_' || c == '-')\n}","typeGuard":"fn is_valid_gws_method(m: &str) -> bool {\n    !m.trim().is_empty()\n        && m.chars().all(|c| c.is_ascii_alphanumeric() || c == '_' || c == '-')\n}","tryCatchPattern":"match config.validate() {\n    Ok(()) => {}\n    Err(e) if e.to_string().contains(\"methods[\") && e.to_string().contains(\"invalid characters\") => {\n        // replace dotted RPC-style names with the bare camelCase verb\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["Method = bare verb (get/list/insert/patch/quickAdd); never paste 'resource.method' pairs","Watch for smart quotes/non-breaking spaces when copying from rendered docs"],"tags":["config","google-workspace","validation","naming"],"backgroundTag":"config-field-invalid-characters","analyzedSha":"88bb9c8533fc57ed7a03e36ca7c9ed2bf8336dcc","analyzedAt":"2026-08-23T01:07:41.857Z","schemaVersion":2},"datasetVersion":"2026-08-23T08:06:27.607Z"}