Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/forivall/json-schema-id-ref-parser
https://github.com/forivall/json-schema-id-ref-parser
Last synced: 10 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/forivall/json-schema-id-ref-parser
- Owner: forivall
- License: isc
- Created: 2016-10-12T22:47:18.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2023-03-01T22:25:14.000Z (almost 2 years ago)
- Last Synced: 2024-04-26T03:03:57.743Z (8 months ago)
- Language: JavaScript
- Size: 862 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# json-schema-id-ref-parser
Resolves and dereferences pointers to schemas with an "id" property
[![build status](https://secure.travis-ci.org/forivall/json-schema-id-ref-parser.svg)](http://travis-ci.org/forivall/json-schema-id-ref-parser)
[![dependency status](https://david-dm.org/forivall/json-schema-id-ref-parser.svg)](https://david-dm.org/forivall/json-schema-id-ref-parser)
[![coverage status](https://coveralls.io/repos/github/forivall/json-schema-id-ref-parser/badge.svg)](https://coveralls.io/github/forivall/json-schema-id-ref-parser)## Installation
```
npm install --save json-schema-id-ref-parser
```## Usage
```js
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](https://github.com/forivall/)## License
ISC