aboutsummaryrefslogtreecommitdiff
path: root/tests/qapi-schema/flat-union-base-union.json
blob: c63c6130b8f2b0f3f5dc62837a13008b8429b0a6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# 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.

##
# @TestEnum:
##
{ 'enum': 'TestEnum',
  'data': [ 'value1', 'value2' ] }
##
# @TestTypeA:
##
{ 'struct': 'TestTypeA',
  'data': { 'string': 'str' } }
##
# @TestTypeB:
##
{ 'struct': 'TestTypeB',
  'data': { 'integer': 'int' } }
##
# @UnionBase:
##
{ 'union': 'UnionBase',
  'data': { 'kind1': 'TestTypeA',
            'kind2': 'TestTypeB' } }
##
# @TestUnion:
##
{ 'union': 'TestUnion',
  'base': 'UnionBase',
  'discriminator': 'type',
  'data': { 'kind1': 'TestTypeA',
            'kind2': 'TestTypeB' } }