You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, the primary syntax for defining Malli schemas is the hiccup syntax. Malli also supports map syntax and a symmetric round-trip between the two. This is ok, but the we should investigate if a more compact map presentation would make sense, as a first-class concept:
Current
(defFruit
[:enum {:title"fruit":description"a possible fruits":swagger/default"apple"}
"pear""lemon"])
(m/form Fruit)
;[:enum {:title "fruit"; :description "a possible fruits"; :swagger/default "apple"}; "pear" "lemon"]
(mu/to-map-syntax Fruit)
;{:type :enum,; :properties {:title "fruit"; :description "a possible fruits"; :swagger/default "apple"},; :children ["pear" "lemon"]}
(-> Fruit mu/to-map-syntax mu/from-map-syntax m/form (= Fruit))
; => true
Idea
(m/form Fruit {:syntax:hiccup})
;[:enum {:title "fruit"; :description "a possible fruits"; :swagger/default "apple"}; "pear" "lemon"]
(m/form Fruit {:syntax:map})
;{:type :enum,; :properties {:title "fruit"; :description "a possible fruits"; :swagger/default "apple"},; :children ["pear" "lemon"]}
(m/form Fruit {:syntax:map-compact})
;{:malli/type :enum; :title "fruit"; :description "a possible fruits"; :swagger/default "apple"; :malli/children ["pear" "lemon"]}
Parsed childs
the last one would be great for cases where the children have a special meaning (like :=>), could be derived from m/parse results.
Currently, the primary syntax for defining Malli schemas is the
hiccup
syntax. Malli also supportsmap
syntax and a symmetric round-trip between the two. This is ok, but the we should investigate if a more compact map presentation would make sense, as a first-class concept:Current
Idea
Parsed childs
the last one would be great for cases where the children have a special meaning (like
:=>
), could be derived fromm/parse
results.so, instead of:
it would be:
like clj-fx.
The text was updated successfully, but these errors were encountered: