Fork me on GitHub
#reitit
<
2018-08-24
>
levitanong06:08:45

Hi all, is there an idiomatic way to deal with query parameters in reitit?

ikitommi06:08:40

@mkvlr pushed the master (SNAPSHOT)

🙏 4
ikitommi06:08:11

@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.

levitanong06:08:27

reitit.frontend is exactly what i was looking for! thanks! though it seems to be missing the respective match-by-name functionality

ikitommi06:08:27

what kinf of match-by-name there should be?

levitanong06:08:06

So there’s match-by-path, which can parse the query string part and turn it into a map

levitanong06:08:30

oh wait, nevermind, i realize that’s a nonsensical usecase

levitanong06:08:25

* 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

ikitommi07:08:39

would reitit.core/match->path do it?

juhoteperi07:08:30

@levitanong Check reitit.frontend.history and reitit.frontend.easy for href function

levitanong07:08:41

@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

ikitommi08:08:04

deployed this morning, sure it’s not in?

levitanong08:08:32

@ikitommi just deleted cache and redownloaded. It is indeed in!

levitanong08:08:05

so glad i can finally get rid of kibu/pushy

shaun-mahood15:08:00

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.

ikitommi15:08:46

@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})

ikitommi15:08:13

pre 0.2.0 has a bug in handling the keys, with that you need to say :validator-url nil.

shaun-mahood15:08:12

@ikitommi: Thanks, I'm using the latest snapshot so that will be perfect!

👌 4