This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2024-01-02
Channels
- # announcements (7)
- # atom-editor (3)
- # babashka (8)
- # beginners (38)
- # biff (5)
- # calva (17)
- # cider (26)
- # clj-kondo (6)
- # clojure (49)
- # clojure-europe (47)
- # clojure-norway (19)
- # clojure-sweden (2)
- # clojure-uk (1)
- # clojurescript (22)
- # cursive (20)
- # datahike (1)
- # datomic (6)
- # etaoin (2)
- # honeysql (2)
- # hyperfiddle (36)
- # jobs-discuss (19)
- # leiningen (15)
- # malli (5)
- # off-topic (8)
- # overtone (1)
- # pathom (15)
- # pedestal (8)
- # polylith (4)
- # releases (1)
- # ring (5)
- # schema (10)
- # shadow-cljs (17)
- # timbre (3)
- # xtdb (17)
(s/defschema Dog
{
:food s/Str
:activities s/Str
})
(s/defschema Cat
{
:name s/Str
})
(s/defschema Animal { s/enum [Dog Cat]})
> Execution error at schema.core/parse-sequence-schema (core.cljc:940).
> [{:food java.lang.String, :activities java.lang.String} {:name java.lang.String}] is not a valid sequence schema; a valid sequence schema consists of zero or more one
elements, followed by zero or more optional
elements, followed by an optional schema that will match the remaining elements.
s/enum
is applied incorrectly in the example, its correct application would be (s/defschema Animal (s/enum Dog Cat))
However that won't help in this case - checking enum's docstring:
schema.core/enum [& vs] A value that must be = to some element of vs.