Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions api-playground/asyncapi/playground.mdx
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this page doesnt seem necessary IMO - were u gonna make it have an example websocket playground?

Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
title: "Websockets Playground"
description: "Enable users to interact with your websockets"
---

Autogenerating pages from your AsyncAPI schema will create pages for each channel that display message data that can be sent and received. In the API Playground for websockets, you can connect to websocket servers to send and receive messages.

Check warning on line 6 in api-playground/asyncapi/playground.mdx

View check run for this annotation

Mintlify / Mintlify Validation - vale-spellcheck

api-playground/asyncapi/playground.mdx#L6

Did you really mean 'Autogenerating'?

![](https://picsum.photos/600/400)
(this should be a nice image of messages in the API playground)

The API Playground for websockets is enabled by default, but automatically disabled if security schemes are required in the schema. Learn more about playground settings [here](settings/global#param-playground).
49 changes: 49 additions & 0 deletions api-playground/asyncapi/setup.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
---
title: "AsyncAPI Setup"
description: "Reference AsyncAPI endpoints in your docs pages"
---

## Add an AsyncAPI specification file

To begin to create pages for your websockets, make sure you have a valid AsyncAPI schema document in either JSON or YAML format that follows the [AsyncAPI specification](https://www.asyncapi.com/docs/reference/specification/v3.0.0). Your schema must follow AsyncAPI specification 3.0+.
<Tip>To make sure your AsyncAPI schema is valid, you can paste it into the [AsyncAPI Studio](https://studio.asyncapi.com/)</Tip>

## Auto-populate websockets pages

You can add an `asyncapi` field to any tab or group in the navigation of your `docs.json`. This field can contain either the path to an AsyncAPI schema document in your docs repo, the URL of a hosted AsyncAPI schema document, or an array of links to AsyncAPI schema documents. Mintlify will automatically generate a page for each AsyncAPI websocket channel.

**Examples with Tabs:**
```json {5}
"navigation": {
"tabs": [
{
"tab": "API Reference",
"asyncapi": "https://github.com/asyncapi/spec/blob/master/examples/simple-asyncapi.yml"
}
]
}
```

**Examples with Groups:**
```json {8-11}
"navigation": {
"tabs": [
{
"tab": "AsyncAPI",
"groups": [
{
"group": "Websockets",
"asyncapi": {
"source": "/path/to/asyncapi.json",
"directory": "api-reference"
}
}
]
}
]
}
```

<Note>The directory field is optional. If not specified, the files will be placed in the **api-reference** folder of the docs repo.</Note>

The metadata for the generated pages will contain the key `asyncapi` with a path to the original spec and the channel id so that the page can be generated per channel and display data about all websocket messages sent and received on that channel. Learn more about interacting with websockets with generated AsyncAPI pages in the playground [here](api-playground/asyncapi/playground).
9 changes: 9 additions & 0 deletions docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,15 @@
"api-playground/openapi/advanced-features"
]
},
{
"group": "AsyncAPI",
"icon": "brackets-curly",
"pages": [
"api-playground/asyncapi/setup",
"api-playground/asyncapi/playground"
]

},
{
"group": "MDX",
"icon": "markdown",
Expand Down