Skip to content

Instantly share code, notes, and snippets.

@lbroudoux
Last active April 13, 2021 12:43
Show Gist options
  • Save lbroudoux/820c925b8ff84929ebf0c30ad1900c62 to your computer and use it in GitHub Desktop.
Save lbroudoux/820c925b8ff84929ebf0c30ad1900c62 to your computer and use it in GitHub Desktop.
CloudEvents Asyncapi example #yaml
asyncapi: '2.0.0'
id: 'urn:io.microcks.example.user-signedup'
info:
title: User signed-up CloudEvents API binary
version: 0.1.3
channels:
user/signedup:
subscribe:
message:
bindings:
kafka:
key:
type: string
description: Timestamp of event as milliseconds since 1st Jan 1970
traits:
- $ref: 'https://raw.githubusercontent.com/microcks/microcks-quickstarters/main/cloud/cloudevents/cloudevents-v1.0.1-asyncapi-trait.yml'
headers:
type: object
properties:
custom-header:
type: string
contentType: avro/binary
schemaFormat: application/vnd.apache.avro+json;version=1.9.0
payload:
$ref: './user-signedup.avsc#/User'
examples:
- john:
summary: Example for John Doe user
headers:
ce_specversion: "1.0"
ce_type: "io.microcks.example.user-signedup"
ce_source: "/mycontext/subcontext"
ce_id: "{{uuid()}}"
ce_time: "{{now(yyyy-MM-dd'T'HH:mm:SS'Z')}}"
content-type: application/avro
sentAt: "2020-03-11T08:03:38Z"
payload:
fullName: John Doe
email: john@microcks.io
age: 36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment