(spec, operationId)
| 53 | } |
| 54 | |
| 55 | function 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 | |
| 66 | function collectOperationSamples(spec, operationId, language) { |
| 67 | return (getOperation(spec, operationId)['x-codeSamples'] || []) |
no outgoing calls
no test coverage detected