@jmckitrick the docs are really lame at the moment. Would need a full rewrite. Sadly, too busy to do that atm. If someone has good idea (and time :)) how to rewrite a good docs site, we are all ears.
@jmckitrick what errors do you get from Luminus? Could you publish a small example site to github?
back from vacation, could check what’s up with that.
and the alpha-19
is out for compojure-api, few merged PRs for async coercion, spec-tools integration etc.
@ikitommi Good to hear from you! Let me try my branch again with alpha-19
So I’m starting with a Luminus base with services
declared. But to get everything to compile, I’m commenting out most of that namespace.
If I understand correctly, I should not use defapi
anymore, correct?
yes, that’s removed. Just functions + support for the current Compojure macros.
Is https://github.com/metosin/compojure-api/wiki/Migration-Guide-to-2.0.0 still accurate ATM?
I’m coming from plain-vanilla compojure, and I want to get to compojure-api with spec validation. So I need to skip a step, I think.
ping @miikka for the migration docs
Ah, they should be approximately correct, but I should go through them and check that they're up to date. I'll try to do it later today/tomorrow.
Specifically, there are broken links in the Wiki for ‘Apis & Options’ and ‘Authentication and authorization’
The migration docs seem ok so far.
Basically, I want a platform for Clojure web services and apps for a new Clojure team, and I’d like it to work with spec. Which it does now. When would I need the more advanced features, like Muuntaja offers?
If you need to transfer data via request & response body, you need some soft of transformer. Muuntaja is just one of those, a fast one and pre-integrated with c-api.
I think https://github.com/metosin/c2 is kind of bare-bones sample with spec.
So with plain compojure, this has all been handled by ring middleware, I assume?
yes, usually. Unless you encode & deocode the body manually in each route.
with things like https://github.com/ring-clojure/ring-json or https://github.com/ngrunwald/ring-middleware-format
c-api bundles a set of middleware by default: body-encoding&decoding (via Muuntaja) and generic exception handling.
btw, there is a example for spec also in the reitit-repo: https://github.com/metosin/reitit/blob/master/examples/ring-example/src/example/spec.clj. Where compojure-api builds on top of Compojure and has lot of “easy” helpers, reitit is just a naked data-driven router without surpises (with coercion). Most likely c-api will internally use reitit for 2.0.0 final (soon). But reitit can be used on it’s own, for those who like to be in control of everything (and want to compose their own stuff).
does not do swagger yet, need to port stuff to ClojureScript first.
umm, how stable is compojure-api 2 so far?