kevbite / CompaniesHouse.NET

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

'Company Type' Convert Error #91

Closed wreid306 closed 6 years ago

wreid306 commented 6 years ago

Hi Kev - error when searching company, seems we need a new company type added:

{"Error converting value \"scottish-charitable-incorporated-organisation\" to type 'CompaniesHouse.Response.CompanyType'. Path 'company_type', line 1, position 3319."}

Would it be possible, in the event of company type not parsing, having maybe an enum 'Other' and then the value as an addition string field?

kevbite commented 6 years ago

Hey @wreid306, I'll add this as it's a quick fix... but I'll also add an issue to be able to fall back to an Other value.

kevbite commented 6 years ago

@wreid306 just checked and it looks like this value is part of the latest build. Can you update to the latest NuGet package and try it again?

wreid306 commented 6 years ago

Hi Kev, updated to v6.1.1 and now getting this for the same query

image

wreid306 commented 6 years ago

Thats the query if it helps

image

kevbite commented 6 years ago

Just added the same test (https://github.com/kevbite/CompaniesHouse.NET/commit/14c0f12af58cf732b7c90d6146dd18d3951dc7c2) and pushed it up to our build server but it's passing - https://ci.appveyor.com/project/kevbite/companieshouse-net/builds/19434053/tests

It's also coded to deal with null company_status too so not really sure what is going off...

wreid306 commented 6 years ago

ahh shoot! Ill take another look here, I must be doing something silly!

Cheers for your help!

wreid306 commented 6 years ago

Yep, I was being an idiot, although i updated to latest version in nuget, it somehow kept a reference to an older version... just sorted it and its working now!

kevbite commented 6 years ago

Glad you've got it sorted! Going to close this issue but feel free to open another one if you experience any other problems.