Hi, Im trying to download the API specifications for Companies House Public Data API, the swagger file has many references for 127.0.0.1:10000, I replaced those with developer-specs.company-information.service.gov.uk and it worked but the problem is that there are many sub-references as well to 127.0.0.1:10000 which can’t be fixed, so if we need to import the swagger file into a API management / test tool then import will always be missing many key parts including schemas, paths, resources, etc
Is there anyway to get proper Open API specifications / Swagger file please?
I also noticed this issue and it makes using the published swagger next to impossible without some form of intervention
I wrote a little server to sit locally on port 10000 to forward calls to the correct sever; at least now I can codegen a client from the specification
import { serve } from '@hono/node-server';
import { Hono } from 'hono';
const app = new Hono();
app.get('/api.ch.gov.uk-specifications/swagger-2.0/*', async (c) => {
console.log('fetching from', c.req.url);
const newUrl = c.req.url.replace(
'http://127.0.0.1:10000/',
'https://developer-specs.company-information.service.gov.uk/',
);
console.log('fetching from', newUrl);
const response = await fetch(newUrl);
if (!response.ok) {
return c.status(response.status);
}
return c.json(await response.json());
});
serve({
fetch: app.fetch,
port: 10000,
});