malli
malli copied to clipboard
High-performance data-driven data specification library for Clojure/Script.
Our company generates a lot of spec from [data definitions](https://www.hl7.org/fhir/json.html) We us `[malli.util :as mu]` to update those specs with vendor specific information. Currently we have to use `mu/transform-entries` when...
Consider following example. I have a map with some structure, some properties are simply typed and some are more complex and hence custom schema. In real world `:complex` would be...
While schema literals will most likely be written in vector forms, when building schemas programatically there's a chance the schema won't be a vector Minimal case: `(malli.core/schema (list :int))` vs...
(malli.core/explain [:* :int] [1 2 "a" "b"]) {:schema #object[malli.core.t_malli$core91001], :value [1 2 "a" "b"], :errors ({:path [0], :in [2], :schema #object[malli.core.t_malli$core90615], :value "a"} {:path [], :in [2], :schema #object[malli.core.t_malli$core91001], :value...
Steps to repro ``` (malli.dev/start! {:report (m.x.virhe/pretty-thrower (m.x.virhe/-pretty-printer {}))}) (malli.experimental/defn foo [x :- int?] 3) (foo "hi") ``` The error message for me looks like ``` 1. Unhandled clojure.lang.ExceptionInfo --...
I'm not really sure at the moment about what is correct behavior in this case, but resulting map is closed and thus should, probably, remove default key? ```clojure (def registry...
using release 0.11.0 ```clojure (let [location-schemas (merge {:address :string} (m/default-schemas))] ; this is ok i.e. local registry can be used (-> [:map [:title :string]] (mu/assoc :location :address {:registry location-schemas})) ;...
If you m/explain invalid data using a multi-schema, the explainer shows the entire multi-schema, not just the matching part. This can make spotting errors harder. I think it would be...
I'm trying to write multi schema to validate a map with strings as a key: ```clojure (def valid? (m/validator [:multi {:dispatch "type"} ["object" [:map-of :keyword :string]] [::m/default :string]])) ``` Here...
Currently you cannot mix custom registry with local registry... ``` (merge mc/default-registry {::id int? ::country string?}} ``` ikitommi: Currently, the local registry must be data, doesn’t accept IntoSchema instances. This...