doc: Replace incorrect directive

autotype was not a valid directive until Sphinx 9.0 [1] and now that it
is, it is causing errors. Replace the directive with the correct
directive.

[1] https://www.sphinx-doc.org/en/master/usage/extensions/autodoc.html#directive-autotype

Change-Id: Ic3a19e7d2ea1bf3917bd3df8ead33ec1f83bd83c
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
This commit is contained in:
Stephen Finucane
2026-07-11 06:55:48 +00:00
parent d0ffd9b93a
commit 69da14f1a8
4 changed files with 14 additions and 19 deletions
+3 -6
View File
@@ -128,7 +128,7 @@ Autodoc directives
Theses directives scan your code to generate the documentation from the
docstrings and your API types and controllers.
.. rst:directive:: .. autotype:: myapp.MyType
.. rst:directive:: .. autoclass:: myapp.MyType
Generate the myapp.MyType documentation.
@@ -165,7 +165,7 @@ Documentation source
An integer
.. autotype:: wsmeext.sphinxext.SampleType
.. autoclass:: wsmeext.sphinxext.SampleType
:members:
.. autoservice:: wsmeext.sphinxext.SampleService
@@ -180,11 +180,8 @@ Result
An integer
.. autotype:: wsmeext.sphinxext.SampleType
.. autoclass:: wsmeext.sphinxext.SampleType
:members:
.. autoservice:: wsmeext.sphinxext.SampleService
:members:
.. _Sphinx: http://sphinx.pocoo.org/
+2 -3
View File
@@ -242,6 +242,5 @@ Predefined Types
.. default-domain:: wsme
- .. autotype:: wsme.types.File
:members:
- .. autoclass:: wsme.types.File
:members:
+7 -8
View File
@@ -14,11 +14,10 @@ Example
:type: int
.. wsme:service:: name/space/SampleService
.. wsme:function:: getType
Returns a :wsme:type:`MyType <MyType>`
.. wsme:function:: getType
Returns a :wsme:type:`MyType <MyType>`
.. default-domain:: wsme
@@ -26,18 +25,18 @@ Example
An integer
.. autotype:: wsmeext.sphinxext.SampleType
.. autoclass:: wsmeext.sphinxext.SampleType
:members:
.. autoservice:: wsmeext.sphinxext.SampleService
:members:
.. autotype:: test_sphinxext.ASampleType
.. autoclass:: test_sphinxext.ASampleType
:members:
.. autotype:: wsme.types.bytes
.. autoclass:: wsme.types.bytes
.. autotype:: wsme.types.text
.. autoclass:: wsme.types.text
.. _Sphinx: http://sphinx.pocoo.org/
+2 -2
View File
@@ -513,10 +513,10 @@ class FunctionDocumenter(autodoc.MethodDocumenter):
]
return inspect.formatargspec(args, defaults=defaults)
def get_doc(self, encoding=None):
def get_doc(self):
"""Inject the type and param fields into the docstrings so that the
user can add its own param fields to document the parameters"""
docstrings = super(FunctionDocumenter, self).get_doc(encoding)
docstrings = super().get_doc()
protocols = get_protocols(
self.options.protocols or self.env.app.config.wsme_protocols