summaryrefslogtreecommitdiff
path: root/patchwork/urls.py
diff options
context:
space:
mode:
authorStephen Finucane <stephen@that.guru>2018-03-25 19:28:20 +0100
committerStephen Finucane <stephen@that.guru>2018-04-07 17:43:26 +0100
commitd944f17ec05950ef172dd8a938369570c5745a98 (patch)
treef2bb264d89fbf9652a1afdb93d83e6a9ddd2a487 /patchwork/urls.py
parent683792d1f37c97306f241ca5f9e2b0cda162891c (diff)
downloadpatchwork-d944f17ec05950ef172dd8a938369570c5745a98.tar
patchwork-d944f17ec05950ef172dd8a938369570c5745a98.tar.gz
REST: Use versioning for modified responses
This ensures clients are getting a consistent response if they request the old version of the API. We do this by way of extensions to the 'HyperlinkedModelSerializer' class rather than duplicating the serializers as it results in far less duplication. This approach won't work for a MAJOR version bump but, all going well, it will be a while before we have to deal with one of these. The only two fields added since API 1.0 was released, 'cover.mbox' and 'project.subject_match', are handled accordingly. Signed-off-by: Stephen Finucane <stephen@that.guru>
Diffstat (limited to 'patchwork/urls.py')
-rw-r--r--patchwork/urls.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/patchwork/urls.py b/patchwork/urls.py
index 7193472..0893fe2 100644
--- a/patchwork/urls.py
+++ b/patchwork/urls.py
@@ -280,7 +280,7 @@ if settings.ENABLE_REST_API:
]
urlpatterns += [
- url(r'^api/(?:(?P<version>(1.0))/)?', include(api_patterns)),
+ url(r'^api/(?:(?P<version>(1.0|1.1))/)?', include(api_patterns)),
# token change
url(r'^user/generate-token/$', user_views.generate_token,