-
Notifications
You must be signed in to change notification settings - Fork 1
/
asyncapi.yaml
72 lines (67 loc) · 1.91 KB
/
asyncapi.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
asyncapi: 2.0.0
#
# Overal information for users of the application
#
info:
title: Shrek App
version: '1.0.0'
description: |
Purpose of this app is to have some fun with AsyncAPI and WebSocket and define an interface for ... Shrek.
![](https://media.giphy.com/media/10Ug6rDDuG3YoU/giphy-downsized.gif)
You can use this API to chat with Shrek bot or to get updates about artifical travels to different locations.
#
# Details on how to connect to the application
#
servers:
swamp:
url: localhost
protocol: ws
#
# Details about all the channels that you can listen to or send to messages
#
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'
/travel/status:
subscribe:
summary: Client can receive travel info status.
operationId: subTravelInfo
message:
$ref: '#/components/messages/travelInfo'
#
# All reusable parts for readability and staying DRY
#
components:
messages:
chatMessage:
summary: Message that you send or receive from chat
payload:
type: string
travelInfo:
summary: Message that contains information about travel status.
examples:
- payload:
destination: Far far away
distance: Beyond the seven mountains and seven forests
arrival: Pretty soon
payload:
type: object
properties:
destination:
description: Name of travel destination.
type: string
distance:
description: How much distance left to the target.
type: string
arrival:
description: Time left to get there.
type: string