Hello,
How to handle datatype missmatch values in .net core api request object.
Examble :
Have a api request object like below
Class math{
public int number1 {get; set;}
public int number2 {get; set;}
public bool isActive {get; set;}
}
From the request (postman or any other client)
calling the api with below set of request
{
number1 : 20,
number2 : 10,
isActive : "True"
The above sample isActive is bool type, but from the request client its like String
Getting the below exception :
The JSON value could not be converted to System.Nullable`1[System.Boolean]'
Thanks in Advance.