OpenAPI Schema has invalid URLs

I’m trying to get a handle on the Companies House API response schema, so I had a look at the OpenAPI spec. It seems, however, that each endpoint has an invalid URL to the sub schema.

See below for an example:
https://developer-specs.company-information.service.gov.uk/api.ch.gov.uk-specifications/swagger-2.0/spec/swagger.json

"/company/{companyNumber}/registered-office-address": {
    "$ref": "http://127.0.0.1:31785/api.ch.gov.uk-specifications/swagger-2.0/spec/companyAddress.json#/getCompanyAddress"
},

Notice http://127.0.0.1:31785/api.ch.gov.uk-specifications, which is an invalid URL.

I really need access to this for schema validation in our service. Can anyone help?

Thanks

1 Like

To view the OpenAPI spec, just replace http://127.0.0.1:31785 with https://developer-specs.company-information.service.gov.uk.

For example:
https://developer-specs.company-information.service.gov.uk/api.ch.gov.uk-specifications/swagger-2.0/spec/companyAddress.json#/getCompanyAddress

Kind of annoying to do this programmatically though, hopefully someone will fix the domain.

2 Likes

And watch out for the port, that may change!

1 Like

Hi, I came across the same issue and replaced the references, but the problem is there are sub-references, so it is endless, dont we have a valid Open API Specifications with proper refs please?