title: Can I use a custom JsonSerializer for POST and PUT API request to handle interface parameter?
body: <p>I am trying to pass an interface parameter as part of my request object for POST and PUT APIs I have created, but I am not sure how to add a JSON deserializer to be able to specify which concrete class to use for which service. How do I specify that I want to use FooRequestData for one and FooOtherRequestData for the other?</p>
  <pre><code>    [ApiController]
      [Route(&quot;api/[controller]&quot;)]
      public class FooController
      {
          // POST api/&lt;APIController&gt;
          [HttpPost]
          public FooResponse Post(FooRequest request)
          {
              return FooService.Post(request);
          }
  
          // PUT api/&lt;APIController&gt;
          [HttpPut]
          public FooResponse Put(FooRequest request)
          {
              return FooService.Put(request);
          }
      }
  
      public class FooRequest : IRequest&lt;Foo&gt;
      {
          public IRequestData RequestData { get; set; }
      }
  
      public class FooRequestData : IRequestData
      {
          public string Boo { get; set; }
      }
  
      public class FooOtherRequestData : IRequestData
      {
          public string Hoo { get; set; }
      }
  
  </code></pre>