elucidsoft / dotnet-stellar-sdk

Stellar API SDK for .NET 6.x
Apache License 2.0
117 stars 55 forks source link

Desrialization through #361

Closed taxinvoice closed 2 years ago

taxinvoice commented 2 years ago
private List<Balance> balances;

protected override async Task OnInitializedAsync()
{
    balances= await Http.GetFromJsonAsync<List<Balance>>($"balance");  ///get error
 }

I can serialize on the server but deserialization fails as below..i assume its something to do with json annontations on properties of balance?

Unhandled exception rendering component: Each parameter in the deserialization constructor on type 'stellar_dotnet_sdk.responses.Balance' must bind to an object property or field on deserialization. Each parameter name must match with a property or field on the object. The match can be case-insensitive.

Kirbyrawr commented 2 years ago

Hi, will take a look into it soon

taxinvoice commented 2 years ago

Fixed it, i replaced default serializer with Newtonsoft

Kirbyrawr commented 2 years ago

Thanks, sorry i couldn't check on time