Support both webhooks and x-webhooks in schema
Co-authored-by: Christopher Schleiden <[email protected]>
This commit is contained in:
co-authored by
Christopher Schleiden
parent
baeb539fa8
commit
f446b426bd
@@ -8,7 +8,7 @@ const OUTPUT_PATH = "src/webhooks.json";
|
|||||||
|
|
||||||
const schema: any = await fetch(SCHEMA_URL).then(res => res.json());
|
const schema: any = await fetch(SCHEMA_URL).then(res => res.json());
|
||||||
|
|
||||||
const rawWebhooks = Object.values(schema["x-webhooks"]) as any[];
|
const rawWebhooks = Object.values(schema.webhooks || schema["x-webhooks"]) as any[];
|
||||||
if (!rawWebhooks) {
|
if (!rawWebhooks) {
|
||||||
throw new Error("No webhooks found in schema");
|
throw new Error("No webhooks found in schema");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user