Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into staging
[qemu/ar7.git] / tests / qapi-schema / doc-good.json
blobf7fb48af384782f5de0af2b01dbd745c553da0d9
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 # @two is undocumented
58 { 'enum': 'Enum', 'data':
59   [ { 'name': 'one', 'if': 'defined(IFONE)' }, 'two' ],
60   'if': 'defined(IFCOND)' }
63 # @Base:
64 # @base1:
65 #   the first member
67 { 'struct': 'Base', 'data': { 'base1': 'Enum' } }
70 # @Variant1:
71 # A paragraph
73 # Another paragraph (but no @var: line)
75 { 'struct': 'Variant1',
76   'data': { 'var1': { 'type': 'str', 'if': 'defined(IFSTR)' } } }
79 # @Variant2:
81 { 'struct': 'Variant2', 'data': {} }
84 # @Object:
86 { 'union': 'Object',
87   'base': 'Base',
88   'discriminator': 'base1',
89   'data': { 'one': 'Variant1', 'two': { 'type': 'Variant2', 'if': 'IFTWO' } } }
92 # @SugaredUnion:
94 { 'union': 'SugaredUnion',
95   'data': { 'one': 'Variant1', 'two': { 'type': 'Variant2', 'if': 'IFTWO' } } }
98 # == Another subsection
102 # @cmd:
103 # @arg1: the first argument
105 # @arg2: the second
106 # argument
107 # Note: @arg3 is undocumented
108 # Returns: @Object
109 # TODO: frobnicate
110 # Notes:
111 # - Lorem ipsum dolor sit amet
112 # - Ut enim ad minim veniam
114 # Duis aute irure dolor
115 # Example:
117 # -> in
118 # <- out
119 # Examples:
120 # - *verbatim*
121 # - {braces}
122 # Since: 2.10
124 { 'command': 'cmd',
125   'data': { 'arg1': 'int', '*arg2': 'str', 'arg3': 'bool' },
126   'returns': 'Object' }
129 # @cmd-boxed:
130 # If you're bored enough to read this, go see a video of boxed cats
131 # Example:
133 # -> in
135 # <- out
137 { 'command': 'cmd-boxed', 'boxed': true,
138   'data': 'Object' }