This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-02-08
Channels
- # announcements (14)
- # babashka (12)
- # beginners (140)
- # calva (2)
- # cider (22)
- # clj-commons (14)
- # clj-kondo (49)
- # cljdoc (34)
- # clojure (92)
- # clojure-europe (41)
- # clojure-france (2)
- # clojure-new-zealand (2)
- # clojure-nl (2)
- # clojure-norway (60)
- # clojure-uk (17)
- # clojured (2)
- # clojurescript (7)
- # community-development (3)
- # conjure (2)
- # cryogen (13)
- # cursive (4)
- # data-oriented-programming (2)
- # datahike (5)
- # datomic (12)
- # defnpodcast (10)
- # events (2)
- # fulcro (20)
- # gratitude (3)
- # honeysql (4)
- # introduce-yourself (3)
- # jobs (10)
- # lsp (58)
- # malli (12)
- # missionary (19)
- # off-topic (8)
- # pathom (18)
- # podcasts-discuss (1)
- # polylith (41)
- # releases (1)
- # remote-jobs (3)
- # shadow-cljs (52)
- # spacemacs (1)
- # sql (37)
- # xtdb (19)
How can set field to be not required in malli Coercion
I am seeing this coercion failure, but dunno why it fails. It claims missing key, however the key is there.
{
"schema": "[:map {:closed true} [:email [:re #\"^.+@.+\\..+\"]] [:password [:string {:min 8, :max 30}]]]",
"errors": [
{
"path": [
"email"
],
"in": [
"email"
],
"schema": "[:map {:closed true} [:email [:re #\"^.+@.+\\..+\"]] [:password [:string {:min 8, :max 30}]]]",
"type": "malli.core/missing-key",
"message": "missing required key"
},
{
"path": [
"password"
],
"in": [
"password"
],
"schema": "[:map {:closed true} [:email [:re #\"^.+@.+\\..+\"]] [:password [:string {:min 8, :max 30}]]]",
"type": "malli.core/missing-key",
"message": "missing required key"
}
],
"value": {
"email": "",
"password": "firepanda"
},
"type": "reitit.coercion/request-coercion",
"coercion": "malli",
"in": [
"request",
"body-params"
],
"humanized": {
"email": [
"missing required key"
],
"password": [
"missing required key"
]
}
}
Is it possible to instrument multimethods with the existing instrumentation features in malli?
Perhaps yes.. but then I have to define all schemas on multi-schema on the dispatch fn itself. I'd rather keep the schemas with the defmethod rather than defmulti.
That's a good question.. defmethod doesn't support metadata afair..only the defmulti does. :thinking_face: Hmm
I've got a user-supplied value stored in a map that is a malli schema. I would like to validate that the schema itself is valid; is there a predefined way to do so, or should I author my own "meta-schema" for checking my schema data?