Support both webhooks and x-webhooks in schema

Co-authored-by: Christopher Schleiden <[email protected]>
This commit is contained in:
Josh Gross
2023-02-15 16:23:59 -05:00
committed by GitHub
co-authored by Christopher Schleiden
parent baeb539fa8
commit f446b426bd
+1 -1
View File
@@ -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");
} }