Redesigned AsyncAPI pages
- Messages are labelled Receive and Send for readers, instead of the
sendandreceiveof the documented application, the sidebar shows them as icons. - A connection bar shows the channel address with the server below it, brokers label the address as a topic, queue or subject.
- Messages are listed in an accordion, their examples beside the payload and headers on wide pages.
- Example cards are titled with the name and summary of examples, selects switch to other examples and to their headers.
- Protocol details only show the bindings of the selected server,
x-*bindings are hidden. - A playground connects to channels, sends messages from their examples and identifies the received ones.
- The playground edits address parameters in its URL and previews the URL to connect.
- Code samples beside operations in JavaScript and Python for WebSocket, MQTT, Kafka, AMQP and NATS servers, and from
x-codeSamplesof operations. - Playground transports connect by protocol: WebSocket is built in,
sseTransportreceives Server-Sent Events. - The playground sends text, hex and Base64 messages, and previews binary ones in hex.
- Security schemes show OAuth 2.0 flows, scopes and SASL mechanisms.
- Avro, Protobuf and RAML schemas are shown as they are.
Fixes
- Later traits override earlier ones, as the spec merges them in order.
defaultContentTypeapplies to messages withoutcontentType.per: 'tag'matches tags by name, operations without tags are underunknown.groupBy: 'channel'names folders by channel keys and files by operation ids.- Channels with empty
serversare available on all servers. - Operations sharing a title on one page get unique anchors.
- AsyncAPI 2 documents throw an error instead of generating no pages.
imports: []no longer adds an empty line to generated files.- Operations show the description of their channel, it is in search and Markdown too.
readOnlyproperties are hidden from messages readers send andwriteOnlyones from messages they receive, in schemas, TypeScript types and generated examples, instead of both from all messages.
API changes
| Before | Now |
|---|---|
slots.server and slots.channel of renderOperationLayout
| slots.connection
|
content.renderAPIExampleUsageTabs
| removed, examples are in messages |
useOperationSecurity() returns schemes of operation or server
| { server, operation }, both apply
|
payload and headers of OperationMessage are schemas
| { schema, schemaFormat? }
|
OperationReply.messages have title and payload
| OperationMessage[]
|
action prop of <Operation /> and <OperationProvider />
| removed, read from the operation |
preloaded.proxyUrl of AsyncAPIPageProps_Preloaded
| removed, it was never used |
meta.groupStyle of generateFiles()
| removed, use folderStyle
|
- Added the
playgroundoption ofcreateAsyncAPIPage()withtransports, andusePlayground(),usePlaygroundTransport()andsseTransportfrom@fumadocs/asyncapi/playground. - Added the
generateTypeScriptDefinitionsoption, payloads and headers can be copied as TypeScript types. - Added the
codeUsagesoption andslots.usageofrenderOperationLayout, withcreateCodeUsageGeneratorRegistry()andregisterDefaultCodeUsages()from@fumadocs/asyncapi/ui. - Added
getText()to the data of AsyncAPI pages, their operations in Markdown for LLMs. - Added
receivedtoOperationMessage, whether readers receive the message.