Skip to content

Instantly share code, notes, and snippets.

@robece
Last active January 25, 2023 22:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save robece/0ce1fb7e0eccc903be3b35cd263faeaa to your computer and use it in GitHub Desktop.
Save robece/0ce1fb7e0eccc903be3b35cd263faeaa to your computer and use it in GitHub Desktop.
asyncapi: 2.5.0
info:
title: Age of Empires App
version: 1.0.0
description: >
Purpose of this app is to have some fun with AsyncAPI and WebSocket and
define an interface for Age of Empires.
![](https://media.tenor.com/ObS8YPbzWb0AAAAd/kipchak-age-of-empires.gif)
You can use this API to chat with the Age of Empires bot or to get updates about
the game.
servers:
swamp:
url: localhost
protocol: ws
channels:
/chat:
subscribe:
summary: Client can receive chat messages.
operationId: subChatMessage
message:
$ref: '#/components/messages/chatMessage'
publish:
summary: Client can send chat messages.
operationId: pubChatMessage
message:
$ref: '#/components/messages/chatMessage'
/game/status:
subscribe:
summary: Client can receive game info status.
operationId: subGameInfo
message:
$ref: '#/components/messages/gameInfo'
components:
messages:
chatMessage:
summary: Message that you send or receive from chat
payload:
type: string
gameInfo:
summary: Message that contains information about game status.
examples:
- payload:
battle: Greeks vs Persians
winning: Greeks
nextBattle: Romans vs Yamato
payload:
type: object
properties:
battle:
description: Who is in battle?.
type: string
winning:
description: Who is winning the battle.
type: string
nextBattle:
description: Who are the next players.
type: string
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment