Re:Flask API – Browsable Web APIs for Flask
by tomchristie on Thursday February 27, 2014 @08:55AM
(#7312114)
The most obvious feature difference is the browsable API.
Flask API also shares the same architecture as the core of Django REST framework, which I think just has a really nice separation of concerns.
Also the interface of `request.data` means is easy to transparently support both JSON and form requests, and the nice content negotiation on responses means it's easy to build services that power both an HTML front-end and an API from the same endpoints.
Right now Flask RESTful is more mature of course, but I've got high hopes for this, and it's been super fun to build so far.
Re:Flask API – Browsable Web APIs for Flask
by mwhite on Thursday February 27, 2014 @11:46AM
(#7313180)
What about using Swagger[0] with flask-restful-swagger[1]?
[0] https://helloreverb.com/developers/swagger [1] https://github.com/rantav/flask-restful-swagger
Re:Flask API – Browsable Web APIs for Flask
by pmdarrow on Thursday February 27, 2014 @10:55AM
(#7312811)
We've been considering "porting" our app from Flask-RESTful to Django REST Framework because it is so well architected, tested, and has a large community around it. So I'm overjoyed to hear that you're bringing this awesomeness to the Flask world Tom!
Re:Flask API – Browsable Web APIs for Flask
by tomchristie on Thursday February 27, 2014 @11:41AM
(#7313140)
Most welcome! For anyone on this thread who's interested in contributing I'd suggest opening a ticket citing your interest, so that we've then go a place we can start the discussion from.
Re:Flask API – Browsable Web APIs for Flask
by rajbala on Thursday February 27, 2014 @11:44AM
(#7313164)
Perhaps an obvious question, but why do APIs need to be browsable?
Re:Flask API – Browsable Web APIs for Flask
by jvehent on Thursday February 27, 2014 @03:02PM
(#7314607)
If you are still asking yourself that question, I strongly recommend you read this book: http://restfulwebapis.com/
Re:Flask API – Browsable Web APIs for Flask
by rajbala on Thursday February 27, 2014 @09:06PM
(#7316797)
It's a legitimate question. I understand why URLs need to be browsable.
How does a browsable API work when it may need certain HTTP headers, request signatures, etc?
Re:Flask API – Browsable Web APIs for Flask
by steveklabnik on Thursday February 27, 2014 @09:33PM
(#7316923)
That's in the contents of the book.
Re:Flask API – Browsable Web APIs for Flask
by tomchristie on Thursday February 27, 2014 @11:55AM
(#7313242)
They don't need too, but it sure-as-hell improves accessibility & usability.
Re:Flask API – Browsable Web APIs for Flask
by frio on Thursday February 27, 2014 @05:22PM
(#7315651)
The only reason I still use Django is my deep-seated and abiding love for django-rest-framework. If you're bringing it to Flask, then that's the final bullet.
Re:Flask API – Browsable Web APIs for Flask
by weixiyen on Thursday February 27, 2014 @01:54PM
(#7314121)
Honestly, Flask-Restful provides almost nothing useful that couldn't be added to an entire Flask project with a few lines of code. I've completely moved away from it as it actually introduced an obscure bug in content negotiation, while at the same time requiring extra mental overhead just to use.
Re:Flask API – Browsable Web APIs for Flask
by pmdarrow on Thursday February 27, 2014 @12:20PM
(#7313416)
I can sort of comment on this since I've used Flask-RESTful and Django REST Framework where a lot of the Flask-API design is/will be borrowed from. I think the browsable API feature is great but it's not the killer feature for me. To me the killer feature is the well-designed serialization and validation architecture. In Flask-RESTful this seems half-baked - there is no notion of hyperlinked references or nested objects. At our company we ended up implementing our own serialization & validation layer which felt a lot like reinventing the wheel. My hope is that we can bring this same great architecture over from DRF to Flask-API.
Re:Flask API – Browsable Web APIs for Flask
by ciokan on Thursday February 27, 2014 @07:23PM
(#7316404)
even better one http://python-eve.org/
http://flask-restful.readthedocs.org/en/latest/