How can I implement HATEOAS in Haskell?
Asked Answered
S

2

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

Stigmatic answered 26/4, 2014 at 8:34 Comment(3)
What you are asking I guess is already supported by Yesod, see this: yesodweb.com/book/restful-contentBryant
@Bryant I don't think so, it talks about HTTP API using verbs. But I'm referring to something along the lines of HAL. And it is level 3 in REST maturity modelStigmatic
I advise anyone looking at this question to take the time to read that 'level 3' section in the link @Stigmatic posted, because this is a much more interesting question than it'd seem at first ("look at all these buzzwords!")Tulle
C
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!

Cabanatuan answered 2/12, 2016 at 1:28 Comment(0)
J
1

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.

Jacobinism answered 5/10, 2017 at 1:51 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.