core
Foundation library providing shared utilities used by all other Wagoe libraries. Contains no shell layer — everything is pure functions.
Key namespaces
| Namespace | Purpose |
|---|---|
|
Malli-based validation framework with error codes, messages, and "did you mean?" suggestions |
|
Central registry for validation rules across libraries |
|
Validation coverage reporting and analysis |
|
Snapshot-based validation testing |
|
kebab-case / snake_case / camelCase conversions |
|
UUID, Instant, BigDecimal string conversions |
|
PII filtering for logs and error reports |
|
Value predicates for CLI arguments ( |
|
Interceptor pipeline runner (enter/leave/error phases) |
|
Interceptor context creation and management |
|
Feature flag evaluation logic. Pure — the environment map is a parameter;
|
Case conversion
The most commonly used utilities across the entire monorepo:
(require '[wagoe.core.utils.case-conversion :as cc])
;; Persistence boundary — DB record → Clojure entity
(cc/snake-case->kebab-case-map db-record)
;; Persistence boundary — Clojure entity → DB insert/update
(cc/kebab-case->snake-case-map entity)
;; HTTP boundary — Clojure entity → JSON response
(cc/kebab-case->camel-case-map entity)
;; HTTP boundary — JSON request → Clojure map
(cc/camel-case->kebab-case-map api-input)
Validation framework
(require '[wagoe.core.validation :as validation]
'[malli.transform :as mt])
;; Decode, then validate. Both compilers are cached on the schema.
(let [data ((validation/decoder SomeSchema mt/string-transformer) input)]
(if (validation/valid? SomeSchema data)
data
(validation/explain SomeSchema data)))
Interceptor pipeline
The interceptor system supports enter/leave/error phases, used by both HTTP and service layers:
(require '[wagoe.core.interceptor :as ic])
;; Enter phases run forward, leave phases run in reverse
(ic/run-pipeline initial-ctx [interceptor1 interceptor2 interceptor3])
;; Enter order: int1 → int2 → int3
;; Leave order: int3 → int2 → int1
Important conventions
-
All functions must be pure — no I/O, no logging, no side effects
-
This library has no ports.clj or shell/ — it’s entirely functional core
-
Only dependencies:
org.clojure/clojureandmetosin/malli -
All other Wagoe libraries depend on core
Testing
clojure -M:test :core
clojure -M:test --focus-meta :unit # All core tests are :unit