qapi: Recognize section tags and 'Features:' only after blank line
[qemu/armbru.git] / tests / qapi-schema / doc-good.json
blob5bb2b69071fc3bf89458cb5b0adc9ac8541af211
1 # -*- Mode: Python -*-
2 # vim: filetype=python
4 # Positive QAPI doc comment tests
6 { 'pragma': {
7     'doc-required': true,
8     'documentation-exceptions': [ 'Enum', 'Variant1', 'Alternate', 'cmd' ] } }
11 # = Section
15 # == Subsection
17 # *with emphasis*
18 # @var {in braces}
20 # * List item one
21 # * Two, multiple
22 #   lines
24 # * Three
25 #   Still in list
27 # Not in list
29 # - Second list
30 #   Note: still in list
32 # Note: not in list
34 # 1. Third list
35 #    is numbered
37 # 2. another item
39 # Returns: the King
40 # Since: the first age
41 # Notes:
43 # 1. Lorem ipsum dolor sit amet
45 # 2. Ut enim ad minim veniam
47 # Duis aute irure dolor
49 # Example:
51 # -> in
52 # <- out
53 # Examples:
54 # - *verbatim*
55 # - {braces}
59 # @Enum:
61 # @one: The _one_ {and only}, description on the same line
63 # Features:
64 # @enum-feat: Also _one_ {and only}
65 # @enum-member-feat: a member feature
67 # @two is undocumented
69 { 'enum': 'Enum',
70   'data': [ { 'name': 'one', 'if': 'IFONE',
71               'features': [ 'enum-member-feat' ] },
72             'two' ],
73   'features': [ 'enum-feat' ],
74   'if': 'IFCOND' }
77 # @Base:
79 # @base1:
80 #  description starts on a new line,
81 #  minimally indented
83 { 'struct': 'Base', 'data': { 'base1': 'Enum' },
84   'if': { 'all': ['IFALL1', 'IFALL2'] } }
87 # @Variant1:
89 # A paragraph
91 # Another paragraph
93 # @var1 is undocumented
95 # Features:
96 # @variant1-feat: a feature
97 # @member-feat: a member feature
99 { 'struct': 'Variant1',
100   'features': [ 'variant1-feat' ],
101   'data': { 'var1': { 'type': 'str',
102                       'features': [ 'member-feat' ],
103                       'if': 'IFSTR' } } }
106 # @Variant2:
109 { 'struct': 'Variant2', 'data': {} }
112 # @Object:
114 # Features:
115 # @union-feat1: a feature
117 { 'union': 'Object',
118   'features': [ 'union-feat1' ],
119   'base': 'Base',
120   'discriminator': 'base1',
121   'data': { 'one': 'Variant1',
122             'two': { 'type': 'Variant2',
123                      'if': { 'any': ['IFONE', 'IFTWO'] } } } }
126 # @Alternate:
128 # @i: description starts on the same line
129 #     remainder indented the same
130 #     @b is undocumented
132 # Features:
133 # @alt-feat: a feature
135 { 'alternate': 'Alternate',
136   'features': [ 'alt-feat' ],
137   'data': { 'i': 'int', 'b': 'bool' },
138   'if': { 'not': { 'any': [ 'IFONE', 'IFTWO' ] } } }
141 # == Another subsection
145 # @cmd:
147 # @arg1:
148 #     description starts on a new line,
149 #     indented
151 # @arg2: description starts on the same line
152 #     remainder indented differently
154 # Features:
155 # @cmd-feat1: a feature
156 # @cmd-feat2: another feature
158 # Note: @arg3 is undocumented
160 # Returns: @Object
162 # TODO: frobnicate
164 # Notes:
166 #  - Lorem ipsum dolor sit amet
167 #  - Ut enim ad minim veniam
169 #  Duis aute irure dolor
171 # Example:
173 #  -> in
174 #  <- out
176 # Examples:
177 #  - *verbatim*
178 #  - {braces}
180 # Since: 2.10
182 { 'command': 'cmd',
183   'data': { 'arg1': 'int', '*arg2': 'str', 'arg3': 'bool' },
184   'returns': 'Object',
185   'features': [ 'cmd-feat1', 'cmd-feat2' ] }
188 # @cmd-boxed:
189 # If you're bored enough to read this, go see a video of boxed cats
191 # Features:
192 # @cmd-feat1: a feature
193 # @cmd-feat2: another feature
195 # Example:
197 #  -> in
199 #  <- out
201 { 'command': 'cmd-boxed', 'boxed': true,
202   'data': 'Object',
203   'features': [ 'cmd-feat1', 'cmd-feat2' ] }
206 # @EVT_BOXED:
208 # Features:
209 # @feat3: a feature
211 { 'event': 'EVT_BOXED',  'boxed': true,
212   'features': [ 'feat3' ],
213   'data': 'Object' }