{"id":48120,"library":"gulp-json-schema","title":"gulp-json-schema","description":"Gulp plugin for validating JSON files against JSON Schema (draft v4) using the tv4 validator. Version 1.0.0 is the latest stable release, with no recent updates. Key differentiators: it integrates seamlessly into Gulp pipelines, supports custom formats and keywords, schema preloading for $ref resolution, and options like banUnknownProperties and checkRecursive. Alternatives include gulp-ajv for newer JSON Schema drafts and better performance.","status":"active","version":"1.0.0","language":"javascript","source_language":"en","source_url":"https://github.com/io-monad/gulp-json-schema","tags":["javascript","gulpplugin","json","jsonschema","schema","validation"],"install":[{"cmd":"npm install gulp-json-schema","lang":"bash","label":"npm"},{"cmd":"yarn add gulp-json-schema","lang":"bash","label":"yarn"},{"cmd":"pnpm add gulp-json-schema","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"JSON Schema validation backend","package":"tv4","optional":false},{"reason":"Peer dependency for plugin integration","package":"gulp","optional":false}],"imports":[{"note":"CJS-only; not ESM compatible.","wrong":"import jsonSchema from 'gulp-json-schema';","symbol":"jsonSchema","correct":"const jsonSchema = require('gulp-json-schema');"},{"note":"Options can be passed as first argument with schema property.","wrong":"jsonSchema('schema.json', { schema: 'schema.json' });","symbol":"jsonSchema (with options in first argument)","correct":"jsonSchema({ schema: 'schema.json', verbose: true });"},{"note":"tv4 is not exported; use `configure` option to customize tv4 instance.","wrong":"const tv4 = require('gulp-json-schema').tv4;","symbol":"tv4 (from internal)","correct":"const jsonSchema = require('gulp-json-schema');"}],"quickstart":{"code":"const gulp = require('gulp');\nconst jsonSchema = require('gulp-json-schema');\n\ngulp.task('validate', () => {\n  return gulp.src('data/**/*.json')\n    .pipe(jsonSchema({ schema: 'schema.json', verbose: true, banUnknownProperties: true }));\n});","lang":"javascript","description":"Basic Gulp task that validates all JSON files in data/ against schema.json with verbose output and unknown property ban."},"warnings":[{"fix":"Use gulp-ajv or another plugin that supports newer drafts.","message":"Only supports JSON Schema draft v4 via tv4; newer drafts (v6, v7, 2019-09, 2020-12) are not supported.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Use dynamic import within a CommonJS wrapper or migrate to an ESM-compatible plugin.","message":"CJS-only; does not provide ESM exports. Node.js ESM users cannot import directly.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Consider migrating to gulp-ajv (ajv-based) for active support.","message":"tv4 is unmaintained; no fixes for security or spec updates.","severity":"deprecated","affected_versions":">=1.0.0"},{"fix":"Preload schemas locally or use offline validation.","message":"Remote schema fetching requires `loadMissingSchemas: true` and request library; may expose to network issues or security concerns.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"search_vec":"'1.0.0':21 'ajv':59 'altern':55 'banunknownproperti':52 'better':66 'checkrecurs':54 'custom':40 'differenti':32 'draft':14,64 'file':10 'format':41 'gulp':2,5,37,58 'gulp-ajv':57 'gulp-json-schema':1 'gulpplugin':69 'includ':56 'integr':34 'javascript':68 'json':3,9,12,62,70 'jsonschema':71 'key':31 'keyword':43 'latest':24 'like':51 'newer':61 'option':50 'perform':67 'pipelin':38 'plugin':6 'preload':45 'recent':29 'ref':47 'releas':26 'resolut':48 'schema':4,13,44,63,72 'seamless':35 'stabl':25 'support':39 'tv4':18 'updat':30 'use':16 'v4':15 'valid':8,19,73 'version':20","created_at":"2026-06-07T16:55:01.106494+00:00","updated_at":"2026-06-07T16:55:01.106494+00:00","problems":[{"fix":"Use require('gulp-json-schema') instead.","cause":"Using ESM import syntax (import jsonSchema from 'gulp-json-schema') with a CJS-only module.","error":"TypeError: jsonSchema is not a function"},{"fix":"Use jsonSchema({ schema: mySchemaObject }) or jsonSchema('path/to/schema.json').","cause":"Passed a schema object as first argument without using { schema: ... } syntax.","error":"Error: Invalid schema: [object Object]"},{"fix":"Rewrite schema to be draft v4 compatible or use a different validator.","cause":"Schema uses draft v6/v7 features not supported by tv4.","error":"ValidationError: Data does not match any schemas from 'oneOf'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/io-monad/gulp-json-schema","github":"https://github.com/io-monad/gulp-json-schema","docs":null,"changelog":null,"pypi":null,"npm":"gulp-json-schema","openapi_spec":null,"status_page":null,"smithery":null,"categories":["devops"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-07","next_check":"2026-09-05","install_tag":null}}