MCPcopy
hub / github.com/browserless/browserless / cleanupAbsolutePaths

Function cleanupAbsolutePaths

scripts/build-open-api.js:49–58  ·  view source on GitHub ↗
(swaggerJSON)

Source from the content-addressed store, hash-verified

47};
48
49const cleanupAbsolutePaths = (swaggerJSON) => {
50 const jsonString = JSON.stringify(swaggerJSON);
51
52 const cleanedString = jsonString.replace(
53 /"\$ref":\s*"#\/definitions\/import\([^)]+\)\.([^"]+)"/g,
54 '"$ref": "#/definitions/$1"',
55 );
56
57 return JSON.parse(cleanedString);
58};
59
60const buildOpenAPI = async (
61 externalHTTPRoutes = [],

Callers 1

buildOpenAPIFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected