{"record":{"id":"83d21b316a230178","repo":"googleworkspace/cli","slug":"unsupported-http-method-other","errorCode":null,"errorMessage":"Unsupported HTTP method: {other}","messagePattern":"Unsupported HTTP method: (.+?)","errorType":"validation","errorClass":"GwsError","httpStatus":null,"severity":"error","filePath":"crates/google-workspace-cli/src/executor.rs","lineNumber":178,"sourceCode":"#[allow(clippy::too_many_arguments)]\nasync fn build_http_request(\n    client: &reqwest::Client,\n    method: &RestMethod,\n    input: &ExecutionInput,\n    token: Option<&str>,\n    auth_method: &AuthMethod,\n    page_token: Option<&str>,\n    pages_fetched: u32,\n    upload: &Option<UploadSource<'_>>,\n) -> Result<reqwest::RequestBuilder, GwsError> {\n    let mut request = match method.http_method.as_str() {\n        \"GET\" => client.get(&input.full_url),\n        \"POST\" => client.post(&input.full_url),\n        \"PUT\" => client.put(&input.full_url),\n        \"PATCH\" => client.patch(&input.full_url),\n        \"DELETE\" => client.delete(&input.full_url),\n        other => {\n            return Err(GwsError::Other(anyhow::anyhow!(\n                \"Unsupported HTTP method: {other}\"\n            )))\n        }\n    };\n\n    if let Some(token) = token {\n        if *auth_method == AuthMethod::OAuth {\n            request = request.bearer_auth(token);\n        }\n    }\n\n    // Set quota project from ADC for billing/quota attribution\n    if let Some(quota_project) = crate::auth::get_quota_project() {\n        request = request.header(\"x-goog-user-project\", quota_project);\n    }\n\n    let mut all_query_params = input.query_params.clone();\n    if let Some(pt) = page_token {","sourceCodeStart":160,"sourceCodeEnd":196,"githubUrl":"https://github.com/googleworkspace/cli/blob/a3768d0e82ad83cca2da97724e46bea4ff0e6dbd/crates/google-workspace-cli/src/executor.rs#L160-L196","documentation":"The executor maps each Discovery method's http_method string onto a reqwest builder and only knows GET, POST, PUT, PATCH, DELETE. A Discovery document that declares any other verb (HEAD, OPTIONS, or a newly introduced method) falls into the catch-all arm and is rejected with this error. In practice it signals a version skew: the fetched Discovery document is newer (or simply different) than the verb set the CLI's executor supports.","triggerScenarios":"Google ships a Discovery revision using a verb outside the allowlist for some method; a cached Discovery document from a nonstandard source declares an unusual http_method; the service alias maps to an unexpected Discovery API.","commonSituations":"Long-running old gws binary against a freshly fetched Discovery doc; experimental/beta Google APIs surfacing new verbs; custom Discovery endpoints in tests.","solutions":["Update gws to the latest release — the verb allowlist may already have been extended","Inspect the method with `gws <service> schema` (or the Discovery JSON) to confirm which http_method it declares","If a genuinely new verb is needed, file an issue/PR extending the match in executor.rs"],"exampleFix":"// before: hard failure on any unlisted verb\nother => return Err(GwsError::Other(anyhow::anyhow!(\"Unsupported HTTP method: {other}\"))),\n\n// after (if the API truly needs it): extend the allowlist explicitly\n\"HEAD\" => client.head(&input.full_url),\nother => return Err(GwsError::Other(anyhow::anyhow!(\"Unsupported HTTP method: {other}\"))),","handlingStrategy":"validation","validationCode":"// Validate the Discovery verb before building any request\nconst SUPPORTED: &[&str] = &[\"GET\", \"POST\", \"PUT\", \"PATCH\", \"DELETE\"];\n\nfn method_supported(m: &str) -> bool {\n    SUPPORTED.contains(&m)\n}","typeGuard":"fn is_supported_http_method(method: &str) -> bool {\n    matches!(method, \"GET\" | \"POST\" | \"PUT\" | \"PATCH\" | \"DELETE\")\n}","tryCatchPattern":null,"preventionTips":["Pin/refresh the gws binary when Discovery documents change — version skew is the usual cause","When registering a new service alias, smoke-test one method per resource to catch exotic verbs early","Surface the method name in logs when this fires so users can report the exact offending verb"],"tags":["http","discovery","api-surface","version-skew"],"backgroundTag":"unsupported-http-method","analyzedSha":"a3768d0e82ad83cca2da97724e46bea4ff0e6dbd","analyzedAt":"2026-08-16T19:51:46.516Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}