16

I have some old code which exposes services on a web API which works basically on HTTP verbs. I'd like to move this project to use hypermedia controls (HATEOAS). I'm wondering if there are any libraries already that support embedding links in resource representation for sub resources in accordance with HAL or JSON-LD specs. I've googled around but I couldn't find anything. It would be good to know if one of the mature projects like Yesod, Snap or Happstack are planning on supporting this feature?

Edit: To clarify, I'm interested in level 3 of the REST Maturity Model

opensourcegeek
  • 5,552
  • 7
  • 43
  • 64
  • 1
    What you are asking I guess is already supported by Yesod, see this: http://www.yesodweb.com/book/restful-content – Sibi Apr 26 '14 at 08:38
  • @Sibi I don't think so, it talks about HTTP API using verbs. But I'm referring to something along the lines of [HAL](http://stateless.co/hal_specification.html). And it is level 3 in [REST maturity model](http://martinfowler.com/articles/richardsonMaturityModel.html) – opensourcegeek Apr 26 '14 at 08:53
  • 2
    I advise anyone looking at this question to take the time to read that 'level 3' section in the link @opensourcegeek posted, because this is a much more interesting question than it'd seem at first ("look at all these buzzwords!") – Cactus Jan 15 '16 at 06:55

2 Answers2

2

The json-api package purports to offer some support for HATEOS. This is the output of this example code demonstrating how you might generate a HATEOS/HAL style response.

John
  • 14,944
  • 12
  • 57
  • 57
1

Have you seen HAL before? It's a specification format for hypermedia objects. The github wiki for the spec has a list of libraries but I don't see any haskell libraries on there.
However, a quick google turns up https://github.com/talios/haskell-hal. Doesn't look super popular, but maybe after reading about HAL you'll contribute, fork it, or launch your own!

kag0
  • 5,624
  • 7
  • 34
  • 67