json-schema-loader

1.0.0 • Public • Published

Json Schema Loader

This package is part of the doca suite. Please file any issues at the doca repository

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.

/json-schema-loader/

    Package Sidebar

    Install

    npm i json-schema-loader

    Weekly Downloads

    850

    Version

    1.0.0

    License

    BSD-3-Clause

    Last publish

    Collaborators

    • rexscaria
    • dcruz_cf
    • xuranwang
    • jculvey
    • sejoker
    • vasturiano
    • pcostanzo
    • cf-radar
    • cf-ci-write
    • segments-write
    • thibmeu
    • xortive
    • gurjinder
    • cf-ci2
    • lvalenta
    • worenga
    • chiminator
    • third774
    • jasnell
    • terinjokes
    • celso
    • jsteinberger
    • geelen
    • gregbrimble
    • asapzacy
    • marksteyn
    • g4brym
    • wrangler-publisher
    • snigdha34
    • sgoodhew_cf
    • cf-media-manager
    • dash_service_account
    • lbarthonet
    • jacobbednarz
    • lerwincf
    • simonabadoiu
    • cms1919