reitit

https://cljdoc.org/d/metosin/reitit/ https://github.com/metosin/reitit/
Faisal Hasnain 2020-09-08T13:30:58.047600Z

does anyone having ideas about how to allow vector/array for POST body requests using spec coercion:

(s/def ::body (s/coll-of string?))

(def routes
  ["/api"
   ["/engagements"
    {:post {:parameters {:body ::photos}}}]])
right now there is some implicit spec which is forcing the body to be a map. any ways to override that?

Faisal Hasnain 2020-09-08T13:57:24.048200Z

never mind, i need to specify spec as vector [::photos]

ikitommi 2020-09-08T14:06:09.048400Z

:thinking_face:

ikitommi 2020-09-08T14:06:41.049300Z

oh, that's because the spec-coercion accepts both normal specs and data-specs.

ikitommi 2020-09-08T14:07:18.050500Z

you can also say (s/coll-of ...) with normal specs

Faisal Hasnain 2020-09-09T17:58:54.052100Z

that did not work on latest version