Uh oh!
There was an error while loading. Please reload this page.
Proposal: Support Webhooks as well as Callbacks - #1974
Conversation
pvcarrera
commented
Jul 21, 2019
Thanks for opening this issue @lornajane 👍 I'm also finding it hard to describe webhooks with the OpenAPI specification. I'm currently trying out two workarounds:
For now, it looks like the first approach is easier to undertand for our clients and it also looks nicer on the documentation tools we use (Stoplight) |
Uh oh!
There was an error while loading. Please reload this page.
| ## Alternatives considered | ||
| Another option is to add a special `path` that could contain the various webhooks using the exisiting `callback` syntax but existing tools which aren't expecting this special value may not handle it well, so this option was discounted. |
There was a problem hiding this comment.
Agree that paths is fraught, since the paths for a webhook handler are necessarily unknown and will vary. I agree that it's worth considering a new element, effectively a peer of paths that describe emitting (webhooks) rather than listening (paths). Thanks for the proposal.
whitlockjc
commented
Sep 12, 2019
Thanks Lorna! |
I work at Nexmo and we have a bunch of HTTP APIs, some of them offer webhooks where the server will send payloads to the client as well as the client making API requests to the server. We're looking for a solution that allows us to document and use other tools with our APIs, covering both outgoing and incoming requests.
The OpenAPI
callbacksfunctionality nearly supports what we need, but these APIs have the subscribe step completely out of band (you set it up which URL to send a webhook to when a particular event occurs either on a different API or via a web interface). I also speak about OpenAPI at conferences and I've had this question a few times. So I offer this proposal to build on the callbacks feature and add support for webhooks (with no parent path) as well.