title: Accessing subfields in json file
body: <p>Assuming I have a JSON file with the following structure. How I can access the names of the properties in the metadata field.  </p>
  
  <pre><code>{
    "mappings": {
      "basedoc_12kja": {
        "properties": {
          "created": {
            "type": "date",
            "format": "dateOptionalTime"
          },
          "customerID": {
            "type": "string"
          },
          "deleted": {
            "type": "boolean"
          },
          "documentID": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "metadata": {
            "properties": {
              "Cert": {
                "type": "string"
              },
              "Exp_date": {
                "format": "dateOptionalTime"
              },
            }
          }
        }
      }
    }
  }
  </code></pre>
  
  <p>Mappings is an array of documents, each subfield of mappings has a different code. I want to obtain the metadata fields of each document to find out which metadata fields are common between them.</p>
  
  <p>I haven't been able to instantiate this documents.  </p>
  
  <pre><code>var response = esReader.GetIndicesMapping();
  
  foreach (var mapping in response.Response.Values)
  {
     // Parse JSON into dynamic object, convenient!
     dynamic results = JObject.Parse(mapping);
  
     List&lt;DocumentType&gt; deserializedObject = JsonConvert.DeserializeObject&lt;List&lt;DocumentType&gt;&gt;(mapping);
  
  }  
  </code></pre>
  
  <p><strong>Exception</strong></p>
  
  <blockquote>
    <p>{"Cannot deserialize the current JSON object (e.g. {\"name\":\"value\"}) into type 'System.Collections.Generic.List`1[DocumentType]' because the type requires a JSON array (e.g. [1,2,3]) to deserialize correctly.\r\nTo fix this error either change the JSON to a JSON array (e.g. [1,2,3]) or change the deserialized type so that it is a normal .NET type (e.g. not a primitive type like integer, not a collection type like an array or List) that can be deserialized from a JSON object. JsonObjectAttribute can also be added to the type to force it to deserialize from a JSON object.\r\nPath 'mappings', line 2, position 14."}</p>
  </blockquote>
  
  <p>The desire result is to obtain the name of <code>Cert</code> and <code>Exp_date</code> fields</p>
  
  <p><strong>EDIT</strong></p>
  
  <pre><code>public class DocumentType
      {
  
          public string Id { set { DocumentID = value; } get { return DocumentID; } }
  
          public string DocumentID { set; get; }       
  
          public DateTime Created { set; get; }
           .
           .
           .
          public Dictionary&lt;string, object&gt; Metadata { set; get; }
  
  
      }
  </code></pre>