This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-11-24
Channels
- # arachne (1)
- # bangalore-clj (11)
- # beginners (177)
- # boot (63)
- # business (1)
- # cljsjs (21)
- # cljsrn (3)
- # clojars (4)
- # clojure (116)
- # clojure-art (4)
- # clojure-belgium (3)
- # clojure-india (1)
- # clojure-italy (6)
- # clojure-russia (14)
- # clojure-spec (8)
- # clojure-uk (67)
- # clojurescript (51)
- # community-development (5)
- # cursive (13)
- # datascript (14)
- # datomic (29)
- # devcards (3)
- # emacs (3)
- # events (3)
- # funcool (4)
- # hoplon (29)
- # mount (6)
- # om (34)
- # om-next (5)
- # onyx (16)
- # perun (8)
- # planck (22)
- # re-frame (13)
- # reagent (5)
- # ring-swagger (21)
- # rum (3)
- # spacemacs (3)
- # specter (1)
- # untangled (39)
Is it possible to send a GET request to compojure-api like this: /foo?terms[0]=a&terms[1]=b and have it destructured as a query param terms of type vector of string?
I think it should work without []
ah yeah
There is no option to change this
Or hmm... I guess you could use custom middleware to strip those []
from query param names
If I recall correctly, the default middleware will just name the keys in request query-params e.g. :terms[]
https://github.com/ring-clojure/ring/blob/master/ring-core/src/ring/middleware/nested_params.clj perhaps
@borkdude try adding :middleware [ring.middleware.nested-params/wrap-nested-params] ...)
to your API options
Not sure if that works with [0] and [1] but should work with terms[]
Yeah, that's what we use often if we need complex options 🙂