kevbite / CompaniesHouse.NET

A simple .NET client wrapper for CompaniesHouse API
MIT License
37 stars 44 forks source link

Charges type conversion exception #151

Closed mattu08 closed 3 years ago

mattu08 commented 3 years ago

Hi,

I have been testing the charges functionality recently and have started getting an exception when performing a basic charges search.

Exception:

Newtonsoft.Json.JsonReaderException: 'Could not convert string to integer: 3011770624. Path 'items[1].insolvency_cases[0].transaction_id', line 1, position 2806.'

Company Reg number tested on: 03487070

CompaniesHouse.NET v7.9.5 most recent build.

It's a bit of an odd error, but looks to be a conversion issue probability due to a companies house change.

Cheers,

Matt

kevbite commented 3 years ago

Hey, thanks for raising, just checked their documentation and it still says it should be passing back an integer. So guess they've decided to start passing back a string of an integer... image image

I'll write a converter for it or something later on, as it doesn't seem worth changing the type to a string if it's going to be an int.

kevbite commented 3 years ago

Just realized the problem, the value is coming back which is over the maximum size for an int.

mattu08 commented 3 years ago

@kevbite Good find! 👍 I’ll let you know if I find anymore like this, thanks for looking into this.

kevbite commented 3 years ago

@mattu08 it's not pushed to NuGet yet as we're having a bit of a problem with the companies house api throttling our tests. I might just disable the tests for the older frameworks as these are not supported by MS anyway now.