I have a simple http server. I send some json object over POST
At first, I use json converter to parse the json and fill nonserializable objects up
public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
{
list<SomeClass> list = JArray.Load(reader).Cast<JObject>().Select(o => new SomeClass((string)o.GetValue("val1"), (string)o.GetValue("val2"))).ToList();
return list;
}
The list is loaded fine, but on the next step the field of the class MyClass containing that list is empty
[HttpPost]
public IActionResult PostData([FromBody]MyClass myClass)
Where to look to fix this issue?