MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / deriveOperationId

Function deriveOperationId

packages/plugins/openapi/src/sdk/extract.ts:418–425  ·  view source on GitHub ↗
(
  method: HttpMethod,
  pathTemplate: string,
  operation: OperationObject,
)

Source from the content-addressed store, hash-verified

416// ---------------------------------------------------------------------------
417
418const deriveOperationId = (
419 method: HttpMethod,
420 pathTemplate: string,
421 operation: OperationObject,
422): string =>
423 operation.operationId ??
424 (`${method}_${pathTemplate.replace(/[^a-zA-Z0-9]+/g, "_")}`.replace(/^_+|_+$/g, "") ||
425 `${method}_operation`);
426
427const explicitToolPath = (operation: OperationObject): string | undefined => {
428 const value = (operation as Record<string, unknown>)["x-executor-toolPath"];

Callers 3

extract.tsFile · 0.85
streamOperationBindingsFunction · 0.85

Calls 1

replaceMethod · 0.65

Tested by

no test coverage detected