qapi: Add feature flags to remaining definitions
[qemu/ar7.git] / tests / qapi-schema / doc-good.json
blob457b8b2cdf129d3daf0c89c7b2c2e34e09689af0
1 # -*- Mode: Python -*-
2 # Positive QAPI doc comment tests
4 { 'pragma': { 'doc-required': true } }
6 ##
7 # = Section
9 # == Subsection
11 # *strong* _with emphasis_
12 # @var {in braces}
13 # * List item one
14 # - Two, multiple
15 #   lines
17 # 3. Three
18 # Still in list
20 #   Not in list
21 # - Second list
22 # Note: still in list
24 # Note: not in list
25 # 1. Third list
26 #    is numbered
28 # - another item
30 # | example
31 # | multiple lines
33 # Returns: the King
34 # Since: the first age
35 # Notes:
37 # 1. Lorem ipsum dolor sit amet
39 # 2. Ut enim ad minim veniam
41 # Duis aute irure dolor
43 # Example:
45 # -> in
46 # <- out
47 # Examples:
48 # - *verbatim*
49 # - {braces}
53 # @Enum:
54 # @one: The _one_ {and only}
56 # Features:
57 # @enum-feat: Also _one_ {and only}
59 # @two is undocumented
61 { 'enum': 'Enum', 'data':
62   [ { 'name': 'one', 'if': 'defined(IFONE)' }, 'two' ],
63   'features': [ 'enum-feat' ],
64   'if': 'defined(IFCOND)' }
67 # @Base:
68 # @base1:
69 #   the first member
71 { 'struct': 'Base', 'data': { 'base1': 'Enum' } }
74 # @Variant1:
75 # A paragraph
77 # Another paragraph (but no @var: line)
79 # Features:
80 # @variant1-feat: a feature
82 { 'struct': 'Variant1',
83   'features': [ 'variant1-feat' ],
84   'data': { 'var1': { 'type': 'str', 'if': 'defined(IFSTR)' } } }
87 # @Variant2:
89 { 'struct': 'Variant2', 'data': {} }
92 # @Object:
93 # Features:
94 # @union-feat1: a feature
96 { 'union': 'Object',
97   'features': [ 'union-feat1' ],
98   'base': 'Base',
99   'discriminator': 'base1',
100   'data': { 'one': 'Variant1', 'two': { 'type': 'Variant2', 'if': 'IFTWO' } } }
103 # @SugaredUnion:
104 # Features:
105 # @union-feat2: a feature
107 { 'union': 'SugaredUnion',
108   'features': [ 'union-feat2' ],
109   'data': { 'one': 'Variant1', 'two': { 'type': 'Variant2', 'if': 'IFTWO' } } }
112 # @Alternate:
113 # @i: an integer
114 # @b is undocumented
116 # Features:
117 # @alt-feat: a feature
119 { 'alternate': 'Alternate',
120   'features': [ 'alt-feat' ],
121   'data': { 'i': 'int', 'b': 'bool' } }
124 # == Another subsection
128 # @cmd:
129 # @arg1: the first argument
131 # @arg2: the second
132 # argument
134 # Features:
135 # @cmd-feat1: a feature
136 # @cmd-feat2: another feature
137 # Note: @arg3 is undocumented
138 # Returns: @Object
139 # TODO: frobnicate
140 # Notes:
141 # - Lorem ipsum dolor sit amet
142 # - Ut enim ad minim veniam
144 # Duis aute irure dolor
145 # Example:
147 # -> in
148 # <- out
149 # Examples:
150 # - *verbatim*
151 # - {braces}
152 # Since: 2.10
154 { 'command': 'cmd',
155   'data': { 'arg1': 'int', '*arg2': 'str', 'arg3': 'bool' },
156   'returns': 'Object',
157   'features': [ 'cmd-feat1', 'cmd-feat2' ] }
160 # @cmd-boxed:
161 # If you're bored enough to read this, go see a video of boxed cats
162 # Features:
163 # @cmd-feat1: a feature
164 # @cmd-feat2: another feature
165 # Example:
167 # -> in
169 # <- out
171 { 'command': 'cmd-boxed', 'boxed': true,
172   'data': 'Object',
173   'features': [ 'cmd-feat1', 'cmd-feat2' ] }
176 # @EVT-BOXED:
177 # Features:
178 # @feat3: a feature
180 { 'event': 'EVT-BOXED',  'boxed': true,
181   'features': [ 'feat3' ],
182   'data': 'Object' }