tv4-loader
v0.0.3
Published
Webpack loader that used tv4 for json validation.
Downloads
3
Maintainers
Readme
tv4-loader
Webpack loader for validating json files against a schema file. Can be used in combination with json-loader.
Usage
module: {
preLoaders: [
{
test: path.join(__dirname, 'some-json-file.json'),
loader: 'tv4',
query: {
schema: path.join(__dirname, 'some-schema.json'),
}
}
],
loaders: [
{
test: /\.json$/,
loader: 'json'
}
]
}
Query Parameters
schemas
- Pre-register a schema for reference by other schema and synchronous validation. See tv4 for further informations.checkRecursive
- Enable support for recursive schemas. See tv4 Documentation.banUnknownProperties
- Throw an error for all unknown properties used in your json file. See tv4 Documentation.
Known Limitations
schema
needs to be an absolute path to the schema file.
License
MIT