This takes advantage of the sphinxcontrib-openapi Sphinx extension,
which allows us to embed the REST API documentation into our docs quite
nicely.
Signed-off-by: Stephen Finucane <stephen@that.guru>
where `patchwork.example.com` refers to the URL of your Patchwork instance.
+If all you want is reference guides, skip straight to :ref:`rest-api-schemas`.
+
.. important::
The REST API can be enabled/disabled by the administrator: it may not be
Further information about this and more can typically be found in
:doc:`the release notes </releases/index>`.
+.. _rest-api-schemas:
+
+Schemas
+-------
+
+Auto-generated schema documentation is provided below.
+
+.. toctree::
+
+ /api/rest/schemas/v1.0
+ /api/rest/schemas/v1.1
+
.. Links
.. _curl: https://curl.haxx.se/
--- /dev/null
+:orphan:
+
+Schemas
+=======
+
+The APIs for the :doc:`REST API </api/rest/index>` are listed below. For
+further information, refer to the :doc:`REST API overview </api/rest/index>`.
+
+.. toctree::
+ :maxdepth: 2
+
+ /api/rest/schemas/v1.0
+ /api/rest/schemas/v1.1
--- /dev/null
+API v1.0
+========
+
+.. openapi:: ../../schemas/v1.0/patchwork.yaml
+ :examples:
--- /dev/null
+API v1.1 (latest)
+=================
+
+.. openapi:: ../../schemas/v1.1/patchwork.yaml
+ :examples:
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
-extensions = ['sphinx.ext.todo', 'reno.sphinxext']
+extensions = [
+ 'sphinx.ext.todo',
+ 'reno.sphinxext',
+ 'sphinxcontrib.openapi'
+]
# The theme to use for HTML and HTML Help pages.
html_theme = 'sphinx_rtd_theme'
reno>=2.2
sphinx_rtd_theme==0.4.2
jinja2==2.10
+sphinxcontrib-openapi==0.4.0