Gathering detailed insights and metrics for json-schema-migrate
Gathering detailed insights and metrics for json-schema-migrate
Gathering detailed insights and metrics for json-schema-migrate
Gathering detailed insights and metrics for json-schema-migrate
Migrate JSON-Schema draft-04 to draft-07, draft-2019-09 or draft-2020-12
npm install json-schema-migrate
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
25 Stars
28 Commits
4 Forks
6 Watching
1 Branches
2 Contributors
Updated on 28 Jul 2024
TypeScript (86.46%)
JavaScript (13.54%)
Cumulative downloads
Total Downloads
Last day
0.1%
66,505
Compared to previous day
Last week
8.9%
359,994
Compared to previous week
Last month
29.9%
1,422,906
Compared to previous month
Last year
54.5%
10,776,471
Compared to previous year
Migrate JSON-Schema from draft-04 to draft-07, draft-2019-09 or draft-2020-12
npm install json-schema-migrate
1const migrate = require("json-schema-migrate") 2const schema = { 3 id: "my-schema", 4 minimum: 1, 5 exclusiveMinimum: true, 6} 7migrate.draft7(schema) 8// or migrate.draft2019(schema) 9// or migrate.draft2020(schema) 10 11console.log(schema) 12// { 13// $id: 'my-schema', 14// exclusiveMinimum: 1 15// }
You can access Ajv instance that is used to migrate schema using migrate.getAjv
function:
1console.log(migrate.getAjv().errorsText(errors))
id
is replaced with $id
$schema
value becomes draft-07, draft-2019-09 or draft-2020-12 meta-schemaexclusiveMaximum/Minimum
is replaced with the current number formenum
with a single allowed value is replaced with const
constant
is replaced with const
true
{"not":{}}
is replaced with false
draft2019
function additionally replaces:
definitions
with $defs
dependencies
with dependentRequired
and dependentSchemas
"id": "#foo"
with "$anchor": "foo"
"id": "schema#foo"
with "$id": "schema", "$anchor": "foo"
draft2020
function additionally replaces array form of items
with prefixItems
(and additionalItems
with items
)No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
Found 0/23 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
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
detected GitHub workflow tokens with excessive permissions
Details
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-25
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