0

I have an ASP.NET program that uses Swagger to provide API docs. Current;y we have one endpoint that takes a Date value like below:

{
  "region": "string",
  "date": "2023-07-27T13:07:05.359Z"
}

and its corresponding class is defined as:

{
  [Serializable]
  public class Msg
  {
    public string Region { get; set; }
    public DateTime? Date { get; set; }
  }

The problem is, Msg is defined in a separate library and we cant directly change any or it. But we want to revise the Json examle value to:

{
  "region": "string",
  "date": "2023-07-27"
}

Is this possible?

D.J. Elkind
  • 367
  • 2
  • 8
  • Check this answer: https://stackoverflow.com/a/61955594/396005 – Bron Davies Jul 27 '23 at 14:49
  • @BronDavies sorry the question was a bit misleading. We can't change the definition at all--it is defined in a DLL file. But the first answer in your link seems worth trying tho. Will give a try can come back – D.J. Elkind Jul 27 '23 at 15:01

0 Answers0