Skip to content

Instantly share code, notes, and snippets.

@mathis-m
Created October 3, 2021 20:04
Show Gist options
  • Save mathis-m/0bc9f44b15d8729ac72e09d2a41dee61 to your computer and use it in GitHub Desktop.
Save mathis-m/0bc9f44b15d8729ac72e09d2a41dee61 to your computer and use it in GitHub Desktop.
openapi: 3.0.0
info:
version: 1.0.0
title: test
description: example with callback
paths:
/subscribe:
post:
summary: Subscribe to a webhook
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
callbackUrl:
type: string
format: uri
example: https://myserver.com/send/callback/here
required:
- callbackUrl
callbacks:
myEvent:
'{$request.body#/callbackUrl}':
post:
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
message:
type: string
example: Some event happened
required:
- message
responses:
'200':
description: Your server returns this code if it accepts the callback
responses:
'201':
description: Webhook created
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment