Skip to content

Commit

Permalink
docs: re-add AsyncAPI Documents and change code snippet (#2274)
Browse files Browse the repository at this point in the history
Co-authored-by: Alejandra Quetzalli <[email protected]>
  • Loading branch information
AnimeshKumar923 and quetzalliwrites authored Nov 11, 2023
1 parent 4b238aa commit c913ca4
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions pages/docs/tutorials/getting-started/asyncapi-documents.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
title: "AsyncAPI documents"
date: 2019-04-01T10:56:52+01:00
menu:
docs:
parent: 'getting-started'
weight: 101
---

An AsyncAPI document is a file that defines and annotates the different components of **a specific Event-Driven API**.

The file format must be JSON or YAML; however, only the subset of YAML that matches the JSON capabilities is allowed.

<CodeBlock>
{`asyncapi: 3.0.0
info:
title: Example application
version: '0.1.0'
channels:
userSignup:
address: 'user/signedup'
messages:
userSignedupMessage:
description: A message describing that a user just signed up.
payload:
type: object
additionalProperties: false
properties:
fullName:
type: string
email:
type: string
format: email
age:
type: integer
minimum: 18
operations:
publishUserSignedup:
action: 'send'
channel:
$ref: '#/channels/userSignup'`}
</CodeBlock>

The AsyncAPI document is a machine-readable definition of your Event-Driven API. That document can be used afterward to generate documentation and code, validate the messages that `Example application` sends, and even apply API management policies to your messages before they arrive at the broker.

Your API documentation is now machine-readable (easily parseable by code) so the myriad of useful applications is endless.

0 comments on commit c913ca4

Please sign in to comment.