summaryrefslogtreecommitdiff
path: root/src/mailman/rest/docs
diff options
context:
space:
mode:
Diffstat (limited to 'src/mailman/rest/docs')
-rw-r--r--src/mailman/rest/docs/basic.rst1
-rw-r--r--src/mailman/rest/docs/helpers.rst12
2 files changed, 7 insertions, 6 deletions
diff --git a/src/mailman/rest/docs/basic.rst b/src/mailman/rest/docs/basic.rst
index 5efa2526d..45ace87ec 100644
--- a/src/mailman/rest/docs/basic.rst
+++ b/src/mailman/rest/docs/basic.rst
@@ -42,6 +42,7 @@ System version information can be retrieved from the server, in the form of a
JSON encoded response.
>>> dump_json('http://localhost:9001/3.0/system/versions')
+ api_version: 3.0
http_etag: "..."
mailman_version: GNU Mailman 3...
python_version: ...
diff --git a/src/mailman/rest/docs/helpers.rst b/src/mailman/rest/docs/helpers.rst
index c40619c01..ccd09a061 100644
--- a/src/mailman/rest/docs/helpers.rst
+++ b/src/mailman/rest/docs/helpers.rst
@@ -10,14 +10,15 @@ Resource paths
For example, most resources don't have to worry about where they are rooted.
They only need to know where they are relative to the root URI, and this
-function can return them the full path to the resource.
+function can return them the full path to the resource. We have to pass in
+the REST API version because there is no request in flight.
>>> from mailman.rest.helpers import path_to
- >>> print(path_to('system'))
+ >>> print(path_to('system', '3.0'))
http://localhost:9001/3.0/system
-Parameters like the ``scheme``, ``host``, ``port``, and API version number can
-be set in the configuration file.
+Parameters like the ``scheme``, ``host``, and ``port`` can be set in the
+configuration file.
::
>>> config.push('helpers', """
@@ -25,11 +26,10 @@ be set in the configuration file.
... hostname: geddy
... port: 2112
... use_https: yes
- ... api_version: 4.2
... """)
>>> cleanups.append((config.pop, 'helpers'))
- >>> print(path_to('system'))
+ >>> print(path_to('system', '4.2'))
https://geddy:2112/4.2/system