ring-swagger

ring-swagger & compojure-api
petr.mensik 2018-10-22T14:17:59.000100Z

Is there a way how to ensure that some middleware is always called as a first one? I want to use this middleware which transforms data from API Gateway to Compojure API inside AWS Lambda function - and the docs specifically says that this middleware has to be first https://github.com/mhjort/ring-apigw-lambda-proxy

petr.mensik 2018-10-22T14:18:45.000100Z

I would also appreciate any other hints about integration of Lambda and compojure-api, just started to do it and it seems like it won't be that easy 🙂

ikitommi 2018-10-22T14:26:09.000100Z

@petr.mensik wrap the top-level handler into the mw, e.g. (wrap-apigw-lambda-proxy app) where the app is you normal ring-app.

petr.mensik 2018-10-22T14:26:46.000100Z

@ikitommi nice, thanks 🙂

ikitommi 2018-10-22T20:15:06.000100Z

[metosin/compojure-api "2.0.0-alpha27"] is out with the new spec-tools & coercion, e.g. > Better spec coercion via st/coerce using spec walking & inference: many simple specs (core predicates, spec-tools.core/spec, s/and, s/or, s/coll-of, s/keys, s/map-of, s/nillable and s/every) can be transformed without needing spec to be wrapped. Fallbacks to old conformed based approach.