summaryrefslogtreecommitdiffstats
path: root/tests/qapi-schema/union-bad-discriminator.json
blob: cd10b9d901823cc53e28d40864508ccaafb9606a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# we require the discriminator to be a string naming a base-type member
# this tests the old syntax for anonymous unions before we added alternates
{ 'enum': 'TestEnum',
  'data': [ 'value1', 'value2' ] }
{ 'struct': 'TestBase',
  'data': { 'enum1': 'TestEnum', 'kind': 'str' } }
{ 'struct': 'TestTypeA',
  'data': { 'string': 'str' } }
{ 'struct': 'TestTypeB',
  'data': { 'integer': 'int' } }
{ 'union': 'TestUnion',
  'base': 'TestBase',
  'discriminator': {},
  'data': { 'kind1': 'TestTypeA',
            'kind2': 'TestTypeB' } }