This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-07-04
Channels
- # aleph (1)
- # aws-lambda (2)
- # beginners (30)
- # boot (2)
- # cider (7)
- # cljs-dev (65)
- # clojure (130)
- # clojure-denmark (1)
- # clojure-france (1)
- # clojure-germany (2)
- # clojure-greece (1)
- # clojure-italy (19)
- # clojure-kc (2)
- # clojure-nl (12)
- # clojure-poland (1)
- # clojure-russia (11)
- # clojure-spain (1)
- # clojure-spec (20)
- # clojure-uk (176)
- # clojurescript (65)
- # css (3)
- # cursive (8)
- # datomic (26)
- # editors (94)
- # emacs (10)
- # fulcro (66)
- # graphql (5)
- # midje (1)
- # off-topic (48)
- # om-next (2)
- # overtone (1)
- # re-frame (15)
- # reagent (6)
- # reitit (10)
- # shadow-cljs (68)
- # sql (3)
@yogthos I think that would be the most familiar syntax, and it would be easy to implement.
Still, the one needs to add the :consumes
content-type tip for apidocs so it (only?) takes the multipart-requests.
currently, the middleware can't emit route data, so needs to be defined explicitely. There is an issue of that, but nit sure if that (mw emitting route data) is a good idea.
also, I like that the body would always be parsed into :body
params, as there can be only one body in a request. Reading body from :multipart
or :body
depending on the content-type feels like a extra thing to remember.
the multipart in the suggested format could be a standalone mw:
1) data-driven mw, with a :compile
hook, checking if a [:parameters :multipart]
and :coercion
is defined, otherwise not mounting
2) compile a :string
coercer for the model, without the TempFileUpload
s
3) do the multipart-thing and parameter coercion at request-processing time
.. could be safely added to all routes. I think the ability to compile & conditionally unmout a mw is a really good feature.
here's the issue btw: https://github.com/metosin/reitit/issues/34