summaryrefslogtreecommitdiffstats
path: root/qemu/tests/qapi-schema/flat-union-optional-discriminator.json
blob: 08a8f7ef8bcbe76e566387ab0a0cab5136d4efed (plain)
1
2
3
4
5
6
7
8
9
10
# we require the discriminator to be non-optional
{ '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' } }