Fork me on GitHub
#malli
<
2022-10-11
>
robert-stuttaford10:10:46

has anyone had a go at writing malli specs with https://github.com/lambdaisland/regal ? what i like about this is that it makes the regex a little more self-documenting edit: nevermind, there's a malli section right in the readme!

👍 1
ikitommi15:10:08

I haven’t updated the Regal-side in some time. please update if the integration is out-of-date

Nikolas Pafitis18:10:01

Hi I have a schema that looks like this

[:map 
  ...
  [:timeline-type [:enum :reactive :proactive-actual :proactive-alternative]]]
And I'm trying to use this schema with malli coercion to coerce the query params, now from the frontend i send this timeline-type as a string (obviously as it's in the query string) but it's not coerced to a keyword. Is there some option for :enum (or any other type for that matter) that I can specify a specific coercer for reitit. For example something like:
[:enum {:malli.coerce/coerce-as :keyword} :reactive :proactive-actual :proactive-alternative]
or something along those lines? Or what else could I do here.

ikitommi15:10:08

Hi. There is an issue for resolving the real type from schemas, see https://github.com/metosin/malli/issues/264. Before that, you can use :and -> [:and :keyword [:enum :reactive :proactive-actual :proactive-alternative]]

1
Hankstenberg19:10:06

Hi guys, quick question: If I run m/walk in clojurescript like this: (m/walk [:map [:id string?]] (m/schema-walker identity) I'm getting back a "#object[malli.core.t_malli$core35871]" instead of the vector I put in. What can I do with this object?

1
dvingo20:10:02

try passing it to (malli.core/form to get the vector out if that's what you want

Hankstenberg04:10:14

Oh, okay now I get it thanks!

👍 1