reitit

https://cljdoc.org/d/metosin/reitit/ https://github.com/metosin/reitit/
ikitommi 2020-08-06T08:10:28.421300Z

@markbastian hi. Multipart uses normal string decoding, which doesn’t parse nested things that good, it seems. Can’t recall how you would do that with spec, but with malli, you can do;

{:parameters
 {:multipart [:map
              [:file reitit.ring.malli/temp-file-part]
              [:tags [:vector {:decode/string parse-string-to-vector} string?]]]}}

ikitommi 2020-08-06T08:13:36.423800Z

the data-spec syntax is good only for simple things, for anything else, you need to use full spec-tools. Something like:

(st/spec {:spec (s/coll-of int?), :decode/string ...})

ikitommi 2020-08-06T08:14:21.424800Z

also, feel free to poke the spec core team to add support for runtime transformations so we can sunset most of spec-tools 😉

👍 1
2020-08-06T13:10:28.425200Z

Sounds good, I'll check it out. Thanks!