summaryrefslogtreecommitdiff
path: root/src/mailman/rest/docs/helpers.rst
diff options
context:
space:
mode:
authorBarry Warsaw2015-07-04 14:58:45 -0400
committerBarry Warsaw2015-07-18 23:21:05 -0400
commit759efff6eb63b3ba1fff15193923a3df72eb552c (patch)
tree97d61b867217476be4ef58de389644ee88d0ed13 /src/mailman/rest/docs/helpers.rst
parentfddfcbde937f61657bb29253609b63670beaae46 (diff)
downloadmailman-759efff6eb63b3ba1fff15193923a3df72eb552c.tar.gz
mailman-759efff6eb63b3ba1fff15193923a3df72eb552c.tar.zst
mailman-759efff6eb63b3ba1fff15193923a3df72eb552c.zip
Diffstat (limited to 'src/mailman/rest/docs/helpers.rst')
-rw-r--r--src/mailman/rest/docs/helpers.rst12
1 files changed, 6 insertions, 6 deletions
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