Comparing and selecting web API libraries

311 views
Skip to first unread message

Jonathon McKitrick

unread,
Mar 8, 2018, 11:14:50 AM3/8/18
to Clojure
I’m looking at Liberator for our first web API project. But I’m also considering Compojure-API and Yada. Any thoughts from anyone who’s done this comparison, or has used one of them?

Erik Assum

unread,
Mar 8, 2018, 11:28:54 AM3/8/18
to clo...@googlegroups.com
Hi, 

On my current project, we’re using compojure with liberator. It works, but there are a few down sides as far as I can see:
Compojure is opaque, eg the routing is expressed using functions/macros, where as other routing libs like bidi and reitit
(https://github.com/metosin/reitit) express the routing as data. Also, AFAIK compojure is not bi-directional, if that’s a need you have.
Compojure doesn’t offer coercion/swagger out of the box, but compojure-api fixes that.

Another thing to be aware of is schema vs spec support. Compojure-API has support for both.

As for liberator vs yada, I have noe clear opinion.

Erik.

On 8 Mar 2018, at 17:14, Jonathon McKitrick <jmcki...@gmail.com> wrote:

I’m looking at Liberator for our first web API project. But I’m also considering Compojure-API and Yada. Any thoughts from anyone who’s done this comparison, or has used one of them?

--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clo...@googlegroups.com
Note that posts from new members are moderated - please be patient with your first post.
To unsubscribe from this group, send email to
clojure+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to the Google Groups "Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clojure+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

jmcki...@gmail.com

unread,
Mar 8, 2018, 11:40:53 AM3/8/18
to clo...@googlegroups.com
So it sounds like your choice would be compojure-api, correct?

You received this message because you are subscribed to a topic in the Google Groups "Clojure" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/clojure/Jic0ijhdTEI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to clojure+u...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
--
Jonathon McKitrick

Erik Assum

unread,
Mar 8, 2018, 12:19:51 PM3/8/18
to clo...@googlegroups.com
As always, the answer is it depends. 
If I were to greenfield some personal project now, I’d probably go with bidi, since I’d probably just end up with two endpoints. One for accepting graphql queries and one for accepting commands. 

At work there is always more requirements, like development speed and maturity which would probably guide me to using compojure-api, the probably safe and boring bet. 

Erik. 
-- 
i farta

Joe R. Smith

unread,
Mar 8, 2018, 12:38:32 PM3/8/18
to clo...@googlegroups.com
Definitely give Pedestal a look. There is also wonderful Lacinia integration (a Clojure GraphQL library). 

Daniel

unread,
Mar 8, 2018, 7:41:29 PM3/8/18
to Clojure
Yogthos has done an excellent job with luminus-template (https://github.com/luminus-framework/luminus-template).

Sets everything up how I would. Usually just need +<db> +jetty +reagent (if writing a SPA) +auth (if doing user accounts).

So far it's been a good diving board. I'm on my second in-house project and have been able to incorporate everything so far ... I think because it's fairly unopinionated.

Oliver Hine

unread,
Mar 9, 2018, 12:18:37 PM3/9/18
to Clojure
Pedestal also has support for Swagger (along with coercion, validation, serialisation and more) via pedestal-api
https://github.com/oliyh/pedestal-api

Daniel Compton

unread,
Mar 12, 2018, 3:47:45 PM3/12/18
to clo...@googlegroups.com
If you're looking at Liberator because of how it lets you write applications that implement much of the HTTP spec then I would suggest also looking at Yada. It was written by Malcolm Sparks (who also contributed to Liberator), and takes HTTP spec compliance very seriously. It gives you a lot of leverage for providing a small resource definition.

On Sat, Mar 10, 2018 at 6:18 AM Oliver Hine <oliy...@gmail.com> wrote:
Pedestal also has support for Swagger (along with coercion, validation, serialisation and more) via pedestal-api
https://github.com/oliyh/pedestal-api

Reply all
Reply to author
Forward
0 new messages