You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to clo...@googlegroups.com
Hi,
I'm playing with the idea of using clojure.spec to make an API backwards compatible by using conform and unform to transform data from the old version format to a new format version. Below is an example of this in code:
Say we have API change that involves changing the name of a nested key:
So this kind of works, but I wonder whether there is an easier way or if I'm thinking about this the wrong way. I was hoping there would be something like with-unformer (like with-gen) that allows me to change the unforming action for a specific key without having to copy most of the old spec.
Any suggestions or advise is appreciated.
Thanks,
Jeroen
Jeroen van Dijk
unread,
Sep 7, 2016, 3:43:25 AM9/7/16
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to clo...@googlegroups.com
Oh I meant `clojure.spec/gen` instead of `clojure.spec/with-gen`. `clojure.spec/gen` has an overrides option. I (think I) need something like this to cleanly change the unforming action in a nested spec.