-
Hi 👋 We're leveraging the capability to import event types from an OpenAPI document. The docs mention the following:
We can't seem to get the Click to see a cut-down example of the OpenAPI document we use{
"openapi": "3.1.0",
"info": {
"title": "Webhook",
"version": "1.0.0"
},
"webhooks": {
"RedactedEventType": {
"description": "Description.",
"summary": "Description.",
"post": {
"description": "Description.",
"requestBody": {
"description": "Description.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/RedactedEvent"
},
"example": {
"type": "RedactedEventType",
"data": {
"RedactedPropertyOne": "<guid>",
"RedactedPropertyTwo": "<guid>"
}
}
}
}
}
}
}
},
"components": {
"schemas": {
"RedactedEvent": {
"type": "object",
"properties": {
"type": {
"type": "string",
"default": "RedactedEvent",
"enum": ["RedactedEvent"]
},
"data": {
"type": "object",
"properties": {
"RedactedPropertyOne": {
"type": "string"
},
"RedactedPropertyTwo": {
"type": "string"
}
},
"required": ["RedactedPropertyOne", "RedactedPropertyTwo"]
}
},
"required": ["type", "data"]
}
}
}
} We also tried looking in the code but weren't able to find the implementation for the Could you please help us with this? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
I believe so. Looping in @svix-lucho to help! |
Beta Was this translation helpful? Give feedback.
-
The
However, I was able to use your example directly and the description was loaded correctly. I only renamed 'Description' to 'Description 2' for clarity.
|
Beta Was this translation helpful? Give feedback.
Summary that I'll mark as an answer for future peeps who stumble here.
The event type description is sourced from the
description
field defined under "post", e.g.{ "openapi": "3.1.0", "info": { "title": "Webhooks", "version": "1.0.0" }, "webhooks": { "RedactedEventType": { "post": { + "description": "This will be the event type description.", "requestBody": { // rest omitted for brevity } } } } }
If you're using the provided Postman collection and your event types aren't updated, make sure to disable the
idempotency-key
header in the request (and all other POST requests)