-
Notifications
You must be signed in to change notification settings - Fork 217
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
Instrument schematized vars #349
Comments
see #369. |
Hi, I was wondering with @narocath and @LeaveNhA about on how move forward on implementing this feature, we got into those
|
Hi, sorry for keeping you waiting. My 2 cents:
the api:
the bare minimum would be (adopted from https://github.com/setzer22/malli-instrument): (require '[malli.core :as m])
(require '[malli.instrument :as mi])
(m/=> foo [:=> [:cat int? int?] string?)
(defn foo [x, y] (+ x y))
;; no implementation needed
(m/=> bar [:=> [:cat int? int?] string?)
(mi/instrument!)
(foo 1 2)
;; =throws=> :malli.instrument.invalid-output {:error ["should be a string"], :value 3, :fn user/foo}
(bar 1 2)
;; =throws=> :malli.instrument.invalid-output {:error ["should be a string"], :value 3, :fn user/bar} what do you think? |
Is someone working on this issue? |
this seemed stalled so started working on this, see #471. |
#471 merged in master. the new function schema guide found here: https://github.com/metosin/malli/blob/master/docs/function-schemas.md. This will be released after vacations along with many small changes. Testing, feedback an improvements most welcome. |
That's awesome @ikitommi. |
Way to turn schematized functions into wrapped ones that do runtime validation for input & outputs. See https://github.com/jeaye/orchestra
The text was updated successfully, but these errors were encountered: