-
-
Notifications
You must be signed in to change notification settings - Fork 280
/
oneof.yml
46 lines (42 loc) · 1.01 KB
/
oneof.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
asyncapi: '2.6.0'
info:
title: OneOf example
version: '1.0.0'
channels:
test:
publish:
message:
$ref: '#/components/messages/testMessages'
test2:
subscribe:
message:
# Use oneOf here if different messages are published on test2 topic.
oneOf:
- payload:
$ref: "#/components/schemas/objectWithKey"
- payload:
$ref: "#/components/schemas/objectWithKey2"
components:
messages:
testMessages:
payload:
oneOf: # oneOf in payload schema
- $ref: "#/components/schemas/objectWithKey"
- $ref: "#/components/schemas/objectWithKey2"
testMessage1:
payload:
$ref: "#/components/schemas/objectWithKey"
testMessage2:
payload:
$ref: "#/components/schemas/objectWithKey2"
schemas:
objectWithKey:
type: object
properties:
key:
type: string
objectWithKey2:
type: object
properties:
key2:
type: string