From 458703d892fa04ba86c1f85300a71fc3e1af2ad7 Mon Sep 17 00:00:00 2001 From: Don Olmstead Date: Tue, 16 Sep 2025 14:05:40 -0700 Subject: [PATCH] add WebhookPayload definition Add `WebhookPayload` which contains a `discriminator` to map the different payload types based on the value of `event_type`. --- openapi/openapi.yaml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/openapi/openapi.yaml b/openapi/openapi.yaml index bb0b0b2..6fd8c5d 100644 --- a/openapi/openapi.yaml +++ b/openapi/openapi.yaml @@ -6897,6 +6897,25 @@ components: mention: type: string description: User id that is set if a fragment refers to a user mention + WebhookPayload: + oneOf: + - $ref: "#/components/schemas/WebhookPingPayload" + - $ref: "#/components/schemas/WebhookFileUpdatePayload" + - $ref: "#/components/schemas/WebhookFileDeletePayload" + - $ref: "#/components/schemas/WebhookFileVersionUpdatePayload" + - $ref: "#/components/schemas/WebhookLibraryPublishPayload" + - $ref: "#/components/schemas/WebhookFileCommentPayload" + - $ref: "#/components/schemas/WebhookDevModeStatusUpdatePayload" + discriminator: + propertyName: event_type + mapping: + PING: "#/components/schemas/WebhookPingPayload" + FILE_UPDATE: "#/components/schemas/WebhookFileUpdatePayload" + FILE_DELETE: "#/components/schemas/WebhookFileDeletePayload" + FILE_VERSION_UPDATE: "#/components/schemas/WebhookFileVersionUpdatePayload" + LIBRARY_PUBLISH: "#/components/schemas/WebhookLibraryPublishPayload" + FILE_COMMENT: "#/components/schemas/WebhookFileCommentPayload" + DEV_MODE_STATUS_UPDATE: "#/components/schemas/WebhookDevModeStatusUpdatePayload" WebhookBasePayload: type: object properties: