CH Public Data API OpenAPI specification refs refer to localhost

Hello,

The OpenAPI references for: Companies House Public Data API: Specification summary

Here:
https://developer-specs.company-information.service.gov.uk/api.ch.gov.uk-specifications/swagger-2.0/spec/swagger.json

Reference http://127.0.0.1:31903, I’d like to autogenerate my Typescript types for your API but this is causing a few issues.

Replacing that with https://developer-specs.company-information.service.gov.uk allows me to access the referenced file. But that file also then contains the localhost as path.

Is this something I need to work around?

Also the entry for Officers is repeated twice which is also the case with the website.

Alternatively if we could get access to https://github.com/companieshouse/api.ch.gov.uk-specifications/ then this might be something we could do ourselves or work around with a simple text replace. None of the API’s on Github are public. Unsure if that’s something that could change

2 Likes

We have 127.0.0.1 in the specs because they vary between environments during development and we expect that people will adjust them manually for their specific environment. However we can see that is not convenient for developers using the live service so we will investigate that when priorities allow.

1 Like

No worries, I had a feeling that it could be something like that.

If we had a convenient way to access all files at once, like a zip of all of them that might be good. I can see how this would be low down in the list of priorities though. Thanks for taking the time to reply so quickly!

Hi @lgeorge - any updates on this? What is the workaround you are recommending to manually adjust the links to?

Its been almost 2 years since these were published. It would incredibly helpful if the live service was operational!

Thanks

Simply replace the highlighted with: developer-specs.company-information.service.gov.uk for every schema reference
PS: you may have a different port number concatenated to the 127.0.0.1

Hi,this is not high amongst the priorities at present balanced against the other things Companies House is being asked to do by Government. They can be modified manually for specific environments and this is what we do internally. Happy to raise the point again for you if you wish.