title: Representing a list of JSON tuples as a case class field, with Json4s
body: <p>Given the following JSON:</p>
  
  <pre class="lang-json prettyprint-override"><code>{
      "foo": "bar",
      "baz":[
          { "qux" : "quux" },
          { "quuux" : "quuuux" }
      ]
  }
  </code></pre>
  
  <p>what's the best way to represent it as a Scala case class? Logically it seems as though it should be something like:</p>
  
  <pre class="lang-scala prettyprint-override"><code>case class Foo(
    foo: String,
    baz: List[(String, String)]
  )
  </code></pre>
  
  <p>However, when I try to parse this with Json4s and Jackson, I get:</p>
  
  <pre><code>No usable value for baz
  No usable value for _1
  Did not find value which can be converted into java.lang.String
  org.json4s.package$MappingException: No usable value for baz
  No usable value for _1
  Did not find value which can be converted into java.lang.String
  </code></pre>
  
  <p>Going the other direction, if I construct my expected <code>Foo</code>...</p>
  
  <pre class="lang-scala prettyprint-override"><code>val foo = Foo(foo = "bar", baz = List(("qux" -&gt; "qux1"), ("qux" -&gt; "qux2")))
  </code></pre>
  
  <p>...and write it as JSON, I don't get my list of tuples, I get:</p>
  
  <pre class="lang-json prettyprint-override"><code>{
    "foo" : "bar",
    "baz" : [ {
      "_1" : "qux",
      "_2" : "qux1"
    }, {
      "_1" : "qux",
      "_2" : "qux2"
    } ]
  }
  </code></pre>
  
  <p>I see in <a href="https://stackoverflow.com/questions/17534498/producing-json-in-a-scala-app-using-json4s">this answer</a> that despite Json4s <a href="https://github.com/json4s/json4s" rel="nofollow noreferrer">claims</a> to produce objects from <code>Tuple2s</code> in the DSL, it can't actually do it for an object field unless that object field is defined as a <code>JValue</code>. Since I want to do other things with my <code>Foo</code> model object besides serialize and deserialize it, I don't particularly want to define it in terms of <code>JValues</code>.</p>
  
  <p>Given that, what should I be doing, here?</p>