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