xref: /qemu/tests/qapi-schema/union-bad-discriminator.json (revision 8b3b3a16dfca57b7c4e7b8af215aec96880153d7)
144bd1276SEric Blake# we require the discriminator to be a string naming a base-type member
2ab916fadSEric Blake# this tests the old syntax for anonymous unions before we added alternates
33d0c4829SEric Blake{ 'enum': 'TestEnum',
43d0c4829SEric Blake  'data': [ 'value1', 'value2' ] }
5*895a2a80SEric Blake{ 'struct': 'TestBase',
63d0c4829SEric Blake  'data': { 'enum1': 'TestEnum', 'kind': 'str' } }
7*895a2a80SEric Blake{ 'struct': 'TestTypeA',
83d0c4829SEric Blake  'data': { 'string': 'str' } }
9*895a2a80SEric Blake{ 'struct': 'TestTypeB',
103d0c4829SEric Blake  'data': { 'integer': 'int' } }
113d0c4829SEric Blake{ 'union': 'TestUnion',
123d0c4829SEric Blake  'base': 'TestBase',
13ab916fadSEric Blake  'discriminator': {},
143d0c4829SEric Blake  'data': { 'kind1': 'TestTypeA',
153d0c4829SEric Blake            'kind2': 'TestTypeB' } }
16