title: elm: decode json that contains a json array
body: <p>So I need to decode a <code>json</code> that contains a <code>json array</code> in <code>elm</code>. Here is my model:</p>
  
  <pre><code>type alias ValidationResult =
      { parameter : String
      , errorMessage : String
      }
  
  
  type alias ErrorResponse =
      { validationErrors : List ValidationResult }
  </code></pre>
  
  <p>And here is an example of the <code>json</code>:</p>
  
  <pre><code>{"ValidationErrors": [{"Parameter": "param1","ErrorMessage": "message 1"},{"Parameter": "param2","ErrorMessage": "error message 2"}]}
  </code></pre>
  
  <p>I've tried to create a <code>ValidationResult</code> decoder, like:</p>
  
  <pre><code>decodeValidationResults : Decoder ValidationResult
  decodeValidationResults =
    map2 ValidationResult
      (at [ "Parameter" ] Json.Decode.string)
      (at [ "ErrorMessage" ] Json.Decode.string)
  </code></pre>
  
  <p>But I don't know how to proceed further.</p>
  
  <p>I am using <code>elm</code> 0.18</p>