I was inches away from reinventing something like this for our company's codebase. Maybe you saved us the trouble :-).
Will definitely check it out. On Sun, Feb 16, 2014 at 3:20 PM, Tommi Reiman <tommi.rei...@gmail.com>wrote: > Hi all. > > We here at Metosin have been developing and using a bunch of small > utilities for Ring-based web api development. Here they are: > > *1) ring-http-response *(https://github.com/metosin/ring-http-response) > > Real http status codes for Ring - ported from Spray[1]. There is a > response function for most of the http-statuses available (ok, found, > not-found,...) taking either a body, url or nothing as a parameter. In > addition, for all erroneous responses there is a exception throwing version > with '!' in the end (bad-request!, not-found!,...). There is also a > middleware for catching these response exceptions and returning the thrown > http-response instead. Namespace *ring.util.http-response* can be used to > replace the original *ring.util.response*. > > Should be stable. > > *2) ring-swagger* (https://github.com/metosin/ring-swagger) > > We wanted there to be a standalone Swagger[2] implementation for Ring, not > tied to the used routing library. There is already Swag[3] and > Octohipster[4], but both have strong opinions about routing. Ring-Swagger > is integrated with Prismatic Schema for data modeling & coercing (should it > support other validation libs also?). Offers a simple map-based api for > routing & other higher level web libs to publish their routes. > > There is an adapter for Compojure on top of this, more later. > > Would be fun to other routing/web libs adapt to this too (should be quite > straightforward to collect routes from bidi for example) > > Not yet feature complete. All feedback & Pull Requests welcome. > > *3) ring-swagger-ui* (https://github.com/metosin/ring-swagger-ui) > > Maven-packaged version of the Swagger-UI[5]. Follows the version numbers > of the original npm packages (permission to publish as maven artifact from > the Reverb guys, thanks guys!). Has some small changes in the ui. All stuff > can be overridden locally (mainly the index page). > > *4) compojure-api* (https://github.com/metosin/compojure-api) > > Originally was supposed to be just compojure-swagger, but added other > stuff to make life of an web api development easier. Everything can be used > separately, but there is also a *compojure.api.sweet* package, which can > be used as a single entry point to the library. > > Basic Swagger-functionality works with vanilla Compojure but to enable all > features (better way to setup route meta-data, schema-aware body > destructuring, return schemas etc.), there is a extended api, with '*' in > the name of the http-methods (GET*, POST*). Currently the extended api is > also sitting on top of Compojure and internally overrides a compile-route > function from *compojure.core* to enable easy way to add meta-data to > routes. Thinking of re-implementing the new api directly on top of Clout > instead of trying to sit on top of the (otherwise awesome) Compojure. > > Currently work in progress. Acts also as a demo how to use & bind together > the underlying more stable libs (ring-http-response, ring-swagger > &ring-swagger-ui). > > *5) compojure-api-examples* ( > https://github.com/metosin/compojure-api-examples) > > A sample minimalistic project to see things in action and to start > creating schema-aware documented web apis. > > ... > > Hopefully some of the stuff is found useful, on both Github & Clojars. We > are using (and developing) these anyway with our projects. Also waiting > eagerly for the @PrismaticEng next web thingie coming out soon(?), whether > these libs complement or overlap each other. > > Would appreciate your comments and thoughts on the concepts or the code. > Either here or via email: first-name (at) metosin.fi or ikitommi at > freenode & twitter. > > regards, > > Tommi > > -- > > [1] http://spray.io > [2] https://github.com/wordnik/swagger-core/wiki > [3] https://github.com/narkisr/swag > [4] https://github.com/myfreeweb/octohipster > [5] https://github.com/wordnik/swagger-ui > > -- > You received this message because you are subscribed to the Google > Groups "Clojure" group. > To post to this group, send email to clojure@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+unsubscr...@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+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/groups/opt_out. > -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@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+unsubscr...@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+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.