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

1 Like

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!