(schema)
| 20 | } |
| 21 | |
| 22 | export async function getWebhooks(schema) { |
| 23 | // In OpenAPI version 3.1, the schema data is under the `webhooks` key, but |
| 24 | // in 3.0 the schema data was in `x-webhooks`. We just fallback to |
| 25 | // `x-webhooks` for now since there's currently otherwise no difference with |
| 26 | // the schema data so we can handle either version. |
| 27 | const webhooks = schema.webhooks ?? schema['x-webhooks'] |
| 28 | if (webhooks) { |
| 29 | return Object.values(webhooks).map((webhook) => new Webhook(webhook.post)) |
| 30 | } |
| 31 | |
| 32 | return [] |
| 33 | } |
no outgoing calls
no test coverage detected