Introduction

Found an error? Have a suggestion?Edit this page on GitHub

The AsyncAPI Specification defines a set of fields that can be used in an AsyncAPI document to describe an application's API. The document may reference other files for additional details or shared fields, but it is typically a single, primary document that encapsulates the API description.

Furthermore, the AsyncAPI document acts as a communication contract between receivers and senders within an event-driven system. It specifies the payload content required when a service sends a message and offers clear guidance to the receiver regarding the message's properties.

1asyncapi: 3.0.0
2info:
3  title: Cool Example
4  version: 0.1.0
5channels:
6  userSignedUp:
7    address: user/signedup
8    messages:
9      userSignedUp:
10        description: An event describing that a user just signed up.
11        payload:
12          type: object
13          properties:
14            fullName:
15              type: string
16            email:
17              type: string
18              format: email
19            age:
20              type: integer
21              minimum: 18
22operations: 
23  userSignedUp:
24    action: send
25    channel: 
26      $ref: '#/channels/userSignedUp'
Remember

You might have additional fields depending on the implemented protocol (i.e., MQTT, AMQP, Kafka, etc.).

For example, your AsyncAPI document could have additional fields for configuring Kafka bindings.

Was this helpful?
Help us improve the docs by adding your contribution.
OR
Github:AsyncAPICreate Issue on GitHub