Files
Kathryn Isabelle Lawrence 4ec6818121 Asyncapi Docs (#629)
* add page about asyncapi setup

* add playground page

* update docs

* add single channel page docs

* delete unneeded paragraph

* add local+remote

* Update api-playground/asyncapi/setup.mdx

Co-authored-by: Hahnbee Lee <55263191+hahnbeelee@users.noreply.github.com>

* add asyncapi playground

---------

Co-authored-by: Hahnbee Lee <55263191+hahnbeelee@users.noreply.github.com>
2025-04-11 09:05:05 -07:00

80 lines
2.1 KiB
YAML

asyncapi: 3.0.0
info:
title: Test websocket schema
version: 1.0.0
description: This is a test websocket API.
channels:
channelOne:
title: Test channel
description: >-
This is a websocket channel.
It can have _markdown_ in the description.
* Use the "echo-websocket.hoppscotch.io" server to receive timestamped messages every second.
* Use the "echo.websocket.org" server to send test messages to the websocket. This server will echo back any messages you send to it.
address: /
messages:
TestMessage:
$ref: '#/components/messages/TestMessage'
Timestamp:
$ref: '#/components/messages/Timestamp'
servers:
echo-websocket:
host: echo-websocket.hoppscotch.io
protocol: wss
echo:
host: echo.websocket.org
protocol: wss
operations:
sendTestMessage:
action: receive
channel:
$ref: '#/channels/channelOne'
messages:
- $ref: '#/channels/channelOne/messages/TestMessage'
receiveTestMessage:
action: send
channel:
$ref: '#/channels/channelOne'
messages:
- $ref: '#/channels/channelOne/messages/TestMessage'
receiveTimestamp:
action: send
channel:
$ref: '#/channels/channelOne'
messages:
- $ref: '#/channels/channelOne/messages/Timestamp'
components:
messages:
TestMessage:
title: Test message
description: Test message sent to the echo server
payload:
type: object
properties:
text:
type: string
description: The text of your message
subtext:
type: string
description: Optional second message field
from:
type: string
description: The name of the sender
required:
- text
Timestamp:
title: Timestamp
description: Timestamp message sent from echo hoppscotch server
payload:
schema:
$ref: '#/components/schemas/Timestamp'
schemas:
Timestamp:
type: string
description: Timestamp message sent from echo hoppscotch server
examples:
- '22:02:27 GMT+0000 (Coordinated Universal Time)'