You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
.
|- tools
| |- bundler.js // contains use of oasNormalize
|- api
|- my-api.yaml
|- paths
|- path.yaml
If my-api.yaml contains a $ref: "./paths/path.yaml" it will fail with
node ./tools/bundler.js ./api/my-api.yaml
But will succeed with
cd ./api
node ../tools/bundler.js ./my-api.yaml
A $ref should be evaluated relative to the currently open file.
My bundler.js code:
import OASNormalize from "oas-normalize";
// if I make next line load ./api/my-openapi.yaml then it will fail to load references
const oas = new OASNormalize("./my-openapi.yaml", {
enablePaths: true,
});
oas
.validate()
.then(() => oas.convert())
.then((definition) => {
console.log(definition);
})
.catch((err) => {
console.error(err);
});
The text was updated successfully, but these errors were encountered:
If
my-api.yaml
contains a$ref: "./paths/path.yaml"
it will fail withBut will succeed with
A
$ref
should be evaluated relative to the currently open file.My bundler.js code:
The text was updated successfully, but these errors were encountered: