Fork me on GitHub
#reitit
<
2020-09-08
>
Faisal Hasnain13:09:58

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 Hasnain13:09:24

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

ikitommi14:09:09

:thinking_face:

ikitommi14:09:41

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

ikitommi14:09:18

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

Faisal Hasnain17:09:54

that did not work on latest version