title: Parsing multiple JSON types into the same struct
body: <p>I am requesting an API which returns JSON containing an array of objects. The problem is that the objects can take two forms. They can either be a string or an object. An example result could look like this:</p>
  
  <pre><code>[
      {"name": "obj1", "key2": ["a", "b"]},
      "obj2",
      {"name": "obj3"}
  ]
  </code></pre>
  
  <p>A string element <code>"objX"</code> is equivalent to <code>{"name": "objX"}</code>.</p>
  
  <p>I want to parse this into a slice of the following type:</p>
  
  <pre><code>type Obj struct {
      Name string
      Key2 []string
  }
  </code></pre>
  
  <p>How do I do this in a reasonable fashion?</p>