{"id":26993916,"url":"https://github.com/un-ts/json-schema-migrate-x","last_synced_at":"2026-05-02T19:33:08.436Z","repository":{"id":285769047,"uuid":"959189510","full_name":"un-ts/json-schema-migrate-x","owner":"un-ts","description":"Migrate JSON-Schema `draft-04` to `draft-07`, `draft-2019-09` or `draft-2020-12`","archived":false,"fork":false,"pushed_at":"2026-03-01T01:07:35.000Z","size":2056,"stargazers_count":1,"open_issues_count":5,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-04-24T02:32:48.579Z","etag":null,"topics":["ajv","json-schema","json-shcema-migrate","jsonschema"],"latest_commit_sha":null,"homepage":"https://npm.im/json-schema-migrate-x","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"ajv-validator/json-schema-migrate","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/un-ts.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":["JounQin","1stG","rx-ts","un-ts"],"patreon":"1stG","open_collective":"unts","custom":["https://opencollective.com/1stG","https://opencollective.com/rxts","https://afdian.com/a/JounQin"]}},"created_at":"2025-04-02T12:06:55.000Z","updated_at":"2025-04-03T13:09:33.000Z","dependencies_parsed_at":"2025-04-03T14:25:31.263Z","dependency_job_id":"9ef1ca06-8054-409f-a943-a3222cedb994","html_url":"https://github.com/un-ts/json-schema-migrate-x","commit_stats":null,"previous_names":["un-ts/json-schema-migrate","un-ts/json-schema-migrate-x"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/un-ts/json-schema-migrate-x","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/un-ts%2Fjson-schema-migrate-x","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/un-ts%2Fjson-schema-migrate-x/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/un-ts%2Fjson-schema-migrate-x/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/un-ts%2Fjson-schema-migrate-x/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/un-ts","download_url":"https://codeload.github.com/un-ts/json-schema-migrate-x/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/un-ts%2Fjson-schema-migrate-x/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32547647,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-02T19:18:06.202Z","status":"ssl_error","status_checked_at":"2026-05-02T19:16:21.335Z","response_time":132,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ajv","json-schema","json-shcema-migrate","jsonschema"],"created_at":"2025-04-04T00:19:30.326Z","updated_at":"2026-05-02T19:33:08.414Z","avatar_url":"https://github.com/un-ts.png","language":"TypeScript","funding_links":["https://github.com/sponsors/JounQin","https://github.com/sponsors/1stG","https://github.com/sponsors/rx-ts","https://github.com/sponsors/un-ts","https://patreon.com/1stG","https://opencollective.com/unts","https://opencollective.com/1stG","https://opencollective.com/rxts","https://afdian.com/a/JounQin"],"categories":[],"sub_categories":[],"readme":"# json-schema-migrate-x\n\n[![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/un-ts/json-schema-migrate-x/ci.yml?branch=master)](https://github.com/un-ts/json-schema-migrate-x/actions/workflows/ci.yml?query=branch%3Amaster)\n[![Codecov](https://img.shields.io/codecov/c/github/un-ts/json-schema-migrate-x.svg)](https://codecov.io/gh/un-ts/json-schema-migrate-x)\n[![type-coverage](https://img.shields.io/badge/dynamic/json.svg?label=type-coverage\u0026prefix=%E2%89%A5\u0026suffix=%\u0026query=$.typeCoverage.atLeast\u0026uri=https%3A%2F%2Fraw.githubusercontent.com%2Fun-ts%2Fjson-schema-migrate-x%2Fmaster%2Fpackage.json)](https://github.com/plantain-00/type-coverage)\n[![CodeRabbit Pull Request Reviews](https://img.shields.io/coderabbit/prs/github/un-ts/json-schema-migrate-x)](https://coderabbit.ai)\n[![npm](https://img.shields.io/npm/v/json-schema-migrate-x.svg)](https://www.npmjs.com/package/json-schema-migrate-x)\n[![GitHub Release](https://img.shields.io/github/release/un-ts/json-schema-migrate-x)](https://github.com/un-ts/json-schema-migrate-x/releases)\n\n[![Conventional Commits](https://img.shields.io/badge/conventional%20commits-1.0.0-yellow.svg)](https://conventionalcommits.org)\n[![Renovate enabled](https://img.shields.io/badge/renovate-enabled-brightgreen.svg)](https://renovatebot.com)\n[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)\n[![Code Style: Prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n\nThis is an actively maintained fork of [`json-schema-migrate`](https://github.com/ajv-validator/json-schema-migrate) which helps migrate JSON-Schema from `draft-04` to `draft-07`, `draft-2019-09` or `draft-2020-12`.\n\n## Install\n\n```sh\n# npm\nnpm install json-schema-migrate-x\n\n# yarn\nyarn add json-schema-migrate-x\n\n# pnpm\npnpm add json-schema-migrate-x\n\n# bun\nbun add json-schema-migrate-x\n```\n\n## Usage\n\n```js\nimport * as migrate from 'json-schema-migrate-x'\n\nconst schema = {\n  id: 'my-schema',\n  minimum: 1,\n  exclusiveMinimum: true,\n}\n\nmigrate.draft7(schema)\n// or migrate.draft2019(schema)\n// or migrate.draft2020(schema)\n\nconsole.log(schema)\n// {\n//  $id: 'my-schema',\n//  exclusiveMinimum: 1\n// }\n```\n\nYou can access Ajv instance that is used to migrate schema using `migrate.getAjv` function:\n\n```js\nconsole.log(migrate.getAjv().errorsText(errors))\n```\n\n## Changes in schemas after migration\n\n- `id` is replaced with `$id`\n- `$schema` value becomes `draft-07`, `draft-2019-09` or `draft-2020-12` meta-schema\n- `draft-04` boolean form of `exclusiveMaximum/Minimum` is replaced with the current number form\n- `enum` with a single allowed value is replaced with `const`\n- Non-standard `constant` is replaced with `const`\n- empty schema is replaced with `true`\n- schema `{\"not\":{}}` is replaced with `false`\n- `draft2019` function additionally replaces:\n  - `dependencies` with `dependentRequired` and `dependentSchemas`\n  - `\"id\": \"#foo\"` with `\"$anchor\": \"foo\"`\n  - `\"id\": \"schema#foo\"` with `\"$id\": \"schema\", \"$anchor\": \"foo\"`\n- `draft2020` function additionally replaces array form of `items` with `prefixItems` (and `additionalItems` with `items`)\n\n[![Sponsors](https://raw.githubusercontent.com/1stG/static/master/sponsors.svg)](https://github.com/sponsors/JounQin)\n\n## Sponsors\n\n| 1stG                                                                                                                   | RxTS                                                                                                                   | UnTS                                                                                                                   |\n| ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- |\n| [![1stG Open Collective sponsors](https://opencollective.com/1stG/organizations.svg)](https://opencollective.com/1stG) | [![RxTS Open Collective sponsors](https://opencollective.com/rxts/organizations.svg)](https://opencollective.com/rxts) | [![UnTS Open Collective sponsors](https://opencollective.com/unts/organizations.svg)](https://opencollective.com/unts) |\n\n## Backers\n\n| 1stG                                                                                                                | RxTS                                                                                                                | UnTS                                                                                                                |\n| ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- |\n| [![1stG Open Collective backers](https://opencollective.com/1stG/individuals.svg)](https://opencollective.com/1stG) | [![RxTS Open Collective backers](https://opencollective.com/rxts/individuals.svg)](https://opencollective.com/rxts) | [![UnTS Open Collective backers](https://opencollective.com/unts/individuals.svg)](https://opencollective.com/unts) |\n\n## Changelog\n\nDetailed changes for each release are documented in [CHANGELOG.md](./CHANGELOG.md).\n\n## License\n\n[MIT][] © [JounQin][]@[1stG.me][]\n\n[1stG.me]: https://www.1stG.me\n[JounQin]: https://github.com/JounQin\n[MIT]: http://opensource.org/licenses/MIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fun-ts%2Fjson-schema-migrate-x","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fun-ts%2Fjson-schema-migrate-x","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fun-ts%2Fjson-schema-migrate-x/lists"}