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

Function deriveOperationId

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

Source from the content-addressed store, hash-verified

492// ---------------------------------------------------------------------------
493
494const deriveOperationId = (
495 method: HttpMethod,
496 pathTemplate: string,
497 operation: OperationObject,
498): string =>
499 operation.operationId ??
500 (`${method}_${pathTemplate.replace(/[^a-zA-Z0-9]+/g, "_")}`.replace(/^_+|_+$/g, "") ||
501 `${method}_operation`);
502
503const explicitToolPath = (operation: OperationObject): string | undefined => {
504 const value = (operation as Record<string, unknown>)["x-executor-toolPath"];

Callers 4

extract.tsFile · 0.85
streamOperationBindingsFunction · 0.85
streamPreviewOperationsFunction · 0.85

Calls 1

replaceMethod · 0.65

Tested by

no test coverage detected