malli

https://github.com/metosin/malli :malli:
steveb8n 2020-10-07T00:51:18.032Z

Q: is there a typo in the readme in the custom registry section? :post-int

steveb8n 2020-10-07T00:58:39.032800Z

Another one: is m/s-simple-schema a typo? This fn doesn’t exit

ikitommi 2020-10-07T04:45:22.034200Z

welcome @kari.marttila! first one definitely a typo, could not find the latter. But PR welcome to fix any typos.

steveb8n 2020-10-07T04:53:24.034500Z

ok. I’ll make a PR for both

steveb8n 2020-10-07T04:55:00.035Z

scratch that. I don’t know what you would use to replace the second one. I’ll PR for the typo

steveb8n 2020-10-07T04:55:23.035400Z

here’s the second one…

Custom registry
Example to create a custom registry without the default core predicates and with :bool and :pos-int Schemas:

(def registry
  (merge
    (m/class-schemas)
    (m/comparator-schemas)
    (m/base-schemas)
    {:bool (m/-simple-schema {:type :bool, :pred boolean?})
     :pos-int (m/-simple-schema {:type :pos-int, :pred pos-int?})}))

(m/validate [:or :bool :pos-int] 'kikka {:registry registry})
; => false

(m/validate [:or :bool :post-int] 123 {:registry registry})
; => true

steveb8n 2020-10-07T04:56:07.035900Z

m/-simple-schema doesn’t exist as a fn. I’m not sure what you would use instead

ikitommi 2020-10-07T05:10:19.036300Z

are you using the latest version?

steveb8n 2020-10-07T05:47:18.036500Z

ah, no. I’m not. sorry. my mistake

ikitommi 2020-10-07T12:52:05.038900Z

ok, plan is to ship 0.1.0 tomorrow. going to clean up some internals and polish some docs, but anything relevant missing? the GraalVM tests? https://github.com/metosin/malli/pull/272

🎉 4
ikitommi 2020-10-07T12:53:35.039900Z

also, removing :list as it’s not very useful, right?

steveb8n 2020-10-08T07:52:16.040700Z

I haven’t used it fwiw

👌 1