Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/oori/gulp-jsonschema-deref
Gulp plugin to resolve $ref references (local+file+http) and bundle into a single json schema
https://github.com/oori/gulp-jsonschema-deref
gulp-jsonschema-deref gulp-plugins json-schema
Last synced: 8 days ago
JSON representation
Gulp plugin to resolve $ref references (local+file+http) and bundle into a single json schema
- Host: GitHub
- URL: https://github.com/oori/gulp-jsonschema-deref
- Owner: oori
- License: mit
- Created: 2016-06-09T01:36:35.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-05-03T13:32:48.000Z (over 6 years ago)
- Last Synced: 2025-01-13T04:06:54.999Z (18 days ago)
- Topics: gulp-jsonschema-deref, gulp-plugins, json-schema
- Language: JavaScript
- Homepage:
- Size: 57.6 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
# gulp-jsonschema-deref
[![Build Status](https://travis-ci.org/oori/gulp-jsonschema-deref.svg?branch=master)](https://travis-ci.org/oori/gulp-jsonschema-deref)
[![Dependencies](https://david-dm.org/oori/gulp-jsonschema-deref.svg)](https://david-dm.org/oori/gulp-jsonschema-deref)
[![Inline docs](http://inch-ci.org/github/oori/gulp-jsonschema-deref.svg?branch=master)](http://inch-ci.org/github/oori/gulp-jsonschema-deref)
[![npm](http://img.shields.io/npm/v/gulp-jsonschema-deref.svg)](https://www.npmjs.com/package/gulp-jsonschema-deref)
[![License](https://img.shields.io/npm/l/gulp-jsonschema-deref.svg)](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
```js
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](https://github.com/BigstickCarpet/json-schema-ref-parser)### jsonschemaDeref([options])
#### options
see: [dereference](https://github.com/BigstickCarpet/json-schema-ref-parser/blob/master/docs/ref-parser.md#dereferenceschema-options-callback)
## License
MIT © [oori](https://github.com/oori)