Playground: Live WebSocket Execution via Plugin Architecture
The Playground is a powerful interactive surface for exploring AsyncAPI specs, but currently lacks the ability to execute or simulate operations. With the new plugin architecture now available in the React component, we can expose hooks that allow tooling to wire in live WebSocket connections for testing subscribe/publish/send/receive operations directly from the rendered spec.
WebSocket is proposed as the first protocol target (rather than HTTP/Webhook) because its persistent, bidirectional, event-driven nature maps much more naturally onto AsyncAPI's async operation model than a synchronous request/response protocol does.
Proposed Behavior
- Users can open a live WebSocket connection directly from the rendered spec UI to test
subscribe/publish/send/receive operations.
- The Playground ships with a built-in default WebSocket plugin that supports:
- Connecting to a server using the operation's WS/WSS bindings.
- Sending messages for
publish/send operations, constructed from the spec-defined schema.
- Receiving and streaming incoming messages live for
subscribe/receive operations.
- Disconnecting cleanly, with automatic cleanup on unmount/navigation.
Acceptance Criteria
Notes
- Out of scope (for this issue): auto-reconnect with backoff, message history persistence across page reloads, and non-WS async protocols (MQTT, AMQP, Kafka), those can be tracked as follow-ups once the plugin pattern is validated here.
- This is a stateful/streaming interaction model, distinct from the request/response model of HTTP plugins, expect the plugin architecture itself to need lifecycle hooks (
onOpen, onMessage, onClose, onError) rather than a single call/response hook.
Playground: Live WebSocket Execution via Plugin Architecture
The Playground is a powerful interactive surface for exploring AsyncAPI specs, but currently lacks the ability to execute or simulate operations. With the new plugin architecture now available in the React component, we can expose hooks that allow tooling to wire in live WebSocket connections for testing
subscribe/publish/send/receiveoperations directly from the rendered spec.WebSocket is proposed as the first protocol target (rather than HTTP/Webhook) because its persistent, bidirectional, event-driven nature maps much more naturally onto AsyncAPI's async operation model than a synchronous request/response protocol does.
Proposed Behavior
subscribe/publish/send/receiveoperations.publish/sendoperations, constructed from the spec-defined schema.subscribe/receiveoperations.Acceptance Criteria
ws/wssprotocol bindingsNotes
onOpen,onMessage,onClose,onError) rather than a single call/response hook.