This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2024-02-01
Channels
- # aleph (6)
- # announcements (37)
- # aws (1)
- # beginners (67)
- # calva (9)
- # clerk (5)
- # clj-kondo (3)
- # clojure (19)
- # clojure-europe (40)
- # clojure-nl (1)
- # clojure-norway (36)
- # clojure-uk (5)
- # clojuredesign-podcast (7)
- # clojurescript (28)
- # datomic (9)
- # emacs (8)
- # figwheel-main (4)
- # fulcro (6)
- # hyperfiddle (19)
- # integrant (4)
- # java (9)
- # lsp (131)
- # malli (9)
- # missionary (85)
- # off-topic (13)
- # pathom (3)
- # polylith (11)
- # releases (1)
- # sci (4)
- # shadow-cljs (7)
- # specter (2)
- # vscode (1)
- # xtdb (2)
How do I know what properties a type can have? The readme shows :min and :max for strings, :optional for maps, but I can't find other examples or the full list of valid properties. Can we also define custom properties?
Quick answer: no easy way to know these, there is a mechanism to describe the allowed props using malli schemas, source = where info lives now, you can add any custom properties and many support namespaces use those, .e.g generators use :gen/….
, transformers use :decode/…
etc.
is it possible to get the name of a schema from a schema object? i have a function that's passed different schemas and does validation on objects with them, and i'd like to be able to log the schema name
depends, references are like Vars - if you pass the reference, you can ask it’s name - if you ask for the value behind the reference, you can’t.
if I have a regex schema, is there any way I can annotate it so that schemas including it can be generated (cljs, so no option to generate out of the box I think) or even better, can I supply a generator fn to the schema?
this should work: [#"kikka" {:gen/schema :string}]
, also [#"kikka" {:gen/gen …test-check-generator-goes-here…}]
, README has all properties that can be used.