1# -*- Mode: Python -*-
2# vim: filetype=python
3#
4# Positive QAPI doc comment tests
5
6{ 'pragma': {
7    'doc-required': true,
8    'documentation-exceptions': [ 'Enum', 'Variant1', 'Alternate', 'cmd' ] } }
9
10##
11# = Section
12##
13
14##
15# == Subsection
16#
17# *with emphasis*
18# @var {in braces}
19#
20# * List item one
21# * Two, multiple
22#   lines
23#
24# * Three
25#   Still in list
26#
27# Not in list
28#
29# - Second list
30#   Note: still in list
31#
32# Note: not in list
33#
34# 1. Third list
35#    is numbered
36#
37# 2. another item
38#
39# Returns: the King
40# Since: the first age
41# Notes:
42#
43# 1. Lorem ipsum dolor sit amet
44#
45# 2. Ut enim ad minim veniam
46#
47# Duis aute irure dolor
48#
49# Example:
50#
51# -> in
52# <- out
53# Examples:
54# - *verbatim*
55# - {braces}
56##
57
58##
59# @Enum:
60#
61# @one: The _one_ {and only}, description on the same line
62#
63# Features:
64# @enum-feat: Also _one_ {and only}
65# @enum-member-feat: a member feature
66#
67# @two is undocumented
68##
69{ 'enum': 'Enum',
70  'data': [ { 'name': 'one', 'if': 'IFONE',
71              'features': [ 'enum-member-feat' ] },
72            'two' ],
73  'features': [ 'enum-feat' ],
74  'if': 'IFCOND' }
75
76##
77# @Base:
78#
79# @base1:
80#  description starts on a new line,
81#  minimally indented
82##
83{ 'struct': 'Base', 'data': { 'base1': 'Enum' },
84  'if': { 'all': ['IFALL1', 'IFALL2'] } }
85
86##
87# @Variant1:
88#
89# A paragraph
90#
91# Another paragraph
92#
93# @var1 is undocumented
94#
95# Features:
96# @variant1-feat: a feature
97# @member-feat: a member feature
98##
99{ 'struct': 'Variant1',
100  'features': [ 'variant1-feat' ],
101  'data': { 'var1': { 'type': 'str',
102                      'features': [ 'member-feat' ],
103                      'if': 'IFSTR' } } }
104
105##
106# @Variant2:
107#
108##
109{ 'struct': 'Variant2', 'data': {} }
110
111##
112# @Object:
113#
114# Features:
115# @union-feat1: a feature
116##
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'] } } } }
124
125##
126# @Alternate:
127#
128# @i: description starts on the same line
129#     remainder indented the same
130#     @b is undocumented
131#
132# Features:
133# @alt-feat: a feature
134##
135{ 'alternate': 'Alternate',
136  'features': [ 'alt-feat' ],
137  'data': { 'i': 'int', 'b': 'bool' },
138  'if': { 'not': { 'any': [ 'IFONE', 'IFTWO' ] } } }
139
140##
141# == Another subsection
142##
143
144##
145# @cmd:
146#
147# @arg1:
148#     description starts on a new line,
149#     indented
150#
151# @arg2: description starts on the same line
152#     remainder indented differently
153#
154# Features:
155# @cmd-feat1: a feature
156# @cmd-feat2: another feature
157# Note: @arg3 is undocumented
158# Returns: @Object
159# TODO: frobnicate
160# Notes:
161#
162#  - Lorem ipsum dolor sit amet
163#  - Ut enim ad minim veniam
164#
165#  Duis aute irure dolor
166# Example:
167#
168#  -> in
169#  <- out
170# Examples:
171#  - *verbatim*
172#  - {braces}
173# Since: 2.10
174##
175{ 'command': 'cmd',
176  'data': { 'arg1': 'int', '*arg2': 'str', 'arg3': 'bool' },
177  'returns': 'Object',
178  'features': [ 'cmd-feat1', 'cmd-feat2' ] }
179
180##
181# @cmd-boxed:
182# If you're bored enough to read this, go see a video of boxed cats
183# Features:
184# @cmd-feat1: a feature
185# @cmd-feat2: another feature
186# Example:
187#
188#  -> in
189#
190#  <- out
191##
192{ 'command': 'cmd-boxed', 'boxed': true,
193  'data': 'Object',
194  'features': [ 'cmd-feat1', 'cmd-feat2' ] }
195
196##
197# @EVT_BOXED:
198#
199# Features:
200# @feat3: a feature
201##
202{ 'event': 'EVT_BOXED',  'boxed': true,
203  'features': [ 'feat3' ],
204  'data': 'Object' }
205