Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
A command-line JSON and YAML validator that's on your wavelength.
One-off:
npx v8r@latest <filename>
Local install:
npm install -g v8r
v8r <filename>
v8r can validate JSON or YAML files. You can pass filenames or glob patterns:
# single filename
$ v8r package.json
# multiple files
$ v8r file1.json file2.json
# glob patterns
$ v8r 'dir/*.yml' 'dir/*.yaml'
DigitalOcean's Glob Tool can be used to help construct glob patterns
By default, v8r queries Schema Store to detect a suitable schema based on the filename.
# if v8r can't auto-detect a schema for your file..
$ v8r feature.geojson
✖ Could not find a schema to validate feature.geojson
# ..you can specify one using the --schema flag
$ v8r feature.geojson --schema https://json.schemastore.org/geojson
ℹ Validating feature.geojson against schema from https://json.schemastore.org/geojson ...
✔ feature.geojson is valid
Using the --schema
flag will validate all files matched by the glob pattern against that schema. You can also define a custom schema catalog. v8r will search any custom catalogs before falling back to Schema Store.
$ cat > my-catalog.json <<EOF
{ "\$schema": "https://json.schemastore.org/schema-catalog.json",
"version": 1,
"schemas": [ { "name": "geojson",
"description": "geojson",
"url": "https://json.schemastore.org/geojson.json",
"fileMatch": ["*.geojson"] } ] }
EOF
$ v8r feature.geojson -c my-catalog.json
ℹ Found schema in my-catalog.json ...
ℹ Validating feature.geojson against schema from https://json.schemastore.org/geojson ...
✔ feature.geojson is valid
This can be used to specify different custom schemas for multiple file patterns.
v8r always exits with code 0
when:
v8r
was called with --help
or --version
flagsBy default v8r exits with code 1
when an error was encountered trying to validate one or more input files. For example:
This behaviour can be modified using the --ignore-errors
flag. When invoked with --ignore-errors
v8r will exit with code 0
even if one of these errors was encountered while attempting validation. A non-zero exit code will only be issued if validation could be completed successfully and the file was invalid.
v8r always exits with code 98
when:
v8r always exits with code 99
when:
v8r
decide what schema to validate against if I don't supply one?💡 v8r
queries the Schema Store catalog to try and find a suitable schema based on the name of the input file.
💡 v8r
is a fairly thin layer of glue between Schema Store (where the schemas come from) and ajv (the validation engine). It is likely that this kind of problem is either an issue with the schema or validation engine.
💡 v8r
works with JSON schema drafts:
💡 No. There are some with known issues
v8r
validate against a local schema?💡 Yes. The --schema
flag can be either a path to a local file or a URL.
📦 0.10.1 - 2022-01-06
--version
flag when installed globally in some environmentsFAQs
A command-line JSON, YAML and TOML validator that's on your wavelength
The npm package v8r receives a total of 1,491 weekly downloads. As such, v8r popularity was classified as popular.
We found that v8r demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.