Fork me on GitHub
#reitit
<
2019-09-19
>
ikitommi05:09:46

@ccann contents of :compile are merged to the root middleware data. If :compile returns nil, the middleware is unmounted for the route. This mean that the :spec requirement is not present either. See https://github.com/metosin/reitit/blob/master/modules/reitit-ring/src/reitit/ring/coercion.cljc#L21-L43 as a commented example

ikitommi05:09:11

you can always ask the compiled routes from a router/ring-handlee to see what is the result after compilation. Would be nice to have a visualization (web-dev-ui) for this.

ccann14:09:20

thanks, yeah so in this case i think I’ll just mount the middleware no matter what and have it produce a sane default in the case where the key itself is missing which will throw the route compilation exception anyway