Page MenuHomeSoftware Heritage

browsable JSON API
Closed, MigratedEdits Locked

Description

We would like to have a browsable JSON API for https://base.softwareheritage.org/api/ , in the style of http://www.flaskapi.org/

Revisions and Commits

Event Timeline

zack raised the priority of this task from to Normal.
zack updated the task description. (Show Details)
zack added a project: Web app.
ardumont raised the priority of this task from Normal to High.

Here is a rapid pros/cons on flask-api for the moment:

Pros:

  • ease of use for default use cases -> Switch Flask's app with FlaskApi's app and on we go. This does not deal with edge cases though (see the following points)
  • default renderers are enough for our use case
  • extending renderers and parsers is simple (added YAMLRenderer example from doc rDWUI612c7a23df7c9aceec47a1bde82c9b0b1c01efc8)
  • default rendering policy is good! Just need to set decorators for deviant other use cases -> We've got mainly apis for the moment and less html endpoints... but this may change in the future... -> An issue is opened about automagically detect when html is needed but no implem just yet (https://github.com/tomchristie/flask-api/issues/13)

Cons:

  • not blueprint compliant (we need to use the decorators provided by default) -> https://github.com/tomchristie/flask-api/10 issue on github
  • exception handling not symmetrical with default use case (That is it does not obey the client's 'Accept' header for errors...) -> dev was needed and done here - rDWUIb5fba341d2fece0f1588a288c501878766b91a2b (effort were made to keep the flask errorhandler decorator which is nice)
  • our @jsonp decorator stopped working, some dev was needed to make it back online again -> rDWUI6063c7e1ee760c097f60e77d0b8ba08e0330ea5d (the result is quite pleasing since we removed more code than adding it though)
  • low maintenance at the moment (the main contributor stepped down and is focused on Django rest https://github.com/tomchristie/flask-api/33) -> quoting the readme: 'Status: Flask API is not currently under active development. This will be reassessed once the Django REST framework Kickstarter project reaches completion.'
  • no deb for packaging flask-api just yet... (i installed using sudo pip3 install ...)

As of now, the main issue issue seems to be the blueprint compatibilty (https://github.com/tomchristie/flask-api/issues/10) but I'm no expert on them right now.
So next step, understanding blueprint... http://flask.pocoo.org/docs/0.10/blueprints/

Beware, for deployment, we'll need to install first flask-api...

(no deb package yet)

olasd changed the visibility from "All Users" to "Public (No Login Required)".May 13 2016, 5:06 PM