Fork me on GitHub
#reitit
<
2018-04-21
>
ikitommi12:04:22

@grierson data-specs are described in https://github.com/metosin/spec-tools/blob/master/README.md#data-specs. I think it's: {:query {(ds/opt :x) int?}

ikitommi12:04:57

same with normal spec:

(clojure.spec.alpha/def ::x (spec-tools.core/spec int?))

{:parameters {:query (s/keys :opt-un [::x])}}

ikitommi12:04:55

e.g. just need to wrap the leaf specs so that the runtime conforming works.

grierson21:04:54

Thanks, just worked out where I’m going wrong. I need to convert my :query-param map from string keys to keyword keys.

grierson21:04:58

Or get Reitit to coerce the :params key instead.

grierson21:04:54

Fixed - I needed to reorder my middleware so that wrap-params came before the coerce.