{"record":{"id":"2179025c012b2b8c","repo":"Budibase/budibase","slug":"unsupported-method-method","errorCode":null,"errorMessage":"Unsupported method: ${method}","messagePattern":"Unsupported method: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/server/src/api/controllers/query/import/sources/base/index.ts","lineNumber":263,"sourceCode":"        bodyType: resolvedBodyType,\n      },\n      transformer,\n      schema,\n      readable,\n      queryVerb,\n    }\n\n    if (restTemplateMetadata) {\n      query.restTemplateMetadata = restTemplateMetadata\n    }\n\n    return query\n  }\n\n  verbFromMethod = (method: string): QueryVerb => {\n    const normalized = this.normalizeMethod(method)\n    if (!normalized) {\n      throw new Error(`Unsupported method: ${method}`)\n    }\n    return MethodToVerb[normalized as keyof typeof MethodToVerb]\n  }\n\n  processPath = (path: string): string => {\n    if (path?.startsWith(\"/\")) {\n      path = path.substring(1)\n    }\n\n    path = this.convertPathVariables(path)\n\n    return path\n  }\n\n  processQuery = (queryString: string): string => {\n    if (queryString?.startsWith(\"?\")) {\n      return queryString.substring(1)\n    }","sourceCodeStart":245,"sourceCodeEnd":281,"githubUrl":"https://github.com/Budibase/budibase/blob/a81a902e9a8fe55b467d106765f6638f12e35c49/packages/server/src/api/controllers/query/import/sources/base/index.ts#L245-L281","documentation":"verbFromMethod normalizes an HTTP method string and maps it through MethodToVerb (get/post/put/patch/delete) to a Budibase QueryVerb. If the normalized method is unknown (empty, or methods like head/options/trace/connect), it throws 'Unsupported method: <method>'.","triggerScenarios":"An OpenAPI operation declares pathItem keys or operation methods outside {get,post,put,patch,delete} (e.g. $ref placeholders, 'head', 'options', 'trace', 'servers', 'parameters' leaking into method parsing), or a curl -X flag uses an unsupported verb.","commonSituations":"Specs that use OpenAPI 3.x extensions at path level which the parser mistakes for methods; specs containing HEAD/OPTIONS-only endpoints; hand-written YAML with a typo like 'Get' handled incorrectly upstream or 'purge'.","solutions":["Remove or fix the unsupported method entries in the source spec (keep only get/post/put/patch/delete operations)","Ensure path-level keys are real HTTP methods, not $ref or field names, in the document being imported","If you need HEAD/OPTIONS endpoints, model them as GET/POST equivalents or add support to MethodToVerb upstream"],"exampleFix":"// before\npaths:\n  /ping:\n    trace:\n      summary: trace ping # unsupported\n// after\npaths:\n  /ping:\n    get:\n      summary: ping","handlingStrategy":"validation","validationCode":"const SUPPORTED = new Set([\"get\", \"post\", \"put\", \"patch\", \"delete\"])\nfunction assertSupportedMethods(spec: { paths: Record<string, Record<string, unknown>> }) {\n  for (const [path, ops] of Object.entries(spec.paths)) {\n    for (const key of Object.keys(ops)) {\n      if (!SUPPORTED.has(key.toLowerCase()) && !(key.startsWith(\"x-\") || key === \"parameters\")) {\n        throw new Error(`Unsupported method '${key}' on ${path}`)\n      }\n    }\n  }\n}","typeGuard":"null","tryCatchPattern":"try {\n  await importer.importQueries(datasourceId)\n} catch (e) {\n  if (String(e?.message).startsWith(\"Unsupported method:\")) {\n    // remove/replace that operation in the spec and retry\n  }\n  throw e\n}","preventionTips":["Keep only get/post/put/patch/delete operations in specs you import","Avoid stray keys (head/options/trace/$ref) at the path-item level","Lint the spec before import to catch non-method path keys"],"tags":["openapi","parsing","validation"],"backgroundTag":"unsupported-http-method","analyzedSha":"a81a902e9a8fe55b467d106765f6638f12e35c49","analyzedAt":"2026-08-29T01:03:10.972Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}