The present tool verifies JSON files against schemas defined with JSON Schema.
json_validator [--allow_comments] <path to schema> <path to file to verify> [path to stamp file]
The third argument represents the path to a stamp file which gets updated when the tool runs successfully. This argument is mostly designed for integration with GN actions.
--allow_comments flags enables parsing non-standard JSON files that contain C-style comments (
/* block */ and
// inline). The comments are ignored. This only applies to the file being verified -- the schema file may not contain comments even if this option is enabled.
The schema passed to the tool may refer to other schema files. The tool will be able to locate schema references for schemas specified as paths relative to the folder containing the main schema.
For example, if the tool is given a schema
/path/to/main_schema.json and that schema contains a reference to
file:another/sub_schema.json#/definitions/foo, the tool will look for the second schema at
Paths to schemas may be specified as
file:another/sub_schema.json or more simply