Browsable API and Versioning

68 views
Skip to first unread message

Robyn Smith

unread,
Nov 3, 2016, 4:22:58 PM11/3/16
to Django REST framework
Hello Everyone!

DRF is amazing. Just a quick thank you to the community!

I'm working on a project where we're building an API from scratch using the Django REST Framework, and when working on the Proof of Concept, we started running into challenges when we introduced Accept Header based versioning. 

Does anyone know how versioning and the browsable API are supposed to work? I'm not really able to find anything documented.

Thanks!

Xavier Ordoquy

unread,
Nov 3, 2016, 4:28:21 PM11/3/16
to django-res...@googlegroups.com
Hi Robyn,
I don’t think there’s anything yet in the browsable API that supports the versioning through headers unfortunately.
I’m afraid in the short term you’ll have to insert them yourself with your browser.

Regards,
Xavier,
Linovia.

Robyn Smith

unread,
Nov 3, 2016, 4:36:25 PM11/3/16
to django-res...@googlegroups.com
Thanks for the response Xavier!

Is there a method of versioning that would allow us to gain access to the browsable API without injecting them ourselves with the browser?

The other challenge is when using the "django-rest-swagger", the headers used in the browser obviously don't inject the version. I was thinking of a solution like using middleware to inject a requested version into the header, but this seems like a messy option.

Thanks!

~Robyn

--
You received this message because you are subscribed to a topic in the Google Groups "Django REST framework" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/django-rest-framework/x3xah0f9jps/unsubscribe.
To unsubscribe from this group and all its topics, send an email to django-rest-fram...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Robyn Smith

unread,
Nov 3, 2016, 5:51:10 PM11/3/16
to django-res...@googlegroups.com
I think I found a potential solution for swagger:

doc: ApiVersionAuthorization by blueyed · Pull Request #571 · marcgibbons/django-rest-swagger
https://github.com/marcgibbons/django-rest-swagger/pull/571/files

Does anyone know if there's a way to do this for the Browsable API?
Reply all
Reply to author
Forward
0 new messages