This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-08-24
Channels
- # announcements (3)
- # beginners (128)
- # boot (2)
- # braveandtrue (97)
- # calva (13)
- # cider (4)
- # cljdoc (12)
- # cljs-dev (16)
- # clojure (78)
- # clojure-germany (8)
- # clojure-italy (5)
- # clojure-nl (1)
- # clojure-spec (59)
- # clojure-uk (29)
- # clojurescript (46)
- # core-async (9)
- # cursive (63)
- # data-science (3)
- # datomic (22)
- # devcards (1)
- # duct (7)
- # emacs (4)
- # flambo (2)
- # fulcro (37)
- # instaparse (6)
- # jobs-discuss (38)
- # juxt (1)
- # off-topic (35)
- # om-next (1)
- # parinfer (7)
- # re-frame (14)
- # reagent (6)
- # reitit (21)
- # rum (1)
- # shadow-cljs (74)
- # spacemacs (8)
- # specter (1)
- # sql (3)
- # testing (2)
- # unrepl (2)
- # yada (6)
Hi all, is there an idiomatic way to deal with query parameters in reitit?
@levitanong yes, there should be. for frontend, there is the reitit.frontend
to help parsing the urls, for ring you need something like wrap-params
mw from ring + coercion.
backend example: https://github.com/metosin/reitit/blob/master/examples/ring-swagger/src/example/server.clj
reitit.frontend
is exactly what i was looking for! thanks! though it seems to be missing the respective match-by-name
functionality
So there’s match-by-path
, which can parse the query string part and turn it into a map
oh wait, nevermind, i realize that’s a nonsensical usecase
* i realize it would be a nonsensical use case to have a match-by-name
that can take not only the route name and route params, but also query params
https://metosin.github.io/reitit/basics/name_based_routing.html <-- in the end example
@levitanong Check reitit.frontend.history
and reitit.frontend.easy
for href
function
@ikitommi @juhoteperi yeah, match->path
would do it! Any chance that the latest commit by deraen would be pushed into snapshot? -get-path
is broken in the current artifact, and 82ad1fa fixes it
@ikitommi just deleted cache and redownloaded. It is indeed in!
so glad i can finally get rid of kibu/pushy
Is there an easy way to get rid of the swagger validator? I'm deploying to an internal server and it is showing an error - not worth a lot of work to fix, just kind of an annoyance.
@shaun-mahood yes, there is. You can pass any swagger-ui config parameters (https://github.com/swagger-api/swagger-ui/tree/2.x#parameters) to create-swagger-ui-handler
under the :config
key. with reitit 0.2.*, you say:
(swagger-ui/create-swagger-ui-handler
{:config {:validatorUrl nil})
pre 0.2.0 has a bug in handling the keys, with that you need to say :validator-url nil
.
added the :validatorUrl
to the example app too (https://github.com/metosin/reitit/blob/master/examples/ring-swagger/src/example/server.clj#L78-L80)