-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathasyncapi.yml
80 lines (78 loc) · 2.29 KB
/
asyncapi.yml
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
73
74
75
76
77
78
79
80
asyncapi: 2.4.0
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.
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'
/travel/status:
subscribe:
summary: Client can receive travel info status.
operationId: subTravelInfo
message:
$ref: '#/components/messages/travelInfo'
bindings:
ws:
bindingVersion: 0.1.0
query:
type: object
description: |
You can specify to receive travel status info from specific location
properties:
destination:
type: string
description: Airport code
enum:
- BCN
- KTW
- LCY
components:
messages:
chatMessage:
summary: Message that you send or receive from chat
payload:
type: string
x-response:
description: Location of the information about where reply should be sent to
location: "$message.payload#/replyTo"
travelInfo:
summary: Message that contains information about travel status.
payload:
$ref: "#/components/schemas/travelData"
examples:
- payload:
destination: Far far away
distance: Beyond the seven mountains and seven forests
arrival: Pretty soon
schemas: # payload
travelData:
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