summaryrefslogblamecommitdiffstats
path: root/tests/qapi-schema/union-optional-discriminator.json
blob: 2e7f766f60aa4a516383d4bc22bba5a13b5f43eb (plain) (tree)
1
2
3
4
5
6
7
8
9
10
                                                 
                                            
                   
                                 
                                                 

                     
                            

                               
# we require the discriminator to be non-optional
{ 'enum': 'Enum', 'data': [ 'one', 'two' ] }
{ 'struct': 'Base',
  'data': { '*switch': 'Enum' } }
{ 'struct': 'Branch', 'data': { 'name': 'str' } }
{ 'union': 'MyUnion',
  'base': 'Base',
  'discriminator': 'switch',
  'data': { 'one': 'Branch',
            'two': 'Branch' } }