From 71cd3c5bd5c5f0682f8c2d6d1a7f03d871aa4d5c Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Tue, 24 Nov 2026 09:40:33 +0000 Subject: [PATCH] :books: Clarify JSON schema key decoding Distinguish the custom map key decoder from Malli's encoders and point to the string-key roundtrip test. AI-assisted-by: gpt-6.1-terra --- .serena/memories/common/schema.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.serena/memories/common/schema.md b/.serena/memories/common/schema.md index 54384fe385..b6632dc043 100644 --- a/.serena/memories/common/schema.md +++ b/.serena/memories/common/schema.md @@ -1,5 +1,5 @@ # Common schema and coercion -- Start at `app.common.schema`. Its `json-transformer` supports key decoding and encoding for map-of schemas as well as value transformation. `coercer` decodes JSON-shaped input with that transformer and validates the result. +- Start at `app.common.schema`. Its `json-transformer` adds custom `:map-of` key decoding based on the key schema and uses Malli's JSON encoders; it does not define a matching custom key encoder. For a string-key JSON roundtrip see `map-of-with-strings` in `common/test/common_tests/types/shape_decode_encode_test.cljc`. `coercer` decodes JSON-shaped input with that transformer and validates the result. - `check-fn` returns a reusable validator that raises `ex-info` with default `:type :assertion`, `:code :data-validation` and `::explain`. Prefer a reusable checker in repeated or hot paths; `sm/check` creates one on each call. - `check-fn` resolves its schema through `app.common.data.macros/lazy-delay`: an invalid schema can fail on namespace load in development and JVM tests, but on first use in production CLJS. See the macro docstring and target closure defines.