import SwaggerParser from 'swagger-parser';
async function run() {
let api = await SwaggerParser.bundle("./examples/specs/petstore/petstore-several-files/petstore-several-files.yaml");
console.log(JSON.stringify(api, null, 2));
}
run();
The ref of the second example still is present in bundled spec :(. Redoc, swagger-ui and openapi-generator are not able to manage correctly this second example :(.
As workaround, we have to duplicate examples.yaml file (even if it is exactly the same content) but it is very dirty :(
Hi,
By using swagger-parser
v10.0.3
, I tried to bundle my file that contains several external references from$ref
into one by usingbundle
function.My spec file is
And my js code is :
The execution sdtout is :
The ref of the second example still is present in bundled spec :(.
Redoc
,swagger-ui
andopenapi-generator
are not able to manage correctly this second example :(. As workaround, we have to duplicateexamples.yaml
file (even if it is exactly the same content) but it is very dirty :(Thanks.