This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-11-18
Channels
- # announcements (2)
- # babashka (65)
- # beginners (104)
- # boot (8)
- # calva (23)
- # circleci (3)
- # clj-commons (1)
- # clj-on-windows (3)
- # clojure (43)
- # clojure-europe (45)
- # clojure-france (2)
- # clojure-italy (3)
- # clojure-nl (3)
- # clojure-norway (13)
- # clojure-uk (4)
- # clojurescript (5)
- # core-typed (2)
- # cursive (5)
- # data-science (2)
- # datalevin (10)
- # emacs (38)
- # events (2)
- # fulcro (11)
- # graphql (6)
- # gratitude (2)
- # helix (11)
- # hugsql (3)
- # jobs (2)
- # lsp (17)
- # luminus (1)
- # malli (15)
- # missionary (3)
- # nrepl (6)
- # off-topic (6)
- # pedestal (2)
- # portal (16)
- # reagent (33)
- # reitit (4)
- # releases (12)
- # ring (2)
- # sci (3)
- # shadow-cljs (21)
- # spacemacs (7)
- # sql (5)
- # tools-build (36)
- # web-security (2)
I'm having trouble finding from-ast
in malli.core
. When I go to source in Emacs I get to 0.7.0-SNAPSHOT, so it should be the right version of the library that's loaded. But I can only see the name declared, never see it def'd.
released most likely next week. You can take the latest sha from master with deps if you want to test it
Sorry, on Leiningen. Will the AST behave like the vector based schemas? That is: Print like a vector/map but not implement ISeq/Associative? What I'm really after is using the Malli schemas I've written to generate some Simple HTML forms.
Sounds cool, there are multiple ways to walk the schemas for that:
1. use m/walk
, look for json schema ns for example how to use it
2. use malli.util/subschemas
to get the expanded list of the schema tree. Added that from a malli->form use case 😉
refreshed the latest SNAPSHOT with all stuff in:
➜ ~ clj -Sforce -Sdeps '{:deps {metosin/malli {:mvn/version "0.7.0-SNAPSHOT"}}}'
Downloading: metosin/malli/0.7.0-SNAPSHOT/malli-0.7.0-20211118.202503-4.pom from clojars
Hmm, I get an exception thrown at me when loading malli in my project with this latest snapshot:
#error {
:cause No such var: mr/fast-registry
:via
[{:type clojure.lang.Compiler$CompilerException
:message Syntax error compiling at (tove/core.clj:1:1).
:data #:clojure.error{:phase :compile-syntax-check, :line 1, :column 1, :source tove/core.clj}
:at [clojure.lang.Compiler load Compiler.java 7652]}
{:type java.lang.ExceptionInInitializerError
:message nil
:at [java.lang.Class forName0 Class.java -2]}
{:type clojure.lang.Compiler$CompilerException
:message Syntax error compiling at (malli/core.cljc:2362:53).
:data #:clojure.error{:phase :compile-syntax-check, :line 2362, :column 53, :source malli/core.cljc}
:at [clojure.lang.Compiler analyze Compiler.java 6812]}
{:type java.lang.RuntimeException
:message No such var: mr/fast-registry
:at [clojure.lang.Util runtimeException Util.java 221]}]
But I don't get the same exception when just requiering malli.core
in an empty project with just malli and clojure declared as dependencies.How can I define a custom predicate? E.g. a string of length 5 (or another more advanced logic).
I tried the following
[:map {:registry {:asset-id [:and :string #(= 5 (count %))]}}
[:aa :asset-id]]
But malli says that the schema is not valid
:fn
is perfect!