Statistics
| Branch: | Revision:

root / qapi-schema-test.json @ b9a7b74f

History | View | Annotate | Download (1.7 kB)

1 501e5104 Michael Roth
# *-*- Mode: Python -*-*
2 501e5104 Michael Roth
3 501e5104 Michael Roth
# for testing enums
4 501e5104 Michael Roth
{ 'enum': 'EnumOne',
5 501e5104 Michael Roth
  'data': [ 'value1', 'value2', 'value3' ] }
6 501e5104 Michael Roth
{ 'type': 'NestedEnumsOne',
7 501e5104 Michael Roth
  'data': { 'enum1': 'EnumOne', '*enum2': 'EnumOne', 'enum3': 'EnumOne', '*enum4': 'EnumOne' } }
8 501e5104 Michael Roth
9 501e5104 Michael Roth
# for testing nested structs
10 501e5104 Michael Roth
{ 'type': 'UserDefOne',
11 9e9eace8 Paolo Bonzini
  'data': { 'integer': 'int', 'string': 'str', '*enum1': 'EnumOne' } }
12 501e5104 Michael Roth
13 501e5104 Michael Roth
{ 'type': 'UserDefTwo',
14 501e5104 Michael Roth
  'data': { 'string': 'str',
15 501e5104 Michael Roth
            'dict': { 'string': 'str',
16 501e5104 Michael Roth
                      'dict': { 'userdef': 'UserDefOne', 'string': 'str' },
17 501e5104 Michael Roth
                      '*dict2': { 'userdef': 'UserDefOne', 'string': 'str' } } } }
18 501e5104 Michael Roth
19 f294f82a Luiz Capitulino
{ 'type': 'UserDefNested',
20 f294f82a Luiz Capitulino
  'data': { 'string0': 'str',
21 f294f82a Luiz Capitulino
            'dict1': { 'string1': 'str',
22 f294f82a Luiz Capitulino
                       'dict2': { 'userdef1': 'UserDefOne', 'string2': 'str' },
23 f294f82a Luiz Capitulino
                       '*dict3': { 'userdef2': 'UserDefOne', 'string3': 'str' } } } }
24 f294f82a Luiz Capitulino
25 dc8fb6df Paolo Bonzini
# for testing unions
26 dc8fb6df Paolo Bonzini
{ 'type': 'UserDefA',
27 dc8fb6df Paolo Bonzini
  'data': { 'boolean': 'bool' } }
28 dc8fb6df Paolo Bonzini
29 dc8fb6df Paolo Bonzini
{ 'type': 'UserDefB',
30 dc8fb6df Paolo Bonzini
  'data': { 'integer': 'int' } }
31 dc8fb6df Paolo Bonzini
32 dc8fb6df Paolo Bonzini
{ 'union': 'UserDefUnion',
33 dc8fb6df Paolo Bonzini
  'data': { 'a' : 'UserDefA', 'b' : 'UserDefB' } }
34 dc8fb6df Paolo Bonzini
35 83c84667 Michael Roth
# for testing native lists
36 83c84667 Michael Roth
{ 'union': 'UserDefNativeListUnion',
37 83c84667 Michael Roth
  'data': { 'integer': ['int'],
38 83c84667 Michael Roth
            's8': ['int8'],
39 83c84667 Michael Roth
            's16': ['int16'],
40 83c84667 Michael Roth
            's32': ['int32'],
41 83c84667 Michael Roth
            's64': ['int64'],
42 83c84667 Michael Roth
            'u8': ['uint8'],
43 83c84667 Michael Roth
            'u16': ['uint16'],
44 83c84667 Michael Roth
            'u32': ['uint32'],
45 83c84667 Michael Roth
            'u64': ['uint64'],
46 83c84667 Michael Roth
            'number': ['number'],
47 83c84667 Michael Roth
            'boolean': ['bool'],
48 83c84667 Michael Roth
            'string': ['str'] } }
49 83c84667 Michael Roth
50 501e5104 Michael Roth
# testing commands
51 501e5104 Michael Roth
{ 'command': 'user_def_cmd', 'data': {} }
52 501e5104 Michael Roth
{ 'command': 'user_def_cmd1', 'data': {'ud1a': 'UserDefOne'} }
53 501e5104 Michael Roth
{ 'command': 'user_def_cmd2', 'data': {'ud1a': 'UserDefOne', 'ud1b': 'UserDefOne'}, 'returns': 'UserDefTwo' }