core
Foundation library providing shared utilities used by all other Boundary 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 |
|
Generic validation helpers |
|
Interceptor pipeline runner (enter/leave/error phases) |
|
Interceptor context creation and management |
|
Feature flag evaluation logic |
Case conversion
The most commonly used utilities across the entire monorepo:
(require '[boundary.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 '[boundary.core.utils.validation :as validation])
;; Generic validation with transformation
(validation/validate-with-transform SomeSchema data mt/string-transformer)
;=> {:valid? true :data transformed-data}
;=> {:valid? false :errors validation-errors}
;; CLI argument validation
(validation/validate-cli-args CliSchema args cli-transformer)
Interceptor pipeline
The interceptor system supports enter/leave/error phases, used by both HTTP and service layers:
(require '[boundary.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 Boundary libraries depend on core
Testing
clojure -M:test:db/h2 :core
clojure -M:test:db/h2 --focus-meta :unit # All core tests are :unit