summaryrefslogtreecommitdiffstats
path: root/tests/qapi-schema/union-base-union.json
blob: 82d4c96e5701e6595653c44f108bd6bddf0ab3c8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# For now, we require the base to be a struct without variants
# TODO: It would be possible to allow a union as a base, as long as all
# permutations of QMP names exposed by base do not clash with any QMP
# member names added by local variants.
{ 'enum': 'TestEnum',
  'data': [ 'value1', 'value2' ] }
{ 'struct': 'TestTypeA',
  'data': { 'string': 'str' } }
{ 'struct': 'TestTypeB',
  'data': { 'integer': 'int' } }
{ 'enum': 'Enum', 'data': [ 'kind1', 'kind2' ] }
{ 'union': 'UnionBase',
  'base': { 'type': 'Enum' },
  'discriminator': 'type',
  'data': { 'kind1': 'TestTypeA',
            'kind2': 'TestTypeB' } }
{ 'union': 'TestUnion',
  'base': 'UnionBase',
  'discriminator': 'type',
  'data': { 'kind1': 'TestTypeA',
            'kind2': 'TestTypeB' } }