opensourcegeek
opensourcegeek

Reputation: 5962

How can I implement HATEOAS in Haskell?

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

Upvotes: 16

Views: 792

Answers (2)

John
John

Reputation: 15286

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.

Upvotes: 1

kag0
kag0

Reputation: 6054

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!

Upvotes: 1

Related Questions