@jmckitrick closures in the top-level like this:
(defn app [{:keys [db] :as system}]
(api
(GET "/users" [] (ok (user/get-users db))
(more-routes system)))
old way was to add :components
into api-options and use the :components
to extract that at runtime. I think we could remove that for 2.0.0 as a not-good-idea.
What was the problem with that approach? @ikitommi
@ikitommi wanting to pick your brains; I keep thinking that in #compojure-api 2.+, defaults for :compojure.api.exception/request-validation
should be 400 not 500, since if one specifies a spec/schema for e.g: :query-params
and they fail to validate, i think that's a client error? thinking that default of 500 for :compojure.api.exception/response-validation
makes sense, since the server is always responsible for the response... except that if you want to attach the failing spec for validation-error to the response.... :thinking_face:
What do you all know about ‘pact’ testing?