This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-02-25
Channels
- # announcements (5)
- # beginners (74)
- # boot (5)
- # cider (57)
- # cljdoc (5)
- # cljs-dev (45)
- # clojure (37)
- # clojure-dev (6)
- # clojure-europe (4)
- # clojure-italy (17)
- # clojure-nl (11)
- # clojure-spec (48)
- # clojure-uk (96)
- # clojurescript (79)
- # cursive (17)
- # data-science (1)
- # datomic (27)
- # emacs (2)
- # fulcro (22)
- # immutant (1)
- # java (62)
- # juxt (4)
- # kaocha (4)
- # lein-figwheel (5)
- # leiningen (6)
- # midje (1)
- # mount (1)
- # music (3)
- # nrepl (6)
- # off-topic (49)
- # pathom (10)
- # pedestal (2)
- # re-frame (43)
- # reagent (2)
- # ring (2)
- # shadow-cljs (78)
- # spacemacs (6)
- # test-check (2)
- # tools-deps (4)
this is what i got with spec (not schema):
;; file upload
(s/def ::filename spec/string?)
(s/def ::content-type spec/string?)
(s/def ::size spec/int?)
(s/def ::tempfile #(instance? File %))
(s/def ::file (st/spec {:spec (s/keys :req-un [::filename ::content-type ::size]
:opt-un [::tempfile])
:json-schema/type "file"}))
(POST "/file" []
:summary "post a file"
:multipart-params [file :- ::file]
:return ::any?
:middleware [multipart/wrap-multipart-params]
(ok (do (println file)
(dissoc file :tempfile))))