-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pluggable validation? #13
Comments
The thing that makes spec integrate so well is the fact that specs and o'doyle attributes are both qualified keywords, so i can associate them together without any extra code. Not sure how to do this using libraries like malli since it doesn't use qualified keywords in this way. You could define spec functions that use malli inside them though. For example... ;; normal spec
(s/def ::x number?)
(s/def ::y number?)
(s/def ::position (s/keys :req-un [::x ::y]))
;; spec using malli to validate
(def Position [:map [:x number?] [:y number?]])
(s/def ::position #(m/validate Position %)) But in this case the spec error would just say that the |
So, one thing about Malli (despite the fact that most of the examples are more like Schema) is that the registry approach is well, pluggable lol. We actually chose to use it in a more, spec'ish fashion, since we liked spec's registry approach but wanted something a bit more programmable (come on Spec2!). We've a facade namespace coupled with a mutable registry. So we already do stuff like SN. This is great stuff. After using Drools and Jess (so having to LISP anyway) in the Java world, then Clara which is awesome, but feels 'objecty' at times, O'Doyle really hits the spot. We're full-stack clojure, Fulcro, Pathom, Datomic, etc so this just slots right in. |
That is great to hear :D As for your custom registry, in that case you should be able to hook it in by overwriting the spec for |
Ok cool. I'll check that out |
I also want to use mall, I was planning on using their custom |
Would be nice to be able to use say malli instead of spec
The text was updated successfully, but these errors were encountered: