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
Typescript
Module System
Min. Node Version
Node Version
NPM Version
98.6
Supply Chain
95.8
Quality
75.4
Maintenance
100
Vulnerability
100
License
JavaScript (100%)
Total Downloads
79,634,460
Last Day
35,948
Last Week
1,087,799
Last Month
4,730,444
Last Year
39,153,834
NOASSERTION License
2 Stars
103 Commits
3 Forks
1 Watchers
11 Branches
61 Contributors
Updated on Sep 07, 2022
Minified
Minified + Gzipped
Latest Version
1.0.3
Package Id
@stoplight/better-ajv-errors@1.0.3
Unpacked Size
31.06 kB
Size
5.29 kB
File Count
7
NPM Version
8.15.0
Node Version
16.17.0
Cumulative downloads
Total Downloads
Last Day
5.2%
35,948
Compared to previous day
Last Week
-8.6%
1,087,799
Compared to previous week
Last Month
8.6%
4,730,444
Compared to previous month
Last Year
69%
39,153,834
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
35 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-06-23
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