skeemas-json-refs

Lightweight solution for resolving json-schema $refs

Usage no npm install needed!

<script type="module">
  import skeemasJsonRefs from 'https://cdn.skypack.dev/skeemas-json-refs';
</script>

README

skeemas-json-refs

Lightweight solution for resolving JSON Refs

Install

npm install skeemas-json-refs

Usage

var jsonRefs = require('skeemas-json-refs'),
    refs = jsonRefs();

refs.add('/some/uri/ref', { 
    nested: { foo:'bar' },
    list: [0, 1, 2]
});

refs.get('/some/uri/ref'); 
// => the whole object

refs.get('/some/uri/ref#/nested/foo'); 
// => 'bar'

refs.get('/some/uri/ref#/list'); 
// => [0, 1, 2]