json-schema-id-ref-parser
v0.3.3
Published
Resolves and dereferences pointers to schemas with an "id" property
Downloads
11
Readme
json-schema-id-ref-parser
Resolves and dereferences pointers to schemas with an "id" property
Installation
npm install --save json-schema-id-ref-parser
Usage
var ramlParser = require('raml-1-parser');
var idRefParser = require('json-schema-id-ref-parser');
module.exports = loadRaml;
function loadRaml(filename, options) {
return ramlParser.loadApi(filename, options)
.then((raml) => {
var ramlJson = raml.toJSON();
return idRefParser.dereference(ramlJson.schemas)
.then(idRefParser.stringifySchemas)
.then((schemas) => {
ramlJson.schemas = schemas;
return ramlJson;
})
;
})
;
}
Credits
License
ISC