title: Deserializing Multiple Objects in JSON not Working
body: <p>So I'm trying to get distance between two cities using Google Maps API. To see thier Json Format go here: <a href="https://developers.google.com/maps/documentation/directions/start" rel="nofollow noreferrer">https://developers.google.com/maps/documentation/directions/start</a></p>
  
  <p>So My Class objects look like this to match</p>
  
  <pre><code>public class GeocodedWaypoint
  {
      public string geocoder_status { get; set; }
      public string place_id { get; set; }
      public List&lt;string&gt; types { get; set; }
      public bool? partial_match { get; set; }
  }
  
  public class Northeast
  {
      public double lat { get; set; }
      public double lng { get; set; }
  }
  
  public class Southwest
  {
      public double lat { get; set; }
      public double lng { get; set; }
  }
  
  public class Bounds
  {
      public Northeast northeast { get; set; }
      public Southwest southwest { get; set; }
  }
  
  public class Distance
  {
      public string text { get; set; }
      public int value { get; set; }
  }
  
  public class Duration
  {
      public string text { get; set; }
      public int value { get; set; }
  }
  
  public class EndLocation
  {
      public double lat { get; set; }
      public double lng { get; set; }
  }
  
  public class StartLocation
  {
      public double lat { get; set; }
      public double lng { get; set; }
  }
  
  public class Distance2
  {
      public string text { get; set; }
      public int value { get; set; }
  }
  
  public class Duration2
  {
      public string text { get; set; }
      public int value { get; set; }
  }
  
  public class EndLocation2
  {
      public double lat { get; set; }
      public double lng { get; set; }
  }
  
  public class Polyline
  {
      public string points { get; set; }
  }
  
  public class StartLocation2
  {
      public double lat { get; set; }
      public double lng { get; set; }
  }
  
  public class Step
  {
      public Distance2 distance { get; set; }
      public Duration2 duration { get; set; }
      public EndLocation2 end_location { get; set; }
      public string html_instructions { get; set; }
      public Polyline polyline { get; set; }
      public StartLocation2 start_location { get; set; }
      public string travel_mode { get; set; }
      public string maneuver { get; set; }
  }
  
  public class Leg
  {
      public Distance distance { get; set; }
      public Duration duration { get; set; }
      public string end_address { get; set; }
      public EndLocation end_location { get; set; }
      public string start_address { get; set; }
      public StartLocation start_location { get; set; }
      public List&lt;Step&gt; steps { get; set; }
      public List&lt;object&gt; traffic_speed_entry { get; set; }
      public List&lt;object&gt; via_waypoint { get; set; }
  }
  
  public class OverviewPolyline
  {
      public string points { get; set; }
  }
  
  public class Route
  {
      public Bounds bounds { get; set; }
      public string copyrights { get; set; }
      public List&lt;Leg&gt; legs { get; set; }
      public OverviewPolyline overview_polyline { get; set; }
      public string summary { get; set; }
      public List&lt;object&gt; warnings { get; set; }
      public List&lt;object&gt; waypoint_order { get; set; }
  }
  
  public class RootObject
  {
      public List&lt;GeocodedWaypoint&gt; geocoded_waypoints { get; set; }
      public List&lt;Route&gt; routes { get; set; }
      public string status { get; set; }
  }
  </code></pre>
  
  <p>and I am wanting to get the leg object with this </p>
  
  <pre><code> static async Task&lt;Leg&gt; GetLegAsync(string path)
      {
          Leg leg = null;
          HttpResponseMessage response = await client.GetAsync(path);
          if (response.IsSuccessStatusCode)
          {
              var json = await response.Content.ReadAsStringAsync();
              leg = JsonConvert.DeserializeObject&lt;Leg&gt;(json);
  
          }
  
          return leg;
      }
  </code></pre>
  
  <p>The problem is that when I am accessing the leg object through this it isn't deserialzing properly. Sorry if it's stupid simple but I haven't really messed with HTTP clients and stuff like this. I'm pretty good with C# but I haven't really studied much past just functionality and went into some of this. </p>
  
  <p>EDIT: If this is helpful </p>
  
  <pre><code> static async Task RunAsync(string pos1,string pos2)
      {
          string apiKey = "MUST_KEEP_HIDDEN!";
  
          client.BaseAddress = new Uri("https://maps.googleapis.com/maps/api/directions/json?origin="+pos1+"&amp;destination="+pos2+"&amp;key=" + apiKey);
  
          client.DefaultRequestHeaders.Accept.Clear();
          client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
          //Console.ReadLine();
          Leg leg = await GetLegAsync("https://maps.googleapis.com/maps/api/directions/json?origin=" + pos1 + "&amp;destination=" + pos2 + "4&amp;key=" + apiKey);
  
          showinfo(leg);
  
      }
  </code></pre>
  
  <p>thanks in advance</p>