This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-07-02
Channels
- # aleph (1)
- # architecture (4)
- # beginners (39)
- # boot (12)
- # cider (25)
- # cljs-dev (3)
- # cljsrn (5)
- # clojure (175)
- # clojure-dusseldorf (1)
- # clojure-italy (13)
- # clojure-nl (4)
- # clojure-russia (1)
- # clojure-spec (52)
- # clojure-uk (110)
- # clojurescript (35)
- # data-science (2)
- # datomic (61)
- # editors (8)
- # emacs (2)
- # fulcro (7)
- # graphql (15)
- # hoplon (1)
- # hyperfiddle (3)
- # jobs (4)
- # jobs-discuss (12)
- # juxt (2)
- # lein-figwheel (6)
- # leiningen (35)
- # off-topic (4)
- # onyx (5)
- # parinfer (1)
- # pedestal (63)
- # re-frame (38)
- # reitit (7)
- # ring-swagger (7)
- # rum (2)
- # shadow-cljs (27)
- # tools-deps (10)
- # uncomplicate (16)
@vale depends on the coercion model you are using. There could be more examples on the docs. PRs welcome. Some samples:
;; schema
(require '[schema.core :as s])
:query {:x s/Int, (s/optional-key :y) s/Int}
;; data-specs
(require '[spec-tools.data-spec :as ds])
:query {:x int?, (ds/opt :y) int?}
;; clojure.spec
(require '[clojure.spec.alpha :as sa])
(require '[spec-tools.spec :as spec])
(sa/def ::x spec/int?)
(sa/def ::y spec/int?)
:query (sa/keys :req-un [::x] :opt-un [::y])
... should all do the same.
@yogthos no helpers currently in reitit for upload (or download), I think there should be, in reitit-ring
module. Ideas welcomr on what would be a easy syntax to define those.
Currently, one can use the normal ring middleware for multipart, but I think we can do better.
1) the schemas for multipart for schema & spec
2) mw to read the params for multipart/form-data
(could be a format in Muuntaja?
3) data-driven syntax to pull the params, maybe after rhe openapi3 additions?
:content {"multipart/form-data" {:body {:name string?, :file file?}}}
the 3rd explained: for the multipart-endpoints, there is only one content-type allowed, Muuntaja format parses that (and emits the openapi-docs).
Weird, if I add :compile reitit.coercion/compile-request-coercers
to my ring router, all my responses become 405
code.