aboutsummaryrefslogtreecommitdiff
path: root/tests/qapi-schema/flat-union-optional-discriminator.json
blob: 9f19af5789a5ac831f6e520df76e30960dda6832 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# we require the discriminator to be non-optional

##
# @Enum:
##
{ 'enum': 'Enum', 'data': [ 'one', 'two' ] }
##
# @Base:
##
{ 'struct': 'Base',
  'data': { '*switch': 'Enum' } }
##
# @Branch:
##
{ 'struct': 'Branch', 'data': { 'name': 'str' } }
##
# @MyUnion:
##
{ 'union': 'MyUnion',
  'base': 'Base',
  'discriminator': '*switch',
  'data': { 'one': 'Branch',
            'two': 'Branch' } }