Hackage 2.0: JSON resources?

Duncan Coutts duncan.coutts at googlemail.com
Mon Oct 3 16:48:05 CEST 2011


On Wed, 2011-09-28 at 14:23 +0100, Max Bolingbroke wrote:
> On 27 September 2011 13:15, Max Bolingbroke <batterseapower at hotmail.com> wrote:
> it would be nicer to expose a
> > machine-readable resource like
> > http://localhost:8080/package/process.json that I could retrieve and
> > extract the relevant information from.
> 
> I've noticed that the particular data I'm after is available by
> GETting a URL like http://127.0.0.1:8080/package/array-0.3.0.1/doc/
> and testing whether the result is a 404 or not. So this issue is no
> longer a blocker for me, though JSON resources would be useful more
> generally to other Hackage clients.

Right, in this case doing a GET like that is the simplest RESTful thing
I think. In general however we're quite happy for the new server to
provide as much info as possible in convenient formats, be that text,
xml, json or whatever.

You mentioned the json feature. I don't think that's the best way to
partition things. That approach suggests having one jsonFeature that
serves json format resources for everything. Both xml and json (and any
other native format) are fine to be included in each feature, and I
think that's much more sensible than trying to separate it out into its
own feature.

The only reason we have a separate html feature is that nice html for a
human website is simply not modular. Whereas for serving resources for
non-human clients, it's perfectly modular to provide lots of different,
linked, resources in various formats.

Duncan




More information about the cabal-devel mailing list