Skip to content

Webpack loader that resolves both internal and external JSON Schema references.

License

Notifications You must be signed in to change notification settings

jsio-private/json-schema-loader

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Json Schema Loader

Installation

npm install json-schema-loader --save

Description

Webpack loader that resolves both internal and external json schema references ($ref properties). The loader uses json-schema-ref-parser to resolve references. It supports both JSON and YAML. Based on @pr0da/json-schema-loader.

Usage

var resolvedSchema = require('json-schema-loader!./schema.json');

Or define it in your webpack.config.js

module: {
  loaders: [{
    test: /\.json$/,
    exclude: /node_modules/,
    loader: 'json-schema-loader'
  }]
}
var resolvedSchema = require('./schema.json');

Options

useSource: boolean

This loader normally passes the RefParser the resourcePath, not the source. If you want to chain loaders, make sure to set useSource=true.

About

Webpack loader that resolves both internal and external JSON Schema references.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%