title: Scala - handling JSON with nested structures of maps and lists
body: <p>An <strong>Api request</strong> returns a <strong>Json string</strong> like below.  I've been trying to <strong>parse in Scala</strong>, add the <strong>"name"</strong> field to a list and then filter this list using another list.  The <strong>API is from a third party</strong> so the format cannot be modified.</p>
  
  <p>Example list (2 entries in values here but there can be up to 300):</p>
  
  <pre><code>{
      "size": 20,
      "values": [{
              "name": "mullock",
              "upstatus": "Green",
              "details": {
                  "key": "rupture farms",
                  "server": "mudos",
                  "owner": "magog_cartel",
                  "type": "NORMAL",
                  "links": {
                      "self": [{
                          "address": "https://mudos.com:port/access"
                      }]
                  }
              }
          },
          {
              "name": "tassadar",
              "upstatus": "Orange",
              "details": {
                  "key": "archon",
                  "server": "protoss",
                  "owner": "aspp67",
                  "type": "NORMAL",
                  "links": {
                      "self": [{
                          "address": "https://aiur.com:port/access"
                      }]
                  }
              }
          }
      ],
      "limit": 100
  }
  </code></pre>
  
  <p>I've attempted to unmarshal the string using jackson and some suggested functions (below) which are used in other parts of the application but I don't fully understand this.</p>
  
  <pre><code>import com.fasterxml.jackson.databind.ObjectMapper
  import com.fasterxml.jackson.module.scala.DefaultScalaModule
  import com.fasterxml.jackson.module.scala.experimental.ScalaObjectMapper
  
  object Json {
      /* Json/Scala translation utilities
       */
      val mapper = {
          val _mapper = new ObjectMapper() with ScalaObjectMapper
          _mapper.registerModule(DefaultScalaModule)
          _mapper
      }
  
      def dump(obj: Any): String = {
          mapper.writeValueAsString(obj)
      }
  
      def dumpObj(fields: (Any, Any)*): String = {
          dump(fields.toMap)
      }
  
      def read[T: Manifest](content: String): T = {
          mapper.readValue(content, mapper.constructType[T])
      }
  
      def readObj(content: String): Map[Any, Any] = {
          return read[Map[Any, Any]](content)
      }
  
  }
  </code></pre>
  
  <ol>
  <li>How can I access nested elements of in object Map(Any, Any)? </li>
  <li>Is this the correct way to deserialize a JSON String?</li>
  </ol>
  
  <p>Any help greatly appreciated! </p>