clojure-spec

Jérémie Pelletier 2024-02-24T16:03:48.152239Z

Can spec be used to replace invalid data with default values?

2024-02-25T08:33:00.139819Z

Metosin's spec-tools perhaps https://github.com/metosin/spec-tools?tab=readme-ov-file#spec-tools--

Jérémie Pelletier 2024-02-25T11:03:09.289929Z

Spec-tools is interesting! I'll look into it, thank you!

Jérémie Pelletier 2024-02-24T16:05:38.857179Z

Looking to keep the valid data as well, instead of replacing the entire value tree with a default

Jérémie Pelletier 2024-02-24T16:06:22.460199Z

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

Alex Miller (Clojure team) 2024-02-24T17:05:29.310089Z

No, spec is a validation library, not a transformation library

Jérémie Pelletier 2024-02-24T18:19:14.073569Z

Ah good to know, thanks! Are you aware of a library providing such transformations?

nikolavojicic 2024-02-25T00:22:08.574789Z

Maybe you could leverage s/explain-data