0.3.3 • Published 5 years ago

json-schema-id-ref-parser v0.3.3

Weekly downloads
3
License
ISC
Repository
github
Last release
5 years ago

json-schema-id-ref-parser

Resolves and dereferences pointers to schemas with an "id" property

build status dependency status coverage status

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

Jordan Klassen

License

ISC

0.3.3

5 years ago

0.3.2

6 years ago

0.3.1

6 years ago

0.3.0

8 years ago

0.2.0

8 years ago

0.1.0

8 years ago