MCPcopy
hub / github.com/github/docs / getOperations

Function getOperations

src/rest/scripts/utils/get-operations.js:9–20  ·  view source on GitHub ↗
(schema)

Source from the content-addressed store, hash-verified

7// HTTP verb and requestPath attached as properties
8
9export default async function getOperations(schema) {
10 const operations = []
11
12 for (const [requestPath, operationsAtPath] of Object.entries(schema.paths)) {
13 for (const [verb, operationProps] of Object.entries(operationsAtPath)) {
14 const operation = new Operation(verb, requestPath, operationProps, schema.servers)
15 operations.push(operation)
16 }
17 }
18
19 return operations
20}
21
22export async function getWebhooks(schema) {
23 // In OpenAPI version 3.1, the schema data is under the `webhooks` key, but

Callers 2

checkFunction · 0.85
getRestOperationsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected