-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathasyncapi.yaml
169 lines (158 loc) · 3.88 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
asyncapi: '2.4.0'
info:
title: Random Jokes RabbitMQ API
version: '1.0.0'
description: |
The random jokes API allows you to get a random joke asynchronously.
### Check out its awesome features:
* Feature 1
* Feature 2
license:
name: Apache 2.0
url: https://www.apache.org/licenses/LICENSE-2.0
servers:
localhost:
url: localhost:5672
protocol: amqp
protocolVersion: "0.9.1"
description: Test broker
security:
- user-password: []
defaultContentType: application/json
channels:
joke-request:
description: The channel on which the random jokes app will receive requests.
parameters:
streetlightId:
$ref: '#/components/parameters/streetlightId'
publish:
summary: Inform about environmental lighting conditions of a particular streetlight.
operationId: receiveJokeRequest
message:
$ref: '#/components/messages/jokeRequest'
joke-response:
description: The channel on which the random jokes app will send response.
parameters:
streetlightId:
$ref: '#/components/parameters/streetlightId'
subscribe:
summary: Sends joke JSON object response.
operationId: sendJokeResponse
message:
$ref: '#/components/messages/jokeResponse'
components:
messages:
jokeRequest:
name: jokeRequest
title: Joke Request
summary: Parameters/options of the joke request
contentType: application/json
payload:
$ref: "#/components/schemas/jokeRequestPayload"
jokeResponse:
name: jokeResponse
title: Joke Response
summary: Joke response object
contentType: application/json
payload:
$ref: "#/components/schemas/jokeResponsePayload"
schemas:
jokeRequestPayload:
type: object
properties:
format:
type: string
pattern: "^(txt|yaml|json|xml)$"
default: json
description: Format of the return type.
lang:
type: string
pattern: "^(en|de)$"
default: en
description: Language of the joke.
categories:
type: array
items:
type: string
enum:
- programming
- miscellaneous
- dark
- pun
- spooky
- christmas
jokeResponsePayload:
type: object
properties:
Error:
type: boolean
Category:
type: string
Type:
type: string
Joke:
type: string
Flags:
type: object
properties:
nsfw:
type: boolean
religious:
type: boolean
political:
type: boolean
racist:
type: boolean
sexist:
type: boolean
explicit:
type: boolean
required:
- nsfw
- religious
- political
- racist
- sexist
- explicit
Id:
type: integer
Safe:
type: boolean
Lang:
type: string
worker:
type: string
jokeString:
type: string
jokeSource:
type: string
required:
- Error
- Category
- Type
- Joke
- Flags
- Id
- Safe
- Lang
- worker
- jokeString
- jokeSource
securitySchemes:
user-password:
type: userPassword
description: Provide your username and password for authentication
parameters:
streetlightId:
description: The ID of the streetlight.
schema:
type: string
messageTraits:
commonHeaders:
headers:
type: object
properties:
my-app-header:
type: integer
minimum: 0
maximum: 100