malli
malli copied to clipboard
High-performance data-driven data specification library for Clojure/Script.
Copied from a Slack thread https://clojurians.slack.com/archives/CLDK6MFMK/p1680790963043859 ---------------------------------------------------------------- I came across a Malli behavior I didn’t understand and wanted some advice. When I chain two mu/assoc-in calls, it seems like the...
Currently, the local registry must be data, doesn’t accept IntoSchema instances. This both is a) unfortunate b) slows m/form a lot. eg. ``` [:map {:registry (merge mc/default-registry {::id int? ::country...
```clojure [:map-of {} :keyword :int [:re #"^([a-z][a-z0-9]*)+(-[a-z0-9]+)*\\-ext$"] [:map ,,,]] ``` Something similar exists in json-schema: ```js { "type": "object", "patternProperties": { "^([a-z][a-z0-9]*)+(-[a-z0-9]+)*\\-ext$": {}, "^([a-z][a-z0-9]*)+(-[a-z0-9]+)*\\-ext-definition$": {} }, "additionalProperties": false } ```
Closes #793 Tried to stick with how things work in the existing code. Looks like Malli's generated JSON Schema isn't up to date with the most recent JSON Schema specs,...
... should this fail always or just under instrumentation? Plumatic fails always. TODO: - [ ] support `:malli/always` meta to fail early - [ ] collect schematized defs also to...
Leaf-schemas are usually created without properties or children. This MR introduces `IntoSchema` level caching. `Schema` instance cache is enabled if all of the following apply: * `IntoSchema` instance * which...
Hello :wave: I have noticed that functions schemas [defined with metadata](https://github.com/metosin/malli/blob/master/docs/function-schemas.md#function-schema-metadata) do not get reinstrumented by [`malli.dev`](https://github.com/metosin/malli/blob/master/docs/function-schemas.md#development-instrumentation) on namespace reload. Any change to the file and namespace reload causes instrumentation...
Schemas that contain choice need to backtrack when validation or coercion fail. As schemas get larger and more complicated, this can result in redundant work. Proposed solution, using boolean algebra...
Hey friends, Sometimes I have a function schema where an argument can be one of many different schemas and I want the return value to match the input schema. From...
Found this via a [clojure.spec bug](https://clojure.atlassian.net/browse/CLJ-1941): **Cause:** Malli replaces var values with instrumented functions that will not work with primitive function interfaces (double and long) **Approach:** Take primitive interfaces into...