Skip to content

Validates a JSON-schema with external-file references using AJV

Notifications You must be signed in to change notification settings

tommueller/validate-json-schema

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

validate-json-schema

Validates JSON-files against a JSON-schema, which have inner file-depencies. While I was trying to validate against a JSON-schema with references to other schema-files, I had the problem that ajv could not resolve the depencies by default.

So in order to resolve the "$ref" in a schema like this:

"options": {
  "items": {
    "$ref": "option.json"
  },
  "type": "array",
  "minItems": 1
}

I created this package.

Install

npm install -g validate-json-schema

Usage

Use this command to run the validation:

validate-json-schema -j json-file.json -s schema-file.json

CONDITIONS:

  • all paths must be relative to the current folder
  • all "sub-schema"-files must be within the same folder as the schema-file.json

Enjoy! Peace.

About

Validates a JSON-schema with external-file references using AJV

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published