title: httpClient.GetFromJsonAsync .NET Core 3.1 returns empty items with a converter
body: <p>I'm working on a blazor application webassembly core hosted, and when I'm trying to get a collection of items from the server, I get the right number of items but they are all empty.</p>
  <p>My models look like this :</p>
  <pre><code>public interface IPerson
  {
      string Name { get; set; }
  }
  
  public class Customer : IPerson
  {
      public decimal CreditLimit { get; set; }
  }
  
  public class Employee : IPerson
  {
      public string OfficeNumber { get; set; }
  }
  
  public class Model
  {
      public string Name { get; set; }
      public float SomeParameters { get; set; }
      
      public IPerson Person { get; set; }
  }
  </code></pre>
  <p>And I implemented a converter with the TypeDiscriminator template : <a href="https://docs.microsoft.com/fr-fr/dotnet/standard/serialization/system-text-json-converters-how-to#support-polymorphic-deserialization" rel="nofollow noreferrer">https://docs.microsoft.com/fr-fr/dotnet/standard/serialization/system-text-json-converters-how-to#support-polymorphic-deserialization</a></p>
  <p>Using client side :</p>
  <pre><code>var options = new JsonSerializerOptions();
  options.Converters.Add(new PersonConverterWithTypeDiscriminator());
  return await httpClient.GetFromJsonAsync&lt;IEnumerable&lt;Model&gt;&gt;(baseAPIUri, options);
  </code></pre>
  <p>Using server side :</p>
  <pre><code>services.AddControllersWithViews()
      .AddJsonOptions(options =&gt;
      {
          options.JsonSerializerOptions.Converters.Add(new NullableStructSerializerFactory());
          options.JsonSerializerOptions.Converters.Add(new PersonConverterWithTypeDiscriminator());
          options.JsonSerializerOptions.IgnoreNullValues = true;
          options.JsonSerializerOptions.PropertyNameCaseInsensitive = true;
          options.JsonSerializerOptions.PropertyNamingPolicy = JsonNamingPolicy.CamelCase;
          options.JsonSerializerOptions.IgnoreReadOnlyProperties = true;
      });
  </code></pre>
  <p>Everithings works well when the client send the model to the server to save it, with <code>httpClient.PostAsJsonAsync(baseAPIUri, item, options);</code></p>
  <p>But when the client asks for the collection, I enter in the write() method, and never in the read() method in the convertor.</p>
  <p>I tried to retrive the items without the serializer options and if the parameter Person is null, the deserialization is correct.</p>
  <p>EDIT : I copied the Http response content in a file, created a new project .Net core in a console and add the lines :</p>
  <pre><code>var options = new JsonSerializerOptions
      {
          IgnoreNullValues = true,
          PropertyNameCaseInsensitive = true,
          PropertyNamingPolicy = JsonNamingPolicy.CamelCase,
          IgnoreReadOnlyProperties = true
      };
      options.Converters.Add(new NullableStructSerializerFactory());
      options.Converters.Add(new PersonConverterWithTypeDiscriminator());
      
  string json = File.ReadAllText(&quot;D:\\model.json&quot;);
  var newModel = System.Text.Json.JsonSerializer.Deserialize&lt;IEnumerable&lt;Model&gt;&gt;(json, options);
  </code></pre>
  <p>And it worked out</p>