aboutsummaryrefslogtreecommitdiff
path: root/tests/qapi-schema/flat-union-optional-discriminator.json
blob: 143ab23a0d6058ec62b723212a9c64accad8cc47 (plain)
1
2
3
4
5
6
7
8
9
10
11
# we require the discriminator to be non-optional
# FIXME reports "discriminator 'switch' is not a member of base struct 'Base'"
{ 'enum': 'Enum', 'data': [ 'one', 'two' ] }
{ 'struct': 'Base',
  'data': { '*switch': 'Enum' } }
{ 'struct': 'Branch', 'data': { 'name': 'str' } }
{ 'union': 'MyUnion',
  'base': 'Base',
  'discriminator': 'switch',
  'data': { 'one': 'Branch',
            'two': 'Branch' } }