We have an asp.net-core5 endpoint who return an object
public class ServiceResponse
{
public Balance Balance { get; set; }
public int Code { get; set; }
public object Message { get; set; }
}
public class Balance
{
public float Amount { get; set; }
public string Currency { get; set; }
}
But for some reason the response we received is
{
"$id": "1",
"balance": {
"$id": "2",
"amount": 2130.804,
"currency": "USD"
},
"code": 0,
"message": null
}
Notice the response adds :""$id": "1"" and changes the properties to lowercase
The methods is an async Task
public async Task<IActionResult> GetBalance([FromBody] cl_Balance value)
and we return
return Ok(ServiceResponse);