This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-05-13
Channels
- # announcements (8)
- # architecture (11)
- # babashka (159)
- # beginners (112)
- # biff (4)
- # chlorine-clover (4)
- # cider (10)
- # clj-kondo (51)
- # cljs-dev (43)
- # cljsrn (10)
- # clojure (45)
- # clojure-bay-area (5)
- # clojure-europe (11)
- # clojure-france (4)
- # clojure-italy (4)
- # clojure-nl (2)
- # clojure-norway (1)
- # clojure-sweden (1)
- # clojure-uk (8)
- # clojurescript (75)
- # code-reviews (1)
- # community-development (2)
- # conjure (88)
- # cryogen (5)
- # data-science (1)
- # datomic (3)
- # dirac (2)
- # fulcro (4)
- # helix (1)
- # jackdaw (5)
- # kaocha (5)
- # leiningen (2)
- # lsp (49)
- # malli (9)
- # mid-cities-meetup (1)
- # off-topic (8)
- # pathom (3)
- # polylith (19)
- # re-frame (6)
- # releases (3)
- # rewrite-clj (1)
- # shadow-cljs (98)
- # spacemacs (2)
- # tools-deps (6)
- # vim (4)
- # xtdb (6)
Is there something in the current design that could prevent implementing that kind of schema salvaging? This is about altering some properties of an existing schema in a direct way:
{:int-vec [:vector :int]
:small-int-vec [:int-vec {:max 3}]}
I often have that kind of situation where I have a common schema (eg. :int-vec
) but once in a while I have to put more constraints in properties or slightly alter generation (eg. {:max 3}
).
Is there another obvious way, besides an external function that recreates the schemas with optional properties?(and besides directly using malli.util
)
Hi everybody, I am looking for the documentation of :ref, I always have a doubt if it is needed or not. I find :ref in the example of the documentation but no sentence explaining why it necessary or not.
@adam678 interesting idea. Should the latter fail if it would have children too? Or swap those too, if present?
@caumond :ref
is needed for recursion, no other utility I believe. It's implementation is lazy, so validators, explainers, generators etc. are realized only when needed.
@ikitommi I was thinking of altering properties only since this is both useful and not controversial. Altering properties doesn't change fundamental aspects of a schema (usually, I guess). If we could alter children, the following would look weird, almost evil:
{:int-vec [:vector :int]
:double-vec [:int-vec :double]}