Gathering detailed insights and metrics for pajv
Gathering detailed insights and metrics for pajv
Gathering detailed insights and metrics for pajv
Gathering detailed insights and metrics for pajv
A command line JSON Schema validator that supports many file formats. Fork of jessedc/ajv-cli.
npm install pajv
Module System
Unable to determine the module system for this package.
Min. Node Version
Typescript Support
Node Version
NPM Version
52 Stars
86 Commits
5 Forks
1 Watching
2 Branches
Updated on 01 Aug 2024
JavaScript (100%)
Cumulative downloads
Total Downloads
Last day
3.5%
3,117
Compared to previous day
Last week
1.4%
18,341
Compared to previous week
Last month
4.9%
82,526
Compared to previous month
Last year
33.4%
911,714
Compared to previous year
6
Command line interface for ajv that utilizes any-json to provide validation against many data formats. pajv
can validate: CSON, Hjson, JSON, JSON5, TOML, and YAML files using JSON Schema. pajv is a fork of ajv-cli.
1npm install -g pajv
1pajv help 2pajv help validate 3pajv help test
This command validates data files against JSON-schema
1pajv validate -s test/schema.json -d test/valid_data.json 2pajv -s test/schema.json -d test/valid_data.json
You can omit validate
command name.
-s
- file name of JSON-schemaOnly one schema can be passed in this parameter
-d
- JSON dataMultiple data files can be passed, as in -r
parameter:
1pajv -s test/schema.json -d "test/valid*.json"
If some file is invalid exit code will be 1.
-r
- referenced schemasThe schema in -s
parameter can reference any of these schemas with $ref
keyword.
Multiple schemas can be passed both by using this parameter mupltiple times and with glob patterns. Glob pattern should be quoted and extensions cannot be omitted.
-m
- meta-schemasSchemas can use any of these schemas as a meta-schema (that is the schema used in $schema
keyword - it is used to validate the schema itself).
Multiple meta-schemas can be passed, as in -r
parameter.
-c
- custom keywords/formats definitionsYou can pass module(s) that define custom keywords/formats. The modules should export a function that accepts Ajv instance as a parameter. The file name should start with ".", it will be resolved relative to the current folder. The package name can also be passed - it will be used in require as is.
For example, you can use -c ajv-keywords
to add all keywords from ajv-keywords package or -c ajv-keywords/keywords/typeof
to add only typeof keyword.
--errors=
: error reporting format. Possible values:
js
(default): JavaScript objectjson
: JSON with indentation and line-breaksline
: JSON without indentaion/line-breaks (for easy parsing)text
: human readable error messages with data paths--changes=
: detect changes in data after validation.
Data can be modifyed with Ajv options --remove-additional
, --use-defaults
and --coerce-types
).
The changes are reported in JSON-patch format (RFC6902).
Possible values are js
(default), json
and line
(see --errors
option).
This command asserts that the result of the validation is as expected.
1pajv test -s test/schema.json -d test/valid_data.json --valid 2pajv test -s test/schema.json -d test/invalid_data.json --invalid
If the option --valid
(--invalid
) is used for the test
to pass (exit code 0) the data file(s) should be valid (invalid).
This command supports the same options and parameters as validate with the exception of --changes
.
You can pass the following Ajv options:
Option | Description |
---|---|
--data | use $data references |
--all-errors | collect all errors |
--unknown-formats= | handling of unknown formats |
--verbose | include schema and data in errors |
--json-pointers | report data paths in errors using JSON-pointers |
--unique-items=false | do not validate uniqueItems keyword |
--unicode=false | count unicode pairs as 2 characters |
--format=full | format mode |
--schema-id= | keyword(s) to use as schema ID |
--extend-refs= | validation of other keywords when $ref is present in the schema |
--missing-refs= | handle missing referenced schemas (true/ignore/fail) |
--inline-refs= | referenced schemas compilation mode (true/false/<number>) |
--remove-additional | remove additional properties (true/all/failing) |
--use-defaults | replace missing properties/items with the values from default keyword |
--coerce-types | change type of data to match type keyword |
--multiple-of-precision | precision of multipleOf, pass integer number |
--error-data-path=property | data path in errors |
--messages=false | do not include text messages in errors |
Options can be passed in either dash-case and camelCase.
See Ajv Options for more information.
See https://github.com/json-schema-everywhere/pajv/releases
MIT
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
Found 0/26 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2024-11-18
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More