Gathering detailed insights and metrics for @stoplight/better-ajv-errors
Gathering detailed insights and metrics for @stoplight/better-ajv-errors
Gathering detailed insights and metrics for @stoplight/better-ajv-errors
Gathering detailed insights and metrics for @stoplight/better-ajv-errors
JSON Schema validation for Human 👨🎤
npm install @stoplight/better-ajv-errors
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
2 Stars
103 Commits
3 Forks
2 Watching
9 Branches
55 Contributors
Updated on 07 Sept 2022
JavaScript (100%)
Cumulative downloads
Total Downloads
Last day
-6%
148,109
Compared to previous day
Last week
1.2%
824,606
Compared to previous week
Last month
10.8%
3,338,390
Compared to previous month
Last year
71.7%
30,094,316
Compared to previous year
2
1
JSON Schema validation for Human 👨🎤
Main goal of this library is to provide relevant AJV error messages. It's a fork of great better-ajv-errors by Atlassian, with focus on being leaner.
1$ yarn add @stoplight/better-ajv-errors
or
1$ npm i @stoplight/better-ajv-errors
Also make sure that you installed ajv package to validate data against JSON schemas.
First, you need to validate your payload with ajv
. If it's invalid then you
can pass validate.errors
object into better-ajv-errors
.
1import Ajv from 'ajv'; 2import betterAjvErrors from '@stoplight/better-ajv-errors'; 3// const Ajv = require('ajv'); 4// const betterAjvErrors = require('better-ajv-errors'); 5 6// You need to pass `jsonPointers: true` 7const ajv = new Ajv({ jsonPointers: true }); 8 9// Load schema and data 10const schema = ...; 11const data = ...; 12 13const validate = ajv.compile(schema); 14const valid = validate(data); 15 16if (!valid) { 17 const output = betterAjvErrors(schema, validate.errors, { 18 propertyPath: [], 19 targetValue: data, 20 }); 21 console.log(output); 22}
Returns formatted validation error to print in console
. See
options.format
for further details.
Type: Object
The JSON Schema you used for validation with ajv
.
Type: Array
Array of ajv validation errors
Type: Object
Type: Array
Property path of a validated object that is a part of a bigger document. Might be empty if the validated object equals the whole document.
Type: Object
The JSON payload you validate against using ajv
.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 1/30 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
project is not fuzzed
Details
Reason
security policy file not detected
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
32 existing vulnerabilities detected
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