Hi. About the documentation - at least ring-swagger[1] doesn't force you to use Schema as the runtime validation library, it just expects the route (and parameter) definitions to be presented to it as Schemas. So, you could validate the routes using bouncer and extract the ring-swagger schemas out of those just for documentation purposes [2,3]. Another option would be to write directly bouncer -> swagger json schema mappings. Or ring-swagger could be made to support different parameter formats (native swagger, json schema, bouncer) via protocol extensions.
[1] https://github.com/metosin/ring-swagger [2] https://github.com/metosin/ring-swagger/blob/master/src/ring/swagger/swagger2_schema.clj [3] https://github.com/metosin/ring-swagger/blob/master/test/ring/swagger/swagger2_test.clj tiistai 23. kesäkuuta 2015 11.33.50 UTC+2 Mike Grabowski kirjoitti: > > Hey guys, > > I am so excited to join Clojure bandwagon, last weeks have been super > exciting, pretty much in love with Clojure syntax. As we are currently > building an application broken into smaller micro services, I thought I am > gonna make one or two Clojure based modules. Although the initial purpose > of picking the language was to do some CPU demand calculations and data > processing, I found it really simple yet enjoyable to write REST api as > well (we also use Node.js and Elixir for that purpose and it works pretty > well - especially with Elixir thanks to awesome yet simple Erlang model > where you can `spawn&block` and be happy). > > I've seen lots of benchmarks already featuring Aleph, Jetty, Vert.x and > other HTTP servers and I am currently with `Aleph` thanks to its ability to > handle channels and futures out of the box. Unfortunately, because I spent > so many years with Node.js and stopped using Java ages ago, I just can't > stop thinking about non-blocking evented IO interactions. It just does not > feel right to me to block the thread when e.g. logging in an user. > Unfortunately, there are no NIO drivers for the database engines I am > interested in (Neo4J, Mongo) so async channels are not the way to go. > > Any advices or interesting thoughts? Maybe I am missing something as I am > not entirely sure if evented IO is always speeding up the overall > performance. Any performance optimisations are welcome. I am especially > unhappy with one Neo4J request that takes 1.5 second to finish (it's only > because the database is hosted on free Heroku plan and this is not going to > happen in production but I find it quite a good place to tweak the > optimisations and concurrency). > > Another question is - is there any documentation generator that can parse > your comments, take keywords like `:params` or `:returns` (just the idea) > and generate beautiful API docs out of the box? Swagger is not a way to go > as it requires me to use `Schema` plugin - I am currently with `bouncer` > thanks to more real-life validators as well as user friendly messages that > I can just print to users out of the box (maybe it's worth building as an > open source module then) > > Thanks > > -- 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/d/optout.