Fork me on GitHub

@ikitommi can i get an example with reitit-ring with clojure.spec coercion? Can’t seem to get it to work 😞


spec coercion is bit hacky, before (if ever) we get spec to really support coercion.


@ikitommi do you mean any spec based coercion (like data specs) or straight spec coercion is the hacky bit? Asking because using compojure-api now and had trouble with spec coercion there too (but data specs work fairly well) and I have had my eye on moving to reitit at some point


@ericstewart coercion kinda works, but spec-tools (used in c-api and in reitit) leans on s/conform of clojure.spec which might be changed/removed later. There are CLJ-2116 & CLJ-2251 to modify clojure.spec core so that we could build robust coercion on top of it. The first issue is commented “I continue to think we will most likely decline this.” and the second “No plans to look at this before the next batch of implementation changes, so it will be a while.“.


only public api with clojure.spec is the s/form currently. but it’s contents can change too.


would like to solve this, we could copy most of the spec internals to make it Good, but just too much work.


ok, that's the way I understood it. spec-based coercion will remain risky while it is still alpha at least. thanks for everything done in spec tools though. We have been using it for not just coercion but for generating JSON Specs for use in our front end and has been working well

👍 4

maybe the core-team will need this some day and they’ll open up the spec api so that we can built it right without hacks.


yep. but they did very clearly explain that spec is still alpha. in any case, thanks again for providing some workable solutions on top of an alpha api even though it may all have to radically change again.