title: Elm - Decode Json with dynamic keys
body: <p>I'd like to decode a Json file that would look like this:</p>
  
  <pre><code>{ 'result': [
      {'id': 1, 'model': 'online', 'app_label': 'some_app_users'}, 
      {'id': 2, 'model': 'rank', 'app_label': 'some_app_users'}, 
  ]}
  </code></pre>
  
  <p>or like this:</p>
  
  <pre><code>{ 'result': [
      {'id': 1, 'name': 'Tom', 'skills': {'key': 'value', ...}, {'key': 'value', ...}},
      {'id': 1, 'name': 'Bob', 'skills': {'key': 'value', ...}, {'key': 'value', ...}},
  ]}
  </code></pre>
  
  <p>Basically, the content under <code>result</code> is a list of dicts with the same keys - <strong>but I don't know these keys in advance</strong> and I don't know their value types (int, string, dict, etc.). </p>
  
  <p><em>The goal is to show databases tables content; the Json contains the result of the SQL query.</em></p>
  
  <p>My decoder looks like this (not compiling):</p>
  
  <pre><code>tableContentDecoder : Decode.Decoder (List dict)
  tableContentDecoder =
      Decode.at [ "result" ] (Decode.list Decode.dict)
  </code></pre>
  
  <p>I use it like this:</p>
  
  <pre><code>Http.send GotTableContent (Http.get url tableContentDecoder)
  </code></pre>
  
  <p>I'm getting that error:</p>
  
  <blockquote>
    <p>Function <code>list</code> is expecting the argument to be:
        Decode.Decoder (Dict.Dict String a)</p>
    
    <p>But it is:
        Decode.Decoder a -> Decode.Decoder (Dict.Dict String a)</p>
  </blockquote>
  
  <p>What's the correct syntax to use the dict decoder? Will that work? I couldn't find any universal Elm decoder...</p>