This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-09-12
Channels
- # announcements (3)
- # babashka (6)
- # beginners (84)
- # biff (1)
- # cider (7)
- # cljsrn (1)
- # clojure (18)
- # clojure-australia (3)
- # clojure-dev (21)
- # clojure-france (1)
- # clojure-spec (6)
- # clojurescript (78)
- # datomic (34)
- # emacs (5)
- # exercism (32)
- # graalvm (1)
- # helix (2)
- # hyperfiddle (3)
- # lsp (36)
- # malli (4)
- # missionary (3)
- # off-topic (54)
- # re-frame (14)
- # releases (2)
- # sql (31)
- # vim (9)
This is somewhere between malli and #reitit, is there a way to know the schema with which validation passed in cases of or
and multi
?
I asked this question a while back; there's not a good way to do this without orn
. If you know all the validation paths at compile time they can be enumerated. But the use case I was thinking about, of sum types that are created at runtime, was still tricky to match on. @U055NJ5CC suggested a simple function for converting the or
to orn
with numbers as the keys so that I could know which was matched.
Not sure if anything has changed in the library since I asked about it, so this solution may be out of date.
Ended up going with orn and parse in the end I wonder how it interacts with decoding. Are conflicts possible?
I've used a custom decoder for this that attaches the schema to the value as metadata