This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-02-01
Channels
- # announcements (11)
- # babashka (71)
- # beginners (34)
- # calva (25)
- # chlorine-clover (38)
- # cider (13)
- # clj-kondo (1)
- # cljsrn (2)
- # clojure (40)
- # clojure-australia (4)
- # clojure-europe (16)
- # clojure-france (3)
- # clojure-nl (4)
- # clojure-uk (16)
- # clojurescript (27)
- # conjure (2)
- # core-async (41)
- # core-logic (3)
- # cursive (1)
- # data-science (1)
- # datomic (16)
- # depstar (19)
- # emacs (7)
- # fulcro (33)
- # graalvm (4)
- # honeysql (20)
- # hugsql (4)
- # jobs (1)
- # juxt (4)
- # off-topic (48)
- # pathom (41)
- # reagent (9)
- # reitit (19)
- # remote-jobs (1)
- # shadow-cljs (20)
- # startup-in-a-month (2)
- # tools-deps (29)
- # vim (3)
- # xtdb (30)
I would like to utilize comma-separated query parameters instead of repeating the key for each element, i.e. ?foo=bar,baz
instead of ?foo=bar&foo=baz
. I haven't been able to find any configuration option or obvious examples over a few Google queries. Does anyone have any experience with trying this? Or should I just accept the defaults as they are 😅
(def paging [:map
{:closed true}
[:limit {:optional true :default 25} [:int {:min 0 :max 100}]]
[:page {:optional true :default 0} [:int {:min 0 :max 500}]]
[:sort {:optional true} [:enum {:swagger/type "string"} "asc" "desc"]]
[:sort-fields {:optional true} string?]
[:fields {:optional true} string?]])
(let [{{{:keys [ fields]} :query} :parameters} request]
{:fields (when-not (clojure.string/blank? fields) (clojure.string/split fields ",")}
okay, I figured something like that would work, I was just hoping there was a built in way to have reitit coerce things nicely just in [:parameters :query]