ring-swagger

ring-swagger & compojure-api
ikitommi 2018-03-14T11:42:12.000306Z

@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.

ikitommi 2018-03-14T11:43:03.000019Z

@jmckitrick what errors do you get from Luminus? Could you publish a small example site to github?

ikitommi 2018-03-14T11:43:13.000026Z

back from vacation, could check what’s up with that.

ikitommi 2018-03-14T11:43:58.000083Z

and the alpha-19 is out for compojure-api, few merged PRs for async coercion, spec-tools integration etc.

jmckitrick 2018-03-14T11:46:44.000024Z

@ikitommi Good to hear from you! Let me try my branch again with alpha-19

jmckitrick 2018-03-14T11:57:03.000308Z

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.

jmckitrick 2018-03-14T11:57:17.000167Z

If I understand correctly, I should not use defapi anymore, correct?

ikitommi 2018-03-14T11:58:52.000013Z

yes, that’s removed. Just functions + support for the current Compojure macros.

jmckitrick 2018-03-14T11:59:33.000233Z

Is https://github.com/metosin/compojure-api/wiki/Migration-Guide-to-2.0.0 still accurate ATM?

jmckitrick 2018-03-14T12:00:47.000393Z

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.

ikitommi 2018-03-14T12:01:19.000026Z

ping @miikka for the migration docs

miikka 2018-03-14T12:17:21.000365Z

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.

jmckitrick 2018-03-14T13:03:51.000367Z

Specifically, there are broken links in the Wiki for ‘Apis & Options’ and ‘Authentication and authorization’

jmckitrick 2018-03-14T13:04:01.000603Z

The migration docs seem ok so far.

jmckitrick 2018-03-14T13:39:44.000471Z

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?

ikitommi 2018-03-14T13:46:50.000518Z

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.

ikitommi 2018-03-14T13:47:41.000030Z

I think https://github.com/metosin/c2 is kind of bare-bones sample with spec.

jmckitrick 2018-03-14T13:55:59.000759Z

So with plain compojure, this has all been handled by ring middleware, I assume?

ikitommi 2018-03-14T14:15:15.000387Z

yes, usually. Unless you encode & deocode the body manually in each route.

ikitommi 2018-03-14T14:18:58.000459Z

c-api bundles a set of middleware by default: body-encoding&decoding (via Muuntaja) and generic exception handling.

ikitommi 2018-03-14T14:40:41.000247Z

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).

ikitommi 2018-03-14T14:41:48.000368Z

does not do swagger yet, need to port stuff to ClojureScript first.

jmckitrick 2018-03-14T16:04:55.000681Z

So @ikitommi @miikka I’m willing to help with docs.

logistark 2018-03-14T16:12:39.000324Z

umm, how stable is compojure-api 2 so far?