Before upgrade, the .Netcore version is 2.2, The string in JSON http request body can be converted to int in object like below Json
Post: api/ValidateMember
Host: XXXX
Content-Type: application/json
{
"id": "125324"
}
to object:
class RequestWithID
{
public int id {get;set;}
}
...
[HttpPost("api/ValidateMember")]
public bool ValidateMember(RequestWithID requestWithID)
{
...
}
This can work well before.
But after the .Netcore version upgrade to 3.1. there will always be an error with same request: The JSON value could not be converted to System.Int32. How to support the dynamic parsing of the string to int in .Netcore 3.1?