[PATCH 1/2] REST: Fix versioning

Andy Doan andy.doan at linaro.org
Tue May 2 00:28:40 AEST 2017


On 04/26/2017 06:58 PM, Stephen Finucane wrote:
> One of the few remaining warts in the API is versioning. There is some
> basic versioning there, but it doesn't work properly as-is. Fix this by
> correcting the index endpoint ('/') to use Django REST Framework's
> 'reverse' function [1], which handles versioning for us [2] and
> switching from 'NamespaceVersioning' to 'URLPathVersioning', the latter
> of which does the same thing but in a different way.
>
> [1] http://www.django-rest-framework.org/api-guide/reverse/#reverse
> [2] http://www.django-rest-framework.org/api-guide/versioning/#reversing-urls-for-versioned-apis
> [3] http://www.django-rest-framework.org/api-guide/versioning/#urlpathversioning
>
> Signed-off-by: Stephen Finucane <stephen at that.guru>
> Cc: Andy Doan <andy.doan at linaro.org>

Sorry for the slow response, but this is a clear improvement.

Reviewed-by: Andy Doan <andy.doan at linaro.org>


More information about the Patchwork mailing list