Re:A Year in Clojure
by iorekz on Sunday October 07, 2018 @12:09PM
(#18161239)
The only issue I thought about would be when using json as I guess this would lose the namespace infos. Did you have issue with that ?
[ Parent
| on HN ]
Here's some valid json that might be useful:
{"signup/username": "John",
"signup/password": "pg4pres"}
Then, because you can pass in a function to get called on the keys, just check for a regex like (.+)/(.+) and turn it into a keyword. Here I'll write a function like that real quick using a repl with a nice ux: https://s3-us-east-2.amazonaws.com/photoblobs/Screen_Recordi...Sorta! Cheshire gives you a key-fn entry point. For small JSON objects you may just want the same namespace and then that is sufficient. Otherwise you can look up the right namespace in that fn or walk that tree (I’ve used specter for this) to correctly annotate.