Skip to content

Instantly share code, notes, and snippets.

@lbroudoux
Last active April 13, 2021 12:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lbroudoux/035ccc4d7b7cdd414f0ebc5a53e80c4c to your computer and use it in GitHub Desktop.
Save lbroudoux/035ccc4d7b7cdd414f0ebc5a53e80c4c to your computer and use it in GitHub Desktop.
CloudEvent AsyncAPI structured sample #yaml
asyncapi: '2.0.0'
id: 'urn:io.microcks.example.user-signedup'
info:
title: User signed-up CloudEvents API structured
version: 0.1.3
defaultContentType: application/json
channels:
user/signedup:
subscribe:
message:
bindings:
kafka:
key:
type: string
description: Timestamp of event as milliseconds since 1st Jan 1970
headers:
type: object
properties:
custom-header:
type: string
content-type:
type: string
enum:
- 'application/cloudevents+json; charset=UTF-8'
payload:
$ref: '#/components/schemas/userSignedUpPayload'
examples: [...]
components:
schemas:
userSignedUpPayload:
type: object
allOf:
- $ref: 'https://raw.githubusercontent.com/cloudevents/spec/v1.0.1/spec.json'
properties:
data:
$ref: '#/components/schemas/userSignedUpData'
userSignedUpData:
type: object
properties:
fullName:
type: string
email:
type: string
format: email
age:
type: integer
minimum: 18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment