AsyncAPI elements
The elements of AsyncAPI 3.0 and 3.1 documents. <apg-api-reference> picks them by itself, and
<apg-nav>, <apg-schema> and the building blocks
serve AsyncAPI documents as well.
AsyncAPI documents, as text or as values, are read by the asyncapi WebAssembly module
(asyncapi.web.mjs and asyncapi.web.wasm): give its URL with asyncapi-wasm-url on
<apg-spec> or <apg-api-reference>, or to every element with configureAsyncApiEngine(url). The
module follows references, applies traits and the specification’s defaults, and reports problems,
which are listed with their positions. Without the module, AsyncAPI documents fail to load. The
documentation model ({"apigenieAsyncAPI": 1, …}) can be given instead and needs no module.
<apg-spec spec-url="/asyncapi.yaml" asyncapi-wasm-url="/wasm/asyncapi.web.mjs">
<apg-asyncapi-overview></apg-asyncapi-overview>
<apg-asyncapi-operation name="receiveLightMeasurement"></apg-asyncapi-operation>
<apg-asyncapi-message name="lightMeasured"></apg-asyncapi-message>
</apg-spec>
Operations, channels and messages are selected with name (messages by their name in
components.messages) or pointer.
<apg-asyncapi-overview>
Title, version, description, contact, license, tags and external documentation of an AsyncAPI
3 document, with its id and default content type.
Loaded on its own with import "@mykulyak/apigenie-docs/components/apg-asyncapi-overview";.
Attributes
| Attribute | Property | Type | Default | Description |
|---|---|---|---|---|
heading-level |
headingLevel |
number |
1 |
Level of the title heading (1–6). |
And spec-url, spec, api and theme, like every element that shows a document: Where the document comes from.
CSS parts
| Part | Description |
|---|---|
overview |
The container. |
title |
The API title (h1 unless heading-level says otherwise). |
version |
Version badges. |
info |
Contact, license and terms line. |
link |
Links in the info line. |
badge |
Tag chips. |
Forwarded from the elements inside it:
<apg-markdown>:markdown
<apg-asyncapi-servers>
The servers of an AsyncAPI document (or the one named by server): protocol, URL, variables,
security, the channels available on it and its bindings.
Loaded on its own with import "@mykulyak/apigenie-docs/components/apg-asyncapi-servers";.
Attributes
| Attribute | Property | Type | Default | Description |
|---|---|---|---|---|
server |
server |
string |
Show only this server (its key). |
And spec-url, spec, api and theme, like every element that shows a document: Where the document comes from.
CSS parts
| Part | Description |
|---|---|
servers |
The container. |
server |
One server. |
server-name |
Its key. |
protocol |
The protocol and its version. |
url |
The URL. |
label |
Field labels. |
table |
The variables table. |
channel-link |
Links to the channels on the server. |
badge |
Tag chips. |
link |
External documentation links. |
Forwarded from the elements inside it:
<apg-markdown>:markdown<apg-asyncapi-bindings>:bindings,binding,binding-protocol<apg-code-block>:code-block,code,copy-button
<apg-asyncapi-security>
The security schemes of an AsyncAPI document (components.securitySchemes): type, what it asks
for, where API keys go, OAuth 2.0 flows with their URLs and scopes, OpenID Connect discovery.
Loaded on its own with import "@mykulyak/apigenie-docs/components/apg-asyncapi-security";.
Attributes
Only spec-url, spec, api and theme, like every element that shows a document: Where the document comes from.
CSS parts
| Part | Description |
|---|---|
security |
The container. |
scheme |
One security scheme. |
scheme-name |
Its name. |
table |
Flow tables. |
Forwarded from the elements inside it:
<apg-markdown>:markdown
<apg-asyncapi-operation>
One operation of an AsyncAPI document: its action (send or receive), channel and address, the messages with their headers, payloads and examples, the reply of request/reply operations, security, traits and bindings.
Loaded on its own with import "@mykulyak/apigenie-docs/components/apg-asyncapi-operation";.
Attributes
| Attribute | Property | Type | Default | Description |
|---|---|---|---|---|
pointer |
pointer |
string |
The operation by id (#/operations/<key>). |
|
name |
name |
string |
The operation by key. | |
heading-level |
headingLevel |
number |
2 |
Level of the title heading. |
lazy |
lazy |
boolean |
false |
Render only the header until the operation comes near the viewport (used for long pages; the full content is always rendered on the server). |
And spec-url, spec, api and theme, like every element that shows a document: Where the document comes from.
Methods
| Method | Description |
|---|---|
reveal() |
Renders the full content of a lazy operation. |
CSS parts
| Part | Description |
|---|---|
operation |
The container. |
header |
The header with the action, title and summary. |
title |
The title (the operation’s title, else its key). |
summary |
The summary line. |
address |
The channel’s address. |
badge |
Tag chips. |
section |
Sections (messages, reply, security). |
section-title |
Section headings. |
channel-link |
Links to channels. |
link |
External documentation links. |
Forwarded from the elements inside it:
<apg-method-badge>:method<apg-markdown>:markdown<apg-asyncapi-message>:message,content-type,select,operation-link<apg-schema>:schema,schema-row,property-name,type,required,toggle,ref-link,format-link,constraint,tab,tab-active<apg-code-block>:code-block,code,copy-button<apg-asyncapi-bindings>:bindings,binding,binding-protocol,table
<apg-asyncapi-channel>
One channel of an AsyncAPI document: its address with parameters, the servers it is on, its messages, the operations on it, and its bindings.
Loaded on its own with import "@mykulyak/apigenie-docs/components/apg-asyncapi-channel";.
Attributes
| Attribute | Property | Type | Default | Description |
|---|---|---|---|---|
pointer |
pointer |
string |
The channel by id (#/channels/<key>). |
|
name |
name |
string |
The channel by key. | |
heading-level |
headingLevel |
number |
2 |
Level of the title heading. |
And spec-url, spec, api and theme, like every element that shows a document: Where the document comes from.
CSS parts
| Part | Description |
|---|---|
channel |
The container. |
header |
The header. |
title |
The title (the channel’s title, else its key). |
address |
The address. |
summary |
The summary line. |
badge |
Tag chips. |
section |
Sections. |
section-title |
Section headings. |
table |
The parameters table. |
parameter-name |
Parameter names. |
message-link |
Links to messages. |
operation-link |
Links to operations. |
link |
External documentation links. |
Forwarded from the elements inside it:
<apg-markdown>:markdown<apg-method-badge>:method<apg-asyncapi-bindings>:bindings,binding,binding-protocol<apg-code-block>:code-block,code,copy-button
<apg-asyncapi-message>
One message of an AsyncAPI document: content type, headers and payload (schema trees, or the schema as written for formats such as Avro and Protobuf), examples, correlation ID, bindings, and the channels and operations using it.
Loaded on its own with import "@mykulyak/apigenie-docs/components/apg-asyncapi-message";.
Attributes
| Attribute | Property | Type | Default | Description |
|---|---|---|---|---|
pointer |
pointer |
string |
The message by pointer (#/components/messages/lightMeasured, or a channel’s own message). |
|
name |
name |
string |
The message by its key in components.messages. |
|
heading-level |
headingLevel |
number |
2 |
Level of the title heading. |
embedded |
embedded |
boolean |
false |
Shown inside an operation: framed, without the channels and operations using it. |
And spec-url, spec, api and theme, like every element that shows a document: Where the document comes from.
CSS parts
| Part | Description |
|---|---|
message |
The container. |
header |
The header with the title and badges. |
title |
The title. |
summary |
The summary line. |
badge |
Badges (deprecated, schema format) and tag chips. |
content-type |
The content type. |
section |
Sections (headers, payload, examples…). |
section-title |
Section headings. |
select |
The example picker. |
channel-link |
Links to channels. |
operation-link |
Links to operations. |
link |
External documentation links. |
Forwarded from the elements inside it:
<apg-markdown>:markdown<apg-schema>:schema,schema-row,property-name,type,required,toggle,ref-link,format-link,constraint,tab,tab-active<apg-code-block>:code-block,code,copy-button<apg-asyncapi-bindings>:bindings,binding,binding-protocol,table<apg-method-badge>:method
<apg-asyncapi-bindings>
The protocol bindings of an AsyncAPI server, channel, operation or message, given as the
bindings of their view: one block per protocol with its bindingVersion and fields. Plain
values are shown inline, objects (schemas, topic configuration) as JSON. Nothing is shown when
there are no bindings.
Loaded on its own with import "@mykulyak/apigenie-docs/components/apg-asyncapi-bindings";.
Attributes
| Attribute | Property | Type | Default | Description |
|---|---|---|---|---|
open |
open |
boolean |
false |
Start expanded. |
Properties
| Property | Type | Description |
|---|---|---|
bindings |
BindingView[] |
The bindings, from an AsyncAPI view (server.bindings, channel.bindings…). |
CSS parts
| Part | Description |
|---|---|
bindings |
The collapsible container. |
binding |
The bindings of one protocol. |
binding-protocol |
The protocol’s name. |
table |
The fields. |
Forwarded from the elements inside it:
<apg-code-block>:code-block,code,copy-button