xref: /qemu/tests/qapi-schema/doc-good.json (revision b2322003)
1# -*- Mode: Python -*-
2# Positive QAPI doc comment tests
3
4{ 'pragma': { 'doc-required': true } }
5
6##
7# = Section
8#
9# == Subsection
10#
11# *strong* _with emphasis_
12# @var {in braces}
13# * List item one
14# - Two, multiple
15#   lines
16#
17# 3. Three
18# Still in list
19#
20#   Not in list
21# - Second list
22# Note: still in list
23#
24# Note: not in list
25# 1. Third list
26#    is numbered
27#
28# - another item
29#
30# | example
31# | multiple lines
32#
33# Returns: the King
34# Since: the first age
35# Notes:
36#
37# 1. Lorem ipsum dolor sit amet
38#
39# 2. Ut enim ad minim veniam
40#
41# Duis aute irure dolor
42#
43# Example:
44#
45# -> in
46# <- out
47# Examples:
48# - *verbatim*
49# - {braces}
50##
51
52##
53# @Enum:
54# @one: The _one_ {and only}
55#
56# @two is undocumented
57##
58{ 'enum': 'Enum', 'data':
59  [ { 'name': 'one', 'if': 'defined(IFONE)' }, 'two' ],
60  'if': 'defined(IFCOND)' }
61
62##
63# @Base:
64# @base1:
65#   the first member
66##
67{ 'struct': 'Base', 'data': { 'base1': 'Enum' } }
68
69##
70# @Variant1:
71# A paragraph
72#
73# Another paragraph (but no @var: line)
74##
75{ 'struct': 'Variant1',
76  'data': { 'var1': { 'type': 'str', 'if': 'defined(IFSTR)' } } }
77
78##
79# @Variant2:
80##
81{ 'struct': 'Variant2', 'data': {} }
82
83##
84# @Object:
85##
86{ 'union': 'Object',
87  'base': 'Base',
88  'discriminator': 'base1',
89  'data': { 'one': 'Variant1', 'two': { 'type': 'Variant2', 'if': 'IFTWO' } } }
90
91##
92# @SugaredUnion:
93##
94{ 'union': 'SugaredUnion',
95  'data': { 'one': 'Variant1', 'two': { 'type': 'Variant2', 'if': 'IFTWO' } } }
96
97##
98# == Another subsection
99##
100
101##
102# @cmd:
103# @arg1: the first argument
104#
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
113#
114# Duis aute irure dolor
115# Example:
116#
117# -> in
118# <- out
119# Examples:
120# - *verbatim*
121# - {braces}
122# Since: 2.10
123##
124{ 'command': 'cmd',
125  'data': { 'arg1': 'int', '*arg2': 'str', 'arg3': 'bool' },
126  'returns': 'Object' }
127
128##
129# @cmd-boxed:
130# If you're bored enough to read this, go see a video of boxed cats
131# Example:
132#
133# -> in
134#
135# <- out
136##
137{ 'command': 'cmd-boxed', 'boxed': true,
138  'data': 'Object' }
139