JSPM

gulp-jsonschema-deref

0.0.3
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 395
  • Score
    100M100P100Q78346F
  • License MIT

Dereference and bundle json schema

Package Exports

  • gulp-jsonschema-deref

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (gulp-jsonschema-deref) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

gulp-jsonschema-deref

Build Status Dependencies Inline docs npm License

Gulp plugin to resolve $ref references (local+file+http) and bundle into a single json schema

Install

$ npm install --save-dev gulp-jsonschema-deref

Usage

var gulp = require('gulp');
var jsonschemaDeref = require('gulp-jsonschema-deref');

var schemaFiles = '*.schema.json',
    definitionsFiles = 'definitions/' + schemaFiles,	// (optional)
    buildFolder = 'build';

gulp.task('resolve-schema', function() {
    var stream = gulp.src( schemaFiles )
        .pipe( jsonschemaDeref() )
        .pipe( gulp.dest(buildFolder) );
    return stream;
});


gulp.task('watch-schema', function() {
    var watcher = gulp.watch( [schemaFiles,definitionsFiles], ['resolve-schema']);

    watcher.on('change', function(event) {
      console.log('File ' + event.path + ' was ' + event.type + ', running tasks...');
    });
});

gulp.task('default', ['resolve-schema','watch-schema']);

API

Currently, dependant on json-schema-ref-parser

jsonschemaDeref([options])

options

see: dereference

License

MIT © oori