diff mbox series

[4/7] qapidoc: Generate default Returns WIP

Message ID 20240506110254.3965097-9-armbru@redhat.com (mailing list archive)
State New, archived
Headers show
Series [PULL,1/7] qapi: New QAPISchemaBranches, QAPISchemaAlternatives | expand

Commit Message

Markus Armbruster May 6, 2024, 11:02 a.m. UTC
Affected:
x-debug-query-block-graph
query-tpm
query-dirty-rate
query-vcpu-dirty-limit
query-vm-generation-id
query-memory-size-summary
query-memory-devices
query-acpi-ospm-status
query-stats-schemas
---
 docs/sphinx/qapidoc.py | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

Comments

Markus Armbruster May 6, 2024, 12:46 p.m. UTC | #1
Sent by accident, please ignore.
diff mbox series

Patch

diff --git a/docs/sphinx/qapidoc.py b/docs/sphinx/qapidoc.py
index 24bf1d9a90..35627ca741 100644
--- a/docs/sphinx/qapidoc.py
+++ b/docs/sphinx/qapidoc.py
@@ -251,9 +251,14 @@  def _nodes_for_features(self, doc):
         return [section]
 
     def _nodes_for_returns(self, doc, ret_type):
-        if doc.returns:
+        assert not doc.returns or ret_type
+        if ret_type:
             section = self._make_section('Returns')
-            self._parse_text_into_node(doc.returns.text, section)
+            if doc.returns:
+                self._parse_text_into_node(doc.returns.text, section)
+            else:
+                section += nodes.paragraph(
+                    '', '', nodes.Text(ret_type.doc_type()))
             return [section]
         return []