MCPcopy Index your code
hub / github.com/pmxt-dev/pmxt / getOperation

Function getOperation

core/test/unit/openapi-code-samples.test.js:55–64  ·  view source on GitHub ↗
(spec, operationId)

Source from the content-addressed store, hash-verified

53}
54
55function getOperation(spec, operationId) {
56 for (const pathItem of Object.values(spec.paths || {})) {
57 for (const operation of Object.values(pathItem || {})) {
58 if (operation && operation.operationId === operationId) {
59 return operation;
60 }
61 }
62 }
63 throw new Error(`Operation not found: ${operationId}`);
64}
65
66function collectOperationSamples(spec, operationId, language) {
67 return (getOperation(spec, operationId)['x-codeSamples'] || [])

Callers 2

collectOperationSamplesFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected