-
-
Notifications
You must be signed in to change notification settings - Fork 638
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: re-add
AsyncAPI Documents
and change code snippet (#2274)
Co-authored-by: Alejandra Quetzalli <[email protected]>
- Loading branch information
1 parent
4b238aa
commit c913ca4
Showing
1 changed file
with
46 additions
and
0 deletions.
There are no files selected for viewing
46 changes: 46 additions & 0 deletions
46
pages/docs/tutorials/getting-started/asyncapi-documents.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |