Fork me on GitHub
#reitit
<
2018-10-16
>
thiru02:10:31

I can't seem to figure out why my matched route's view is always nil

thiru02:10:38

Here's my router:

thiru02:10:07

`(def routes (rf/router [["/" {:name ::home :view home-page/root-ui}] ["/about" {:name ::about :view about-page/root-ui}] ["/login" {:name ::login :view login-page/root-ui}] ["/item/:id" {:name ::item :view item-page :parameters {:path {:id s/Int} :query {(s/optional-key :foo) s/Keyword}}}]] {:data {:coercion rsc/coercion}}))`

thiru02:10:32

the home and about routes work, but not login

thiru02:10:50

the route matches but the view is always nil

valerauko13:10:38

@ikitommi was parameter validation changed to allow the param route data hashmap keys to be strings?

ikitommi17:10:02

thanks @vale! merged both PRs in.

đź‘Ť 4
ikitommi17:10:28

@alex340 By looking at the code (https://github.com/metosin/reitit/blob/master/modules/reitit-spec/src/reitit/coercion/spec.cljc#L120-L135), it seems that the response coercion is called the same way as request coercion.

ikitommi17:10:11

oh, true that that it doesn’t call the st/encode, but same as the request coercion doesn’t call st/decode - but the code is effectively the same, just inlined.

ikitommi17:10:32

@thiru0130 looks correct, maybe something wrong with the login-page/root-ui?