MCPcopy Create free account
hub / github.com/ReAPI-com/mcp-openapi / findOperationById

Method findOperationById

src/core/SpecService.ts:439–463  ·  view source on GitHub ↗
(
    specId: string,
    operationId: string
  )

Source from the content-addressed store, hash-verified

437 }
438
439 async findOperationById(
440 specId: string,
441 operationId: string
442 ): Promise<LoadOperationResult | null> {
443 const spec = this.specs[specId];
444 if (!spec) {
445 return null;
446 }
447
448 for (const path in spec.paths) {
449 const pathItem = spec.paths[path];
450 for (const method in pathItem) {
451 if (pathItem[method]["operationId"] === operationId) {
452 return {
453 path,
454 method,
455 operation: pathItem[method],
456 specId,
457 uri: `apis://${specId}/operations/${operationId}`,
458 };
459 }
460 }
461 }
462 return null;
463 }
464
465 async findOperationByPathAndMethod(
466 specId: string,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected