Questions tagged [malli]
10 questions
3
votes
0 answers
Conversion of Malli schema to JSON schema?
How do I convert the Malli schema to JSON schema?
I have a malli schema in edn format & it needs to be converted to JSON schema.

Blaze
- 368
- 1
- 10
2
votes
1 answer
How to define a user defined data type in clojure?
I want to use a user defined regex pattern for defining dates in edn file, for validation with malli.
How do i define this pattern in core.clojure, so that I can use it in the edn file.
This is how my edn file was before.
(def reading-schema
…

MouseNag
- 303
- 1
- 9
2
votes
1 answer
How to wrap one schema inside another for Malli?
This is my payload.
(m/validate readingDetails-schema
{:readingCode : "Code1",
:readingNumber : "twenty two round off",
:readingCheck : "First",
:readings : [{
:readingDate : "2021-05-02",
:readingType : "first check",
…

Blaze
- 368
- 1
- 10
2
votes
1 answer
How to validate local-date in malli schema?
How to validate date in malli schema?
What is the data type that I must use?
I checked with local-date, but its not valid in clojure.
This is the code I followed.
(def date (m/schema [:map
[:a :int]
[:b :re…

MouseNag
- 303
- 1
- 9
2
votes
1 answer
What is humanize in Malli?
I do not understand this concept. malli.error/humanize
I tried following up with the github link of Malli.
https://github.com/metosin/malli
Does humanize refer to the error statements that we can customize & add like in Java? Or does it mean that…

Blaze
- 368
- 1
- 10
1
vote
1 answer
What is the difference between using : and ? in Malli?
When I try to validate for data types in Malli, what is the difference between using : and ? in Malli?
Like when I try for float, it fails for :float as invalid schema. But we are allowed to use :int and :string right? So why does it fail for…

Blaze
- 368
- 1
- 10
1
vote
1 answer
How do I validate a big decimal value in malli?
I have a variable of data type big decimal. How to validate that in Malli?
Looking at the predicate types in malli, there isn't one for big decimal.
https://github.com/metosin/malli#built-in-schemas
So how do can I validate for this?
And what do we…

MouseNag
- 303
- 1
- 9
1
vote
1 answer
Resolving a keyword into a Malli schema from the default registry in Clojure
How do I resolve a keyword to a schema from the default Malli registry? I seem unable to look up a value in the registry in order to walk it.
(def registry
(atom {}))
(defn register! [type ?schema]
(swap! registry assoc type ?schema))
;;…

Rovanion
- 4,382
- 3
- 29
- 49
0
votes
0 answers
Can autocomplete make use of Malli?
Given I have a schema for the function get-stock.
(m/-> get-stock [:cat :int] -> [:map [:price float?] [:sym string]])
When I a code below,
(-> (get-stock)
;;; the cursor is here
)
Can any tools show me possible keywords that are :price or…

Vee Satayamas
- 438
- 4
- 10
0
votes
1 answer
How do I access the properties assigned a key in a Malli map schema?
Given a Malli map schema like [:map [:key {:optional true} :int]], how do I get at the properties assigned the keyword :key in the map when writing a walker? In this example, these are {:optional true}.
As you can see in the below example the walker…

Rovanion
- 4,382
- 3
- 29
- 49