title: Decode, in clojure, a JSON, clojure.data.json & cheshire.core, can't custom decode w/cheshire
body: <p>My project parses JSONs, with a read/write library, called:</p>
  
  <p><a href="https://github.com/dakrone/cheshire" rel="nofollow noreferrer">cheshire.core</a></p>
  
  <p>I was having problems, trying to get the decode (func) to work, so I started messing around with:</p>
  
  <p><a href="https://github.com/clojure/data.json" rel="nofollow noreferrer">data.json</a></p>
  
  <p>My JSON contains data that consists of a field named "zone"  this contains a vector with :keys inside, like so {:zone : [:hand :table]} that is stored into strings within the vector stored like so:  {"zone" : ["hand" "table"]}</p>
  
  <p>So I figured out how to convert the sample data using:</p>
  
  <pre><code>(mapv keyword {"zone" : ["hand"]})
  </code></pre>
  
  <p>which was great, I then needed to figure out how to implement a decoder for cheshire, I couldn't do this with my logic, I only spent like an hour working on this, but I had been using data.json, and the decoder function is relatively easy I think.</p>
  
  <p>I got my project to work, here is some sample code:</p>
  
  <pre><code>(ns clojure-noob.core (:require
                      [cheshire.core :refer [decode]]
                      [clojure.data.json :as j-data]
                      ) (:gen-class))
  
  (defn -main
    "I don't do a whole lot ... yet."
    [&amp; args]
    )
  </code></pre>
  
  <p>this is using cheshire:</p>
  
  <pre><code>(let [init (decode "{\"zone\" : [\"hand\"]}" true
                 (fn [field-name]
                   (if (= field-name "zone")
                     (mapv keyword [])
                     [])))]
    (println (str init)))
  </code></pre>
  
  <p>this is using data.json:</p>
  
  <pre><code>(defn my-value-reader [key value]
    (if (= key :zone)
      (mapv keyword value)
        value))
  
  (let [init (j-data/read-str
           "{\"zone\" : [\"hand\"]}"
           :value-fn my-value-reader
           :key-fn keyword)]
    (println (str init)))
  </code></pre>
  
  <p>I want the bottom result of these two from the console:</p>
  
  <pre><code>{:zone ["hand"]}
  {:zone [:hand]}
  </code></pre>
  
  <p>The problem is I would like to do this using cheshire 
  p.s. I am reading the factory section of cheshire? maybe this easier?</p>