oas-resolver-browser
Version:
Resolve external $refs in OpenAPI (swagger) 2.0 / 3.x definitions
23 lines (18 loc) • 496 B
Markdown
# oas-resolver
Forked from https://github.com/Mermade/oas-kit
v2.5.0
- Sync with https://github.com/Mermade/oas-kit v2.5.0
## Usage
```js
const yaml = require('yaml');
const input = yaml.parse(str);
const source = url; // or filename
resolver.resolve(input,source,options)
.then(function(options){
fs.writeFileSync(outputFile,yaml.stringify(options.openapi),'utf8');
})
.catch(function(ex){
// ...
});
```
See here for complete [documentation](/docs/options.md) of the `options` object.