The AsyncAPI specification defines fields for describing an application's API in an AsyncAPI document. While the document may reference other files for details or shared fields, it typically serves as a single, primary document that encapsulates the API description.
The AsyncAPI document is a communication contract between senders and receivers within an event-driven system. It specifies the payload content required for a service to send a message and provides the receiver with guidance about 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
Depending on the protocol (such as MQTT, AMQP, Kafka), your AsyncAPI document may have additional fields. For example, for configuring Kafka bindings.