Fork me on GitHub
#malli
<
2020-10-09
>
schmee00:10:25

@mac the equivalent is [:enum ...]

mac06:10:58

@schmee Ah, thanks.

ikitommi06:10:54

@dharrigan could have been a non-alpha, but was busy getting it out, so just alpha now. Grand goal is to get 1.0.0 out as soon as possible, after the final pieces (sequences, parsing, functions, default options) have been implemented, might effect the public api so that need to bump MAJOR. Most likely something that is easily migrated from pre-1.0.0.

ikitommi07:10:51

@mac there is a special type-schemas mechanism which would allow using using plain sets, but having too much shortcuts might make things harder to understand. There is already a such type shortcut for regexs, not sure if that was the right call:

#"\d+kikka"        ;; using the type-shortcut
[:re #"\d+kikka"]  ;; explicit
sets - besides :enum, there is :fn for any function.
[:enum "a" "b" "c"]
[:fn #{"a" "b" "c"}]
:enum doesn’t do type inferring atm, so you can hint the type so that JSON Schema, value transformation etc. work correctly:
[:and keyword? [:enum :kikka :kukka]]

dharrigan07:10:25

@ikitommi fantastic! Thank you for the update (and also the libraries, reitit and malli - super awesome sauce!)

mac07:10:41

@ikitommi Thanks, the reg-ex shortcut looks pretty idiomatic to me.

borkdude09:10:57

Are there any libs like cli-matic that use malli instead of spec for arg parsing/validation?

Toni Vanhala12:10:20

Today was supposed to be ClojuTRE 2020, but what we got was t-shirts with malli validation errors. Just put these fun little items to Metosin shop: https://shop.spreadshirt.net/metosin/

Lucas Félix17:10:30

hi! - sorry for my english - is there something like spec functions (https://clojure.org/guides/spec#_specing_functions) in malli? if not, what’s the motivation?

steveb8n22:10:52

@ikitommi I’m curious why you’ve stopped mentioning the multi-tenant validation capabilities of Malli. for me, this was the original reason for using it and the registry design is very well done