Skip to content

Instantly share code, notes, and snippets.

@stevebuik
stevebuik / recursive-multi-malli.clj
Last active December 27, 2020 06:21
example of Malli tree nodes using a :multi for the nodes
(ns recursive-multi-malli
(:require [malli.core :as m]
[malli.util :as mu]
[malli.error :as me]
[criterium.core :as criterium]))
(def simple-tree-node
[:schema {:registry {::type [:enum :blue :green]
::children [:vector [:ref ::node]]
::node [:multi {:dispatch :type}
@stevebuik
stevebuik / cli-gist.clj
Last active June 28, 2022 08:50
An example of "light" validation of babashka.cli arguments i.e. checking for required arguments without using Spec or Malli
(ns cli-gist
(:require [babashka.cli :as cli]
[clojure.set :as set]
[clojure.string :as str]))
(def upload-spec {:bucket-region {:ref "<aws-region>"
:desc "The AWS region where the S3 bucket was created"
:optional true
:alias :r}