Fork me on GitHub
#malli
<
2021-08-14
>
andre.richards10:08:58

Hi, :uuid schema does not produce correct humanized error:

(me/humanize (m/explain :uuid "foo"))
=> ["unknown error"]
uuid? produces this:
(me/humanize (m/explain uuid? "foo"))
=> ["should be a uuid"]
uuid? has an entry in malli.error but :uuid does not, so it looks like an easy fix. Should I log a issue and raise a pull request?

ikitommi10:08:35

merged, thanks!

Vladislav11:08:47

Hi! It’s no option to assoc key with parameters (optional etc.) to schema hm for now, i’m right? I’m forced to use merge for that

ikitommi13:08:25

@shishkov61 You can use a vector to assoc full entry, not at computer, but this should work: (mu/assoc :map [:x {:optional true}] :int)

Vladislav13:08:01

i’ll try it. thanks!

Vladislav20:08:05

(m/validate 
  [:map [[:set string?] number?]] 
  {#{"a"} 1})
=> false
should it be like this?

Vladislav21:08:48

actually, i don't see no docs about maps with keys which is not static values

Vladislav21:08:37

should i use :registry specified schemas for keys?:thinking_face:

Vladislav21:08:49

no, guess i'd found it, but it works another way https://github.com/metosin/malli#qualified-keys-in-a-map

Vladislav21:08:01

o! map-of kinda work for that. but it will be complicated if there is no homogeneous keys needed