From 760fd100cd36df29c7fda41a23aad0ed537dfa58 Mon Sep 17 00:00:00 2001 From: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com> Date: Sun, 12 Sep 2021 19:09:24 +0100 Subject: [PATCH 01/22] 8.6.3 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 2057215d5..c0d6bca79 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ajv", - "version": "8.6.2", + "version": "8.6.3", "description": "Another JSON Schema Validator", "main": "dist/ajv.js", "types": "dist/ajv.d.ts", From 58525ef775417df4d9bb73e4f0e3c31bb4f1cda5 Mon Sep 17 00:00:00 2001 From: Doni Rubiagatra Date: Sat, 9 Oct 2021 21:19:09 +0700 Subject: [PATCH 02/22] bugfix: try to new version github actions v2 (#1775) --- .github/workflows/build.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6574825b2..73409f914 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -22,13 +22,13 @@ jobs: node-version: ${{ matrix.node-version }} - run: npm install - run: git submodule update --init - # - name: update website - # if: ${{ github.event_name == 'push' && matrix.node-version == '14.x' }} - # run: ./scripts/publish-site - # env: - # GH_TOKEN_PUBLIC: ${{ secrets.GH_TOKEN_PUBLIC }} - # GIT_USER_EMAIL: ${{ secrets.GIT_USER_EMAIL }} - # GIT_USER_NAME: ${{ secrets.GIT_USER_NAME }} + - name: update website + if: ${{ github.event_name == 'push' && matrix.node-version == '14.x' }} + run: ./scripts/publish-site + env: + GH_TOKEN_PUBLIC: ${{ secrets.GH_TOKEN_PUBLIC }} + GIT_USER_EMAIL: ${{ secrets.GIT_USER_EMAIL }} + GIT_USER_NAME: ${{ secrets.GIT_USER_NAME }} - run: npm run build - run: npm run test-ci - name: coveralls From a3a9d10aa6d7800c8e702c294d7ea50e1c641f43 Mon Sep 17 00:00:00 2001 From: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com> Date: Sat, 9 Oct 2021 15:58:35 +0100 Subject: [PATCH 03/22] Revert "bugfix: try to new version github actions v2 (#1775)" (#1786) This reverts commit 58525ef775417df4d9bb73e4f0e3c31bb4f1cda5. --- .github/workflows/build.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 73409f914..6574825b2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -22,13 +22,13 @@ jobs: node-version: ${{ matrix.node-version }} - run: npm install - run: git submodule update --init - - name: update website - if: ${{ github.event_name == 'push' && matrix.node-version == '14.x' }} - run: ./scripts/publish-site - env: - GH_TOKEN_PUBLIC: ${{ secrets.GH_TOKEN_PUBLIC }} - GIT_USER_EMAIL: ${{ secrets.GIT_USER_EMAIL }} - GIT_USER_NAME: ${{ secrets.GIT_USER_NAME }} + # - name: update website + # if: ${{ github.event_name == 'push' && matrix.node-version == '14.x' }} + # run: ./scripts/publish-site + # env: + # GH_TOKEN_PUBLIC: ${{ secrets.GH_TOKEN_PUBLIC }} + # GIT_USER_EMAIL: ${{ secrets.GIT_USER_EMAIL }} + # GIT_USER_NAME: ${{ secrets.GIT_USER_NAME }} - run: npm run build - run: npm run test-ci - name: coveralls From 82ae16ab3f9ec09c2d18a1141b3cbd3e32d0cb2e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 9 Oct 2021 15:59:02 +0100 Subject: [PATCH 04/22] build(deps-dev): bump @rollup/plugin-commonjs from 20.0.0 to 21.0.0 (#1778) Bumps [@rollup/plugin-commonjs](https://github.com/rollup/plugins/tree/HEAD/packages/commonjs) from 20.0.0 to 21.0.0. - [Release notes](https://github.com/rollup/plugins/releases) - [Changelog](https://github.com/rollup/plugins/blob/master/packages/commonjs/CHANGELOG.md) - [Commits](https://github.com/rollup/plugins/commits/commonjs-v21.0.0/packages/commonjs) --- updated-dependencies: - dependency-name: "@rollup/plugin-commonjs" dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index c0d6bca79..ac88e3c6b 100644 --- a/package.json +++ b/package.json @@ -64,7 +64,7 @@ }, "devDependencies": { "@ajv-validator/config": "^0.3.0", - "@rollup/plugin-commonjs": "^20.0.0", + "@rollup/plugin-commonjs": "^21.0.0", "@rollup/plugin-json": "^4.1.0", "@rollup/plugin-node-resolve": "^13.0.0", "@rollup/plugin-typescript": "^8.2.1", From 43d6164d46c1afbb1f40829f5208a66507af810c Mon Sep 17 00:00:00 2001 From: Olga Kozlova <2105894+eventlistener@users.noreply.github.com> Date: Sat, 9 Oct 2021 18:10:41 +0300 Subject: [PATCH 05/22] Use npm 6-style peer dependency resolution with `npm link` (#1776) * Use npm 6-style peer dependency resolution with `npm link` * Update build.yml Co-authored-by: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com> --- .github/workflows/build.yml | 2 +- package.json | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6574825b2..9d2bb4de9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -12,7 +12,7 @@ jobs: strategy: matrix: - node-version: [10.x, 12.x, 14.x] + node-version: [12.x, 14.x, 16.x] steps: - uses: actions/checkout@v2 diff --git a/package.json b/package.json index ac88e3c6b..b4f21fda0 100644 --- a/package.json +++ b/package.json @@ -23,10 +23,10 @@ "test-karma": "karma start", "test-browser": "rm -rf .browser && npm run bundle && scripts/prepare-tests && karma start", "test-all": "npm run test-cov && if-node-version 12 npm run test-browser", - "test": "npm run json-tests && npm run prettier:check && npm run eslint && npm link && npm link ajv && npm run test-cov", + "test": "npm run json-tests && npm run prettier:check && npm run eslint && npm link && npm link --legacy-peer-deps ajv && npm run test-cov", "test-ci": "AJV_FULL_TEST=true npm test", "prepublish": "npm run build", - "benchmark": "npm i && npm run build && npm link && cd ./benchmark && npm link ajv && npm i && node ./jtd", + "benchmark": "npm i && npm run build && npm link && cd ./benchmark && npm link --legacy-peer-deps ajv && npm i && node ./jtd", "docs:dev": "./scripts/prepare-site && vuepress dev docs", "docs:build": "./scripts/prepare-site && vuepress build docs" }, From 51f0b84c11150a9a2e632a5c7b5695c1949bad30 Mon Sep 17 00:00:00 2001 From: Erik Brinkman Date: Sun, 24 Oct 2021 15:01:29 -0400 Subject: [PATCH 06/22] Update typescript.md (#1788) * Update typescript.md Add documentation around timestamp unions for `JTDDataType`. fixes #1780 * remove line-break Co-authored-by: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com> --- docs/guide/typescript.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/guide/typescript.md b/docs/guide/typescript.md index 70ce5e80f..47b75e2c7 100644 --- a/docs/guide/typescript.md +++ b/docs/guide/typescript.md @@ -141,6 +141,11 @@ if (validate(data)) { ``` + + +::: warning TypeScript limitation +Note that it's currently not possible for `JTDDataType` to know whether the compiler is inferring timestamps as strings or Dates, and so it conservatively types any timestamp as `string | Date`. This is accurate, but often requires extra validation on the part of the user to confirm they're getting the appropriate data type. +::: ## Type-safe error handling From 6453ef8caee5fcf23d4eecb860433046b24ac860 Mon Sep 17 00:00:00 2001 From: Noam Neeman Date: Sun, 24 Oct 2021 22:02:20 +0300 Subject: [PATCH 07/22] fix type in doc (#1797) Co-authored-by: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com> --- docs/guide/typescript.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/guide/typescript.md b/docs/guide/typescript.md index 47b75e2c7..effe7740a 100644 --- a/docs/guide/typescript.md +++ b/docs/guide/typescript.md @@ -132,9 +132,9 @@ const validData = { bar: "abc" } -if (validate(data)) { +if (validate(validData)) { // data is MyData here - console.log(data.foo) + console.log(validData.foo) } else { console.log(validate.errors) } From e6e2fdb7381adfaefd2f8833a2ac42c52eca6cb9 Mon Sep 17 00:00:00 2001 From: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com> Date: Sun, 24 Oct 2021 20:31:35 +0100 Subject: [PATCH 08/22] retool logo (#1799) --- README.md | 18 ++++-------------- docs/.vuepress/public/img/retool.svg | 1 + 2 files changed, 5 insertions(+), 14 deletions(-) create mode 100644 docs/.vuepress/public/img/retool.svg diff --git a/README.md b/README.md index 25cc428c2..24ab77868 100644 --- a/README.md +++ b/README.md @@ -19,23 +19,13 @@ Supports JSON Schema draft-04/06/07/2019-09/2020-12 ([draft-04 support](https:// [](https://www.mozilla.org)[](https://opencollective.com/ajv) -## Ajv online event - May 20, 10am PT / 6pm UK +## Gold and Silver sponsors -We will talk about: -- new features of Ajv version 8. -- the improvements sponsored by Mozilla's MOSS grant. -- how Ajv is used in JavaScript applications. +Your logo with the link to your website will be here if you sponsor Ajv development via [GitHub sponsors page](https://github.com/sponsors/epoberezkin) or via [OpenCollective](https://opencollective.com/ajv). -Speakers: -- [Evgeny Poberezkin](https://github.com/epoberezkin), the creator of Ajv. -- [Mehan Jayasuriya](https://github.com/mehan), Program Officer at Mozilla Foundation, leading the [MOSS](https://www.mozilla.org/en-US/moss/) and other programs investing in the open source and community ecosystems. -- [Matteo Collina](https://github.com/mcollina), Technical Director at NearForm and Node.js Technical Steering Committee member, creator of Fastify web framework. -- [Kin Lane](https://github.com/kinlane), Chief Evangelist at Postman. Studying the tech, business & politics of APIs since 2010. Presidential Innovation Fellow during the Obama administration. -- [Ulysse Carion](https://github.com/ucarion), the creator of JSON Type Definition specification. +## Bronze sponsors -[Gajus Kuizinas](https://github.com/gajus) will host the event. - -Please [register here](https://us02web.zoom.us/webinar/register/2716192553618/WN_erJ_t4ICTHOnGC1SOybNnw). +[](https://retool.com/?utm_source=sponsor&utm_campaign=ajv)[](https://opencollective.com/ajv)[](https://opencollective.com/ajv)[](https://opencollective.com/ajv) ## Contributing diff --git a/docs/.vuepress/public/img/retool.svg b/docs/.vuepress/public/img/retool.svg new file mode 100644 index 000000000..bdc039236 --- /dev/null +++ b/docs/.vuepress/public/img/retool.svg @@ -0,0 +1 @@ + \ No newline at end of file From 4aec4c521a4d65d413a58d4072522616986ff54b Mon Sep 17 00:00:00 2001 From: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com> Date: Sun, 24 Oct 2021 20:33:02 +0100 Subject: [PATCH 09/22] update image path --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 24ab77868..9daea74bf 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ Your logo with the link to your website will be here if you sponsor Ajv developm ## Bronze sponsors -[](https://retool.com/?utm_source=sponsor&utm_campaign=ajv)[](https://opencollective.com/ajv)[](https://opencollective.com/ajv)[](https://opencollective.com/ajv) +[](https://retool.com/?utm_source=sponsor&utm_campaign=ajv)[](https://opencollective.com/ajv)[](https://opencollective.com/ajv)[](https://opencollective.com/ajv) ## Contributing From ec44ba7a26188b6abdf6f551a091b12b10d14dfd Mon Sep 17 00:00:00 2001 From: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com> Date: Sun, 24 Oct 2021 20:47:57 +0100 Subject: [PATCH 10/22] update image --- README.md | 2 +- docs/.vuepress/public/img/retool.jpg | Bin 0 -> 10838 bytes 2 files changed, 1 insertion(+), 1 deletion(-) create mode 100644 docs/.vuepress/public/img/retool.jpg diff --git a/README.md b/README.md index 9daea74bf..f63307529 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ Your logo with the link to your website will be here if you sponsor Ajv developm ## Bronze sponsors -[](https://retool.com/?utm_source=sponsor&utm_campaign=ajv)[](https://opencollective.com/ajv)[](https://opencollective.com/ajv)[](https://opencollective.com/ajv) +[](https://retool.com/?utm_source=sponsor&utm_campaign=ajv)[](https://opencollective.com/ajv) ## Contributing diff --git a/docs/.vuepress/public/img/retool.jpg b/docs/.vuepress/public/img/retool.jpg new file mode 100644 index 0000000000000000000000000000000000000000..a84829a1638248c17687eba24579d33a2f2708b5 GIT binary patch literal 10838 zcmeHt2UJsOx99;B6)Vz2nu3BNsC1?3&_+#&7(!Hv3KAelD1k(}Wf&;}mQg~GM1v-f z2#6RUM8HB*+Jq2#KzdC8fzaWFnbDd5&Hu0a{`Kx%>#q0i&dNDE-?zWL_xZ|hC#x;1 zUw|E_ZBE$$A|e1FBK!cWJ)#FrSz2B?dk$iA3S|9Thv+Uq2%^&@9rPChIa^YQ{QXBYqHj0P2(*d zC>T_DKQH_$0%+hIU<>>p#Q#&_&-wHt0l={t01&(PXPa9J02D+6z^=AG+x9&LfbBm4 zKz_admB1^%DYH&^6-6Kb;41|Hwq5`Lsb2v=!s(l$e~$fgE&j!`?h%er6h5b)@Z$+w z13Z8|z$pL)xC4iUm@aS>&;blr+W|{JOmq#_u3|!1C%$eCHj0a{7vHo|LSoa#O`9aP zY~LcWdE4eqo3=`B-L`$l4#^!7TXstA+#w~zcdRiHSsN*~ZliGEj?J4k3tRt9SbYab zZWOsBHY6sZ3W!RIh)Ig9mI)s~1P~KhgKskctQX&~PE15}ldu=EL%7|A_&Ui=>o*9+ z3u#0|#n!DCm)yBm=i~+{RRjBTuqy$9==%?IU%zKb%gD;<8s2>HOz#J%gPWSZ$F1id zdMtyw_qmfMtQsbT45j}f=MRBvt&)FA|JK?DY!MR?>M14(SO6=q@7nzj^8fA(43{;` zD9+(uP2{+eHG()`DIJw0HQG>JaR;;0Yu)9C3wk-&!?XD9>Bh5x;~`HaZ$bX(Grv2^ ztu7w8VYA8NkG?-hMRx5wd`-YWreqf%Q40#>r$=R~=;)Y`jX?i3v$$EdYK&KWk#`~G zmzv%SX)K5z-2J`8D7f`dP{T04yJ5Rcl~{>Yk%LqaOQggIxtDHT zY~Nu{2RU9~R0eh6cSB1f=caCb{(bEBEj44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g77h`+5NF@9kn=MjP?zdL&L@n`}E3UfZ!{hOBm`l5=^2)7%)vEdD3zzTJj$x=QC zc{~th6xML2Y(qgc+9I`hc;7tAa|&C$@9l}O@B+PgX6J*ylRT;Ul)!!z>i+pmneg9b U*qR&vTH^oo{Qo`!+gDrv7dm_Vs{jB1 literal 0 HcmV?d00001 From 29caf139730db95a503415f724e8e603f52984f5 Mon Sep 17 00:00:00 2001 From: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com> Date: Tue, 2 Nov 2021 15:23:12 +0000 Subject: [PATCH 11/22] update image (#1806) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f63307529..105e68baf 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ Your logo with the link to your website will be here if you sponsor Ajv developm ## Bronze sponsors -[](https://retool.com/?utm_source=sponsor&utm_campaign=ajv)[](https://opencollective.com/ajv) +[](https://retool.com/?utm_source=sponsor&utm_campaign=ajv)[](https://opencollective.com/ajv) ## Contributing From fefd2e382e4517ae800d83a11cf13af99863891d Mon Sep 17 00:00:00 2001 From: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com> Date: Wed, 3 Nov 2021 21:16:42 +0000 Subject: [PATCH 12/22] fix website build (#1807) * enable website build * use import with node-fetch * log npm version * fix fetch import * debugging contributors * disable esling for scripts, only import vuepress in CI * update build.yml --- .github/workflows/build.yml | 14 +++++++------- package.json | 6 ++---- scripts/get-contributors.js | 7 ++++--- scripts/publish-site | 2 ++ 4 files changed, 15 insertions(+), 14 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9d2bb4de9..c94faaac3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -22,13 +22,13 @@ jobs: node-version: ${{ matrix.node-version }} - run: npm install - run: git submodule update --init - # - name: update website - # if: ${{ github.event_name == 'push' && matrix.node-version == '14.x' }} - # run: ./scripts/publish-site - # env: - # GH_TOKEN_PUBLIC: ${{ secrets.GH_TOKEN_PUBLIC }} - # GIT_USER_EMAIL: ${{ secrets.GIT_USER_EMAIL }} - # GIT_USER_NAME: ${{ secrets.GIT_USER_NAME }} + - name: update website + if: ${{ github.event_name == 'push' && matrix.node-version == '14.x' }} + run: ./scripts/publish-site + env: + GH_TOKEN_PUBLIC: ${{ secrets.GH_TOKEN_PUBLIC }} + GIT_USER_EMAIL: ${{ secrets.GIT_USER_EMAIL }} + GIT_USER_NAME: ${{ secrets.GIT_USER_NAME }} - run: npm run build - run: npm run test-ci - name: coveralls diff --git a/package.json b/package.json index b4f21fda0..45932e42a 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ ".runkit_example.js" ], "scripts": { - "eslint": "eslint \"lib/**/*.ts\" \"spec/**/*.*s\" scripts --ignore-pattern spec/JSON-Schema-Test-Suite", + "eslint": "eslint \"lib/**/*.ts\" \"spec/**/*.*s\" --ignore-pattern spec/JSON-Schema-Test-Suite", "prettier:write": "prettier --write \"./**/*.{json,yaml,js,ts}\"", "prettier:check": "prettier --list-different \"./**/*.{json,yaml,js,ts}\"", "test-spec": "cross-env TS_NODE_PROJECT=spec/tsconfig.json mocha -r ts-node/register \"spec/**/*.spec.{ts,js}\" -R dot -g \\(.recursiveRef.with.no..recursiveAnchor\\|.dynamicRef.with.no..dynamicAnchor\\).in.the.initial.target.schema.resource -i", @@ -74,7 +74,6 @@ "@types/require-from-string": "^1.2.0", "@typescript-eslint/eslint-plugin": "^3.8.0", "@typescript-eslint/parser": "^3.8.0", - "@vuepress/shared-utils": "^1.8.2", "ajv-formats": "^2.0.0", "chai": "^4.0.1", "cross-env": "^7.0.2", @@ -100,8 +99,7 @@ "rollup-plugin-terser": "^7.0.2", "ts-node": "^10.0.0", "tsify": "^5.0.2", - "typescript": "^4.2.0", - "vuepress": "^1.8.2" + "typescript": "^4.2.0" }, "collective": { "type": "opencollective", diff --git a/scripts/get-contributors.js b/scripts/get-contributors.js index be6ab58e2..49436814e 100644 --- a/scripts/get-contributors.js +++ b/scripts/get-contributors.js @@ -2,7 +2,6 @@ // https://github.com/sveltejs/svelte/blob/ce3a5791258ec6ecf8c1ea022cb871afe805a45c/site/scripts/get-contributors.js const fs = require("fs") -const fetch = require("node-fetch") const Jimp = require("jimp") process.chdir(__dirname) @@ -12,7 +11,11 @@ const {GH_TOKEN_PUBLIC} = process.env const SIZE = 64 +main() + async function main() { + const fetch = (await import("node-fetch")).default + const contributors = [] let page = 1 @@ -53,5 +56,3 @@ async function main() { `module.exports = ${str}` ) } - -main() diff --git a/scripts/publish-site b/scripts/publish-site index 0e004cf5d..294814d57 100755 --- a/scripts/publish-site +++ b/scripts/publish-site @@ -5,6 +5,8 @@ set -ex echo "About to publish $GITHUB_REF to gh-pages..." rm -rf ../gh-pages +npm install vuepress@1 +npm install @vuepress/shared-utils@1 npm run docs:build git config --global user.name "$GIT_USER_NAME" From 749998ae34798ec9bf5e39fbcab34388407b973a Mon Sep 17 00:00:00 2001 From: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com> Date: Wed, 3 Nov 2021 22:06:42 +0000 Subject: [PATCH 13/22] update sponsors (website) --- docs/.vuepress/components/Sponsors.vue | 62 +++++++++++++++++++----- docs/.vuepress/public/img/microsoft.png | Bin 0 -> 4054 bytes docs/README.md | 24 +++++++-- docs/projects/tsed.png | Bin 4936 -> 6257 bytes 4 files changed, 71 insertions(+), 15 deletions(-) create mode 100644 docs/.vuepress/public/img/microsoft.png diff --git a/docs/.vuepress/components/Sponsors.vue b/docs/.vuepress/components/Sponsors.vue index d4af3bdbe..23b4a914c 100644 --- a/docs/.vuepress/components/Sponsors.vue +++ b/docs/.vuepress/components/Sponsors.vue @@ -1,29 +1,67 @@ + + diff --git a/docs/.vuepress/public/img/microsoft.png b/docs/.vuepress/public/img/microsoft.png new file mode 100644 index 0000000000000000000000000000000000000000..afbbb4f8b77c0826e00104e7a685a732184bb5f5 GIT binary patch literal 4054 zcmaJ^c|4SB`=>M}%ScjogR)GR!3<^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j~b=K0GsvO08 z<|9b`Jp;PQ-UC}2=jpe@LPVq;iBVS@Y%0V!a%W~rl&EF1D%;MkblJWT8871W15fdF z>+U^K41Em-rl@?GL;~(Rvgh27K09JT~o~+OZLTD9)Oh<|2lh!k|7aCEcPZ2!mn54vQ*$bQgA^g#tn5;dkCEe0J19dkYi=)N>oi-JCiRLd zUH4s$J0S~-$*j{6ocGnQLl3>JnXSS%`VGG=N*wi|ApR%db^EH!kKCQ;w7s^QulQ{Y$1dn zZKY+7<~F~)9h>%8q#9<#TEn-f`o?speV%(VtoDk1WGL39iJ@vC)&#D57cnjKsG#LG zE|rYe;@CpTi>GsuXUFp~4-T*N>zCWB2R&clJ>;$`tQ|Yev|n%MiJU5y5KAd;3NfFo z09k#^snWi?b-A$pH2CGD-j~}*w~&A>aj!-3{(+dihof_+5B04!93ly31H=&#U%lkp zXZnBd>`x`L5QS7-w^k!i3`Y5rPU-q9)r}N1UAVi$mE1t#BV#q?lD- zPH6lL{qR-!eW47#9aX!*7#-@_-LtMhY|rSrH96RYG6zUX*DxrmDk(^Fb3nvj-{n2p dU)4ncB7m~)UuNDl%WnQ@6L8Mhay$Rz{{UD#B=P_N literal 0 HcmV?d00001 diff --git a/docs/README.md b/docs/README.md index 78a71713a..410d3cb95 100644 --- a/docs/README.md +++ b/docs/README.md @@ -34,14 +34,32 @@ Use JSON Type Definition or JSON Schema - + -Platinum sponsors +## Ajv sponsors [![mozilla](/img/mozilla.svg)](https://www.mozilla.org) -[![reserved](/img/reserved.svg)](https://opencollective.com/ajv) +[![reserved](/img/reserved.svg)](https://github.com/sponsors/epoberezkin) + + + + + +[![mozilla](/img/microsoft.png)](https://opensource.microsoft.com) +[![reserved](/img/reserved.svg)](https://github.com/sponsors/epoberezkin) +[![reserved](/img/reserved.svg)](https://github.com/sponsors/epoberezkin) + + + +[![retool](/img/retool.svg)](https://retool.com/?utm_source=sponsor&utm_campaign=ajv) +[![reserved](/img/reserved.svg)](https://github.com/sponsors/epoberezkin) +[![reserved](/img/reserved.svg)](https://github.com/sponsors/epoberezkin) +[![reserved](/img/reserved.svg)](https://github.com/sponsors/epoberezkin) + + + diff --git a/docs/projects/tsed.png b/docs/projects/tsed.png index 146c037e56e43d5f35b9b66b3573ea5fb7e0acc4..1f049a5fa028338afbb6deda29bd3b40b35eaf38 100644 GIT binary patch literal 6257 zcmbt&XIN8P({>sddJvG%Lz5z*_Zo`yE*(LNAjME4AWdorAWf=L3?NOKbQKVg2#O+I zdPfDRB29|C;hgiF=lg!VzuvvCz1OVS_sp!dW?g$`R=lyH78N-&IRF5l($Us11pt7g zMA`v*@jl<486Y;0JE{h%06<*|#i=6+v5#=pHZ=eMg0BJq5itP3F_9Iq3IN;_1pt0H z008ni005&;-fI&@;)fU)D;-w@1Arirh5|@{mjPfR1ti`8AT!`X8<7I&0$Kj0O@aLX zU_bysoI3#W55|VrUR=!Qq01Uf28meYN zz)d?cANuc^;j3?Wd0+@kwDAj}#1nE~Rz!0rO14cpPKJ8jhFrmS3~Lu>SGzg-#e%m- z;10T$v(*zZmkQ&vXU%ptbaWOa&A@%kg2AIv5rbj#*@t0lDH7TvHdaDEaO)}_W36@frNWjPnV@7acvgNQvm0zp8?L=m}r>L^?x2hSq}6be$K z^rL}-qEIT382GU&7ukgv0daUC{C|Rhj!RZ~96p$<+tTdMEqc~Qflv7rt%6Lx`+2f^ zd3lu<6tMRzg71kcD&~Pe`tx(TfvvA!mp3(y`Hi2Qp1%M2^YD-_bmzgu3&*VW0}M%N zn&;+^625>8W4m7qZJZB52h~;D$3shyH`jhva*qfOcMMG3bvd{3kwb{CtjAS zBLoM_Zt$%Xo&hSW1IM(SXBP(los8~xtT>O!^xVYQea7jjbdhu!C%AvHW zvOeV;)@F(hGD;hfH8MDeA|WBc9Bf!KD+CDj7bxXk5wX`NBZKb-A6~yoz=v0_;1Hq+ zC?+s)q{(x9^>}|h%SzX?L;^ zDj|^U>jlbiDk*D}3eJ)YILKLzkJ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users.noreply.github.com> Date: Wed, 3 Nov 2021 22:17:39 +0000 Subject: [PATCH 14/22] add tidelift (website) --- docs/.vuepress/public/img/tidelift.svg | 33 ++++++++++++++++++++++++++ docs/README.md | 4 ++-- 2 files changed, 35 insertions(+), 2 deletions(-) create mode 100644 docs/.vuepress/public/img/tidelift.svg diff --git a/docs/.vuepress/public/img/tidelift.svg b/docs/.vuepress/public/img/tidelift.svg new file mode 100644 index 000000000..af12d6841 --- /dev/null +++ b/docs/.vuepress/public/img/tidelift.svg @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + diff --git a/docs/README.md b/docs/README.md index 410d3cb95..0202a0911 100644 --- a/docs/README.md +++ b/docs/README.md @@ -45,7 +45,7 @@ Use JSON Type Definition or JSON Schema -[![mozilla](/img/microsoft.png)](https://opensource.microsoft.com) +[![microsoft](/img/microsoft.png)](https://opensource.microsoft.com) [![reserved](/img/reserved.svg)](https://github.com/sponsors/epoberezkin) [![reserved](/img/reserved.svg)](https://github.com/sponsors/epoberezkin) @@ -54,7 +54,7 @@ Use JSON Type Definition or JSON Schema [![retool](/img/retool.svg)](https://retool.com/?utm_source=sponsor&utm_campaign=ajv) -[![reserved](/img/reserved.svg)](https://github.com/sponsors/epoberezkin) +[![tidelift](/img/tidelift.svg)](https://tidelift.com/subscription/pkg/npm-ajv?utm_source=npm-ajv&utm_medium=referral&utm_campaign=enterprise) [![reserved](/img/reserved.svg)](https://github.com/sponsors/epoberezkin) [![reserved](/img/reserved.svg)](https://github.com/sponsors/epoberezkin) From 7d9af0ab1adff62dd766a4b4c6d9a779cc5ed3a9 Mon Sep 17 00:00:00 2001 From: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com> Date: Thu, 4 Nov 2021 08:53:06 +0000 Subject: [PATCH 15/22] update logo --- docs/.vuepress/components/Sponsors.vue | 5 +++-- docs/.vuepress/public/img/tidelift.svg | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/docs/.vuepress/components/Sponsors.vue b/docs/.vuepress/components/Sponsors.vue index 23b4a914c..df86d69fa 100644 --- a/docs/.vuepress/components/Sponsors.vue +++ b/docs/.vuepress/components/Sponsors.vue @@ -33,10 +33,9 @@ export default { img width 100% a - display block margin-bottom 10px + display inline-block @media only screen and (min-width: $MQMobileNarrow) - display inline-block margin-bottom 0 a:last-child margin-right 0 @@ -44,7 +43,9 @@ export default { &.platinum a width 100% + display block @media only screen and (min-width: $MQMobileNarrow) + display inline-block width 45% margin-right 8% diff --git a/docs/.vuepress/public/img/tidelift.svg b/docs/.vuepress/public/img/tidelift.svg index af12d6841..246dda55d 100644 --- a/docs/.vuepress/public/img/tidelift.svg +++ b/docs/.vuepress/public/img/tidelift.svg @@ -1,7 +1,7 @@ + viewBox="0 0 190.1 36" style="enable-background:new 0 0 190.1 36;" xml:space="preserve"> ](https://www.mozilla.org)[](https://opencollective.com/ajv) +[Mozilla](https://www.mozilla.org)[](https://opencollective.com/ajv) -## Gold and Silver sponsors +[Microsoft](https://opensource.microsoft.com)[](https://opencollective.com/ajv)[](https://opencollective.com/ajv) -Your logo with the link to your website will be here if you sponsor Ajv development via [GitHub sponsors page](https://github.com/sponsors/epoberezkin) or via [OpenCollective](https://opencollective.com/ajv). - -## Bronze sponsors - -[](https://retool.com/?utm_source=sponsor&utm_campaign=ajv)[](https://opencollective.com/ajv) +[Retool](https://retool.com/?utm_source=sponsor&utm_campaign=ajv)[Tidelift](https://tidelift.com/subscription/pkg/npm-ajv?utm_source=npm-ajv&utm_medium=referral&utm_campaign=enterprise)[](https://opencollective.com/ajv)[](https://opencollective.com/ajv) ## Contributing From 42945d68d5ccc259283913ba1341d38c09499cf0 Mon Sep 17 00:00:00 2001 From: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com> Date: Thu, 4 Nov 2021 20:30:29 +0000 Subject: [PATCH 17/22] update opencollective --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 6f4a4390b..96b332667 100644 --- a/README.md +++ b/README.md @@ -70,6 +70,8 @@ Thank you. + + ## Performance From 1b4583524edfc12f9a8bf8102df13553ae12ad40 Mon Sep 17 00:00:00 2001 From: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com> Date: Mon, 8 Nov 2021 19:42:59 +0000 Subject: [PATCH 18/22] update JSON Schema Test Suite, fix minContains = 0, skip failing tests (#1810) * update JSON Schema Test Suite, skip failing tests * fix minContains = 0 test * un-skip refRemote tests --- lib/vocabularies/applicator/contains.ts | 10 +- package.json | 4 +- spec/JSON-Schema-Test-Suite | 2 +- spec/json-schema.spec.ts | 237 +++++++++++++++++++++--- 4 files changed, 219 insertions(+), 34 deletions(-) diff --git a/lib/vocabularies/applicator/contains.ts b/lib/vocabularies/applicator/contains.ts index c91e8f5de..0c398d1d6 100644 --- a/lib/vocabularies/applicator/contains.ts +++ b/lib/vocabularies/applicator/contains.ts @@ -65,11 +65,19 @@ const def: CodeKeywordDefinition = { validateItems(valid, () => gen.if(valid, () => gen.break())) } else { gen.let(valid, false) + if (min === 0) { + gen.if(_`${data}.length > 0`, validateItemsWithCount, () => gen.assign(valid, true)) + } else { + validateItemsWithCount() + } + } + cxt.result(valid, () => cxt.reset()) + + function validateItemsWithCount(): void { const schValid = gen.name("_valid") const count = gen.let("count", 0) validateItems(schValid, () => gen.if(schValid, () => checkLimits(count))) } - cxt.result(valid, () => cxt.reset()) function validateItems(_valid: Name, block: () => void): void { gen.forRange("i", 0, len, (i) => { diff --git a/package.json b/package.json index 45932e42a..edfbdae41 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "eslint": "eslint \"lib/**/*.ts\" \"spec/**/*.*s\" --ignore-pattern spec/JSON-Schema-Test-Suite", "prettier:write": "prettier --write \"./**/*.{json,yaml,js,ts}\"", "prettier:check": "prettier --list-different \"./**/*.{json,yaml,js,ts}\"", - "test-spec": "cross-env TS_NODE_PROJECT=spec/tsconfig.json mocha -r ts-node/register \"spec/**/*.spec.{ts,js}\" -R dot -g \\(.recursiveRef.with.no..recursiveAnchor\\|.dynamicRef.with.no..dynamicAnchor\\).in.the.initial.target.schema.resource -i", + "test-spec": "cross-env TS_NODE_PROJECT=spec/tsconfig.json mocha -r ts-node/register \"spec/**/*.spec.{ts,js}\" -R dot", "test-codegen": "nyc cross-env TS_NODE_PROJECT=spec/tsconfig.json mocha -r ts-node/register 'spec/codegen.spec.ts' -R spec", "test-debug": "npm run test-spec -- --inspect-brk", "test-cov": "nyc npm run test-spec", @@ -74,7 +74,7 @@ "@types/require-from-string": "^1.2.0", "@typescript-eslint/eslint-plugin": "^3.8.0", "@typescript-eslint/parser": "^3.8.0", - "ajv-formats": "^2.0.0", + "ajv-formats": "^3.0.0-rc.0", "chai": "^4.0.1", "cross-env": "^7.0.2", "dayjs": "^1.10.4", diff --git a/spec/JSON-Schema-Test-Suite b/spec/JSON-Schema-Test-Suite index 3c45b816a..e82bfdfa5 160000 --- a/spec/JSON-Schema-Test-Suite +++ b/spec/JSON-Schema-Test-Suite @@ -1 +1 @@ -Subproject commit 3c45b816ad52139f88cc15fb03723dc92a64fa90 +Subproject commit e82bfdfa59c63cc74175d35fac81bb95e61db24b diff --git a/spec/json-schema.spec.ts b/spec/json-schema.spec.ts index c750a7548..e3e8e767d 100644 --- a/spec/json-schema.spec.ts +++ b/spec/json-schema.spec.ts @@ -1,3 +1,4 @@ +import type Ajv from "../dist/core" import _Ajv from "./ajv" import _Ajv2019 from "./ajv2019" import _Ajv2020 from "./ajv2020" @@ -24,54 +25,195 @@ const remoteRefs = { const SKIP_FORMATS = ["idn-email", "idn-hostname", "iri", "iri-reference"] const SKIP_FORMAT_TESTS = SKIP_FORMATS.map((f) => `optional/format/${f}`) -const SKIP_DRAFT7 = ["optional/content", "optional/float-overflow", ...SKIP_FORMAT_TESTS] +const SKIP_DRAFT7 = [ + "optional/content", + "optional/float-overflow", + "unknownKeyword", + ...SKIP_FORMAT_TESTS, +] -const SKIP = { - 6: ["optional/float-overflow"], - 7: SKIP_DRAFT7, - 2019: SKIP_DRAFT7, // TODO: 2 of 32 tests in recursiveRef fail - 2020: SKIP_DRAFT7, // TODO: 2 of 32 tests in dynamicRef fail -} - -runTest( - getAjvInstances(_Ajv, options, { +runTest({ + instances: getAjvInstances(_Ajv, options, { meta: false, strict: false, ignoreKeywordsWithRef: true, }), - 6, - require("./_json/draft6") -) + draft: 6, + tests: skipTestCases(require("./_json/draft6"), { + ref: { + "$ref prevents a sibling $id from changing the base uri": [ + "$ref resolves to /definitions/base_foo, data does not validate", + "$ref resolves to /definitions/base_foo, data validates", + ], + }, + }), + remotes: { + "http://localhost:1234/ref-and-definitions.json": require("./JSON-Schema-Test-Suite/remotes/ref-and-definitions.json"), + }, + skip: ["optional/float-overflow", "unknownKeyword"], +}) -runTest( - getAjvInstances(_Ajv, options, { +runTest({ + instances: getAjvInstances(_Ajv, options, { strict: false, ignoreKeywordsWithRef: true, formats: toHash(SKIP_FORMATS), }), - 7, - require("./_json/draft7") -) + draft: 7, + tests: skipTestCases(require("./_json/draft7"), { + ref: { + "$ref prevents a sibling $id from changing the base uri": [ + "$ref resolves to /definitions/base_foo, data does not validate", + "$ref resolves to /definitions/base_foo, data validates", + ], + }, + }), + remotes: { + "http://localhost:1234/ref-and-definitions.json": require("./JSON-Schema-Test-Suite/remotes/ref-and-definitions.json"), + }, + skip: SKIP_DRAFT7, +}) -runTest( - getAjvInstances(_Ajv2019, options, { +runTest({ + instances: getAjvInstances(_Ajv2019, options, { strict: false, formats: toHash(SKIP_FORMATS), }), - 2019, - require("./_json/draft2019") -) + draft: 2019, + tests: skipTestCases(require("./_json/draft2019"), { + recursiveRef: { + "$recursiveRef with no $recursiveAnchor in the initial target schema resource": [ + "leaf node matches: recursion uses the inner schema", + "leaf node does not match: recursion uses the inner schema", + ], + }, + ref: { + "refs with relative uris and defs": [ + "invalid on inner field", + "invalid on outer field", + "valid on both fields", + ], + "relative refs with absolute uris and defs": [ + "invalid on inner field", + "invalid on outer field", + "valid on both fields", + ], + }, + unevaluatedProperties: { + "unevaluatedProperties with if/then/else, then not defined": [ + "when if is false and has unevaluated properties", + ], + }, + }), + remotes: { + "http://localhost:1234/ref-and-defs.json": require("./JSON-Schema-Test-Suite/remotes/ref-and-defs.json"), + "http://localhost:1234/draft2019-09/metaschema-no-validation.json": require("./JSON-Schema-Test-Suite/remotes/draft2019-09/metaschema-no-validation.json"), + }, + skip: SKIP_DRAFT7, +}) -runTest( - getAjvInstances(_Ajv2020, options, { +runTest({ + instances: getAjvInstances(_Ajv2020, options, { strict: false, formats: toHash(SKIP_FORMATS), }), - 2020, - require("./_json/draft2020") -) + draft: 2020, + tests: skipTestCases(require("./_json/draft2020"), { + dynamicRef: { + "A $dynamicRef to a $dynamicAnchor in the same schema resource should behave like a normal $ref to an $anchor": + ["An array of strings is valid"], + "A $dynamicRef to an $anchor in the same schema resource should behave like a normal $ref to an $anchor": + ["An array of strings is valid"], + "A $dynamicRef should resolve to the first $dynamicAnchor still in scope that is encountered when the schema is evaluated": + ["An array of strings is valid"], + "A $dynamicRef with intermediate scopes that don't include a matching $dynamicAnchor should not affect dynamic scope resolution": + ["An array of strings is valid"], + "An $anchor with the same name as a $dynamicAnchor should not be used for dynamic scope resolution": + ["Any array is valid"], + "A $dynamicRef without a matching $dynamicAnchor in the same schema resource should behave like a normal $ref to $anchor": + ["Any array is valid"], + "A $dynamicRef with a non-matching $dynamicAnchor in the same schema resource should behave like a normal $ref to $anchor": + ["Any array is valid"], + "A $dynamicRef that initially resolves to a schema with a matching $dynamicAnchor should resolve to the first $dynamicAnchor in the dynamic scope": + [ + "The recursive part is valid against the root", + "The recursive part is not valid against the root", + ], + "A $dynamicRef that initially resolves to a schema without a matching $dynamicAnchor should behave like a normal $ref to $anchor": + ["The recursive part doesn't need to validate against the root"], + "after leaving a dynamic scope, it should not be used by a $dynamicRef": [ + "string matches /$defs/thingy, but the $dynamicRef does not stop here", + "first_scope is not in dynamic scope for the $dynamicRef", + "/then/$defs/thingy is the final stop for the $dynamicRef", + ], + "strict-tree schema, guards against misspelled properties": [ + "instance with misspelled field", + "instance with correct field", + ], + "tests for implementation dynamic anchor and reference link": [ + "incorrect parent schema", + "incorrect extended schema", + "correct extended schema", + ], + // duplicate + "Tests for implementation dynamic anchor and reference link. Reference should be independent of any possible ordering.": + ["incorrect parent schema", "incorrect extended schema", "correct extended schema"], + }, + ref: { + "refs with relative uris and defs": [ + "invalid on inner field", + "invalid on outer field", + "valid on both fields", + ], + "relative refs with absolute uris and defs": [ + "invalid on inner field", + "invalid on outer field", + "valid on both fields", + ], + }, + unevaluatedItems: { + "unevaluatedItems depends on adjacent contains": [ + "contains passes, second item is not evaluated", + ], + "unevaluatedItems depends on multiple nested contains": [ + "7 not evaluated, fails unevaluatedItems", + ], + "unevaluatedItems and contains interact to control item dependency relationship": [ + "only b's are invalid", + "only c's are invalid", + "only b's and c's are invalid", + "only a's and c's are invalid", + ], + }, + unevaluatedProperties: { + "unevaluatedProperties with if/then/else, then not defined": [ + "when if is false and has unevaluated properties", + ], + }, + }), + remotes: { + "http://localhost:1234/ref-and-defs.json": require("./JSON-Schema-Test-Suite/remotes/ref-and-defs.json"), + "http://localhost:1234/draft2020-12/format-assertion-false.json": require("./JSON-Schema-Test-Suite/remotes/draft2020-12/format-assertion-false.json"), + "http://localhost:1234/draft2020-12/format-assertion-true.json": require("./JSON-Schema-Test-Suite/remotes/draft2020-12/format-assertion-true.json"), + "http://localhost:1234/draft2020-12/metaschema-no-validation.json": require("./JSON-Schema-Test-Suite/remotes/draft2020-12/metaschema-no-validation.json"), + }, + skip: [...SKIP_DRAFT7, "optional/format-assertion"], +}) + +interface TestSuite { + name: string + test: any[] +} -function runTest(instances, draft: number, tests) { +interface SchemaTest { + instances: Ajv[] + draft: number + tests: TestSuite[] + skip?: string[] + remotes?: Record +} + +function runTest({instances, draft, tests, skip = [], remotes = {}}: SchemaTest) { for (const ajv of instances) { ajv.opts.code.source = true if (draft === 6) { @@ -79,6 +221,7 @@ function runTest(instances, draft: number, tests) { ajv.opts.defaultMeta = "http://json-schema.org/draft-06/schema#" } for (const id in remoteRefs) ajv.addSchema(remoteRefs[id], id) + for (const id in remotes) ajv.addSchema(remotes[id], id) ajvFormats(ajv) } @@ -86,7 +229,7 @@ function runTest(instances, draft: number, tests) { description: `JSON-Schema Test Suite draft-${draft}: ${instances.length} ajv instances with different options`, suites: {tests}, only: [], - skip: SKIP[draft], + skip, assert: chai.assert, afterError, afterEach, @@ -95,3 +238,37 @@ function runTest(instances, draft: number, tests) { timeout: 30000, }) } + +interface SkippedTestCases { + [suite: string]: { + [test: string]: string[] | true + } +} + +function skipTestCases(suites: TestSuite[], skipCases: SkippedTestCases): TestSuite[] { + for (const suiteName in skipCases) { + const suite = suites.find(({name}) => name === suiteName) + if (!suite) throw new Error(`test suite ${suiteName} not found`) + for (const testName in skipCases[suiteName]) { + const test = suite.test.find(({description}) => description === testName) + if (!test) { + throw new Error(`test ${testName} not found in suite ${suiteName}`) + } + const skippedCases = skipCases[suiteName][testName] + suite.test.forEach((t) => { + if (t.description === testName) { + if (skippedCases === true) { + t.skip = true + } else { + t.tests.forEach((testCase: any) => { + if (skippedCases.includes(testCase.description)) { + testCase.skip = true + } + }) + } + } + }) + } + } + return suites +} From d0a928e93f2ea4649221c4ca77ed934895d54a56 Mon Sep 17 00:00:00 2001 From: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com> Date: Mon, 8 Nov 2021 19:51:08 +0000 Subject: [PATCH 19/22] update website links to OpenCollective --- docs/README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/README.md b/docs/README.md index 0202a0911..0ca00e591 100644 --- a/docs/README.md +++ b/docs/README.md @@ -39,15 +39,15 @@ Use JSON Type Definition or JSON Schema ## Ajv sponsors [![mozilla](/img/mozilla.svg)](https://www.mozilla.org) -[![reserved](/img/reserved.svg)](https://github.com/sponsors/epoberezkin) +[![reserved](/img/reserved.svg)](https://opencollective.com/ajv) [![microsoft](/img/microsoft.png)](https://opensource.microsoft.com) -[![reserved](/img/reserved.svg)](https://github.com/sponsors/epoberezkin) -[![reserved](/img/reserved.svg)](https://github.com/sponsors/epoberezkin) +[![reserved](/img/reserved.svg)](https://opencollective.com/ajv) +[![reserved](/img/reserved.svg)](https://opencollective.com/ajv) @@ -55,8 +55,8 @@ Use JSON Type Definition or JSON Schema [![retool](/img/retool.svg)](https://retool.com/?utm_source=sponsor&utm_campaign=ajv) [![tidelift](/img/tidelift.svg)](https://tidelift.com/subscription/pkg/npm-ajv?utm_source=npm-ajv&utm_medium=referral&utm_campaign=enterprise) -[![reserved](/img/reserved.svg)](https://github.com/sponsors/epoberezkin) -[![reserved](/img/reserved.svg)](https://github.com/sponsors/epoberezkin) +[![reserved](/img/reserved.svg)](https://opencollective.com/ajv) +[![reserved](/img/reserved.svg)](https://opencollective.com/ajv) From da46e38a0d4bc85e1c891dcc3ab526fc28961d18 Mon Sep 17 00:00:00 2001 From: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com> Date: Mon, 8 Nov 2021 19:51:42 +0000 Subject: [PATCH 20/22] 8.7.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index edfbdae41..edd891d4a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ajv", - "version": "8.6.3", + "version": "8.7.0", "description": "Another JSON Schema Validator", "main": "dist/ajv.js", "types": "dist/ajv.d.ts", From 73808bf65ea5b449e4e0e4f9d189971ca8353dfb Mon Sep 17 00:00:00 2001 From: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com> Date: Mon, 8 Nov 2021 20:41:41 +0000 Subject: [PATCH 21/22] create ajv bundle for JSON Schema 2020-12 --- rollup.config.js | 1 + 1 file changed, 1 insertion(+) diff --git a/rollup.config.js b/rollup.config.js index d435b70f0..09dafef1b 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -28,5 +28,6 @@ function createBundleConfig(sourceFile, outFile, globalName) { export default [ createBundleConfig("ajv", "ajv7", "av7"), createBundleConfig("2019", "ajv2019", "ajv2019"), + createBundleConfig("2020", "ajv2020", "ajv2020"), createBundleConfig("jtd", "ajvJTD", "ajvJTD"), ] From 8fccddb4161cfe4d63f2b8987d58f6c10a6bf005 Mon Sep 17 00:00:00 2001 From: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com> Date: Mon, 8 Nov 2021 20:43:09 +0000 Subject: [PATCH 22/22] 8.7.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index edd891d4a..c8de87e54 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ajv", - "version": "8.7.0", + "version": "8.7.1", "description": "Another JSON Schema Validator", "main": "dist/ajv.js", "types": "dist/ajv.d.ts",