Fork me on GitHub
#ring
<
2018-07-25
>
ikitommi07:07:57

@dcreno for spec, you need the 2.0 alpha. It’s alpha mostly because spec is too…

👍 4
David Reno15:07:07

I’m looking for a hello-world type compojure-api 2.0 example to start from. Can’t find it anywhere, only this which isn’t super helpful at my level: https://github.com/metosin/compojure-api/wiki/Migration-Guide-to-2.0.0 Any suggestions?

David Reno15:07:45

I should describe what I’m trying to do a little better… I understand and can use compojure-api but would like to start with spec instead of schema. I’m just intending to write an API service with integrated swagger docs.

ikitommi16:07:36

ok, there is a minimalistic sample at https://github.com/metosin/c2

ikitommi16:07:59

@dcreno there is also the reitit -library, that has spec & swagger. Like c-api, but fully data-driven. Disclaimer: I'm part of dev team for both libs. Example app here: https://github.com/metosin/reitit/tree/master/examples/ring-swagger

David Reno16:07:39

that c2 example is great. Any guidance on which to choose, compjure-api vs reitit? I want spec, swagger, an API that I can do async functions in when necessary, but generally low performance requirements (1000 requests/day).

ikitommi17:07:08

c-api is more proven, I might go with that. I think reitit is the future & with much better docs, but not all the batteries are there yet. Clojure Spec is still in alpha, and most likely will break the current contracts before finalizing. We try to keep the libs up with spec changes, but just remember it's alpha. Schema-support has been stable for years.

👍 4
henrik14:07:01

I’m encountering

java.lang.NoClassDefFoundError: javax/servlet/http/HttpServletRequest, compiling:(ring/middleware/multipart_params.clj:54:20)
` With any of the 4 latest versions of ring. Any ideas on how I can debug this one?

henrik15:07:57

@ikitommi I see, thank you. So the solution for the moment is for me to manually add the dep?

ikitommi16:07:59

@dcreno there is also the reitit -library, that has spec & swagger. Like c-api, but fully data-driven. Disclaimer: I'm part of dev team for both libs. Example app here: https://github.com/metosin/reitit/tree/master/examples/ring-swagger