-
Notifications
You must be signed in to change notification settings - Fork 1
/
asyncapi-example.yml
179 lines (173 loc) · 4.25 KB
/
asyncapi-example.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
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
169
170
171
172
173
174
175
176
177
178
179
asyncapi: "2.6.0"
id: "https://github.com/nickshoe/asyncapi-php-template/"
info:
title: Example App
version: "0.1.0"
description: |
An example app to demonstrate the usage of asyncapi-php-template AsyncAPI generator template.
contact:
name: Nicolò Scarpa
url: https://github.com/nickshoe
email: nicolo.scarpa@gmail.com
license:
name: Apache 2.0
url: https://www.apache.org/licenses/LICENSE-2.0.html
servers:
rabbitmq-development:
url: localhost:5672
protocol: amqp
protocolVersion: '0.9.1'
security:
- user-password: []
kafka-development:
url: localhost:9092
protocol: kafka
protocolVersion: '1.0.0'
defaultContentType: application/json
channels:
events:
description: This is the main channel where all application events are published.
publish:
summary: Publish a Domain Event on the channel.
operationId: publishDomainEvent
message:
messageId: PublishDomainEventMessage
name: PublishDomainEventMessage
payload:
$ref: "#/components/schemas/DomainEvent"
subscribe:
summary: Subscribe to Domain Events published on the channel.
operationId: onDomainEvent
message:
messageId: OnDomainEventMessage
name: OnDomainEventMessage
payload:
$ref: "#/components/schemas/DomainEvent"
users/{userId}/notifications:
description: The channel on which notifications for a specific user are published.
parameters:
userId:
description: The id of the user.
schema:
type: string
examples:
- '123'
subscribe:
operationId: onUserNotification
message:
payload:
$ref: "#/components/schemas/Notification"
components:
securitySchemes:
user-password:
type: userPassword
schemas:
DomainEvent:
type: object
discriminator: _type
required:
- _type
- id
- createdAt
properties:
_type:
type: string
readOnly: true
id:
type: string
readOnly: true
createdAt:
type: string
format: date-time
example: '2012-04-23T18:25:43.511Z'
readOnly: true
UserPasswordResetEvent:
description: A user password reset event.
allOf:
- $ref: "#/components/schemas/DomainEvent"
- type: object
required:
- user
- tempPassword
properties:
user:
$ref: "#/components/schemas/User"
tempPassword:
type: string
UserLoginEvent:
description: A user login event.
allOf:
- $ref: "#/components/schemas/DomainEvent"
- type: object
required:
- user
properties:
user:
$ref: "#/components/schemas/User"
User:
type: object
required:
- id
- firstName
- lastName
- email
properties:
id:
type: integer
firstName:
type: string
lastName:
type: string
email:
type: string
format: email
dateOfBirth:
type: string
format: date
DataTypes:
type: object
properties:
double:
type: number
format: double
float:
type: number
format: float
integer:
type: integer
format: int32
long:
type: integer
format: int64
Notification:
type: object
discriminator: _type
required:
- _type
- id
- createdAt
- status
properties:
_type:
type: string
readOnly: true
id:
type: string
readOnly: true
createdAt:
type: string
format: date-time
example: '2012-04-23T18:25:43.511Z'
readOnly: true
status:
type: string
enum:
- NEW
- DELIVERED
- SEEN
- READ
- ARCHIVED
PasswordResetRequestedNotification:
description: Somebody has requested the password reset.
allOf:
- $ref: "#/components/schemas/Notification"