I have also encountered this error for a Web API (.Net Core 3.0) action that was binding to a string
instead to an object
or a JObject
. The JSON was correct, but the binder tried to get a string from the JSON structure and failed.
So, instead of:
[HttpPost("[action]")]
public object Search([FromBody] string data)
I had to use the more specific:
[HttpPost("[action]")]
public object Search([FromBody] JObject data)