This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2024-02-24
Channels
- # babashka (6)
- # beginners (11)
- # calva (4)
- # clojure (12)
- # clojure-madison (2)
- # clojure-norway (25)
- # clojure-spec (8)
- # clojure-sweden (1)
- # clojurescript (17)
- # datalevin (1)
- # datomic (8)
- # events (5)
- # ghostwheel (1)
- # hyperfiddle (16)
- # off-topic (16)
- # pedestal (1)
- # reagent (6)
- # reitit (1)
- # releases (3)
- # scittle (1)
- # shadow-cljs (5)
- # specter (2)
- # squint (4)
Can spec be used to replace invalid data with default values?
Looking to keep the valid data as well, instead of replacing the entire value tree with a default
Figured since spec is already traversing the data, it can save having to manually do it again when validation errors are detected, but unsure how to approach it
No, spec is a validation library, not a transformation library
Ah good to know, thanks! Are you aware of a library providing such transformations?
Maybe you could leverage s/explain-data
Metosin's spec-tools
perhaps
https://github.com/metosin/spec-tools?tab=readme-ov-file#spec-tools--
Spec-tools is interesting! I'll look into it, thank you!