ajv-validator / ajv-validator/ajv-cli

Error using --spec=draft2020

Đang mở
#213 0 bình luận 1 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
TypeScript
Star
316
Fork
77
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

`ajv migrate -s ./applicant-onboarding-schema_v02.json -o ./applicant-onboarding-schema_v02-draft2020.json --indent=4 --spec=draft2020`

```sh
C:\Users\fieljere\AppData\Roaming\npm\node_modules\ajv-cli\node_modules\ajv\dist\core.js:147
throw new Error(`no schema with key or ref "${schemaKeyRef}"`);
^

Error: no schema with key or ref "https://json-schema.org/draft/2019-09/schema" at Ajv2020.validate C:\Users\fieljere\AppData\Roaming\npm\node_modules\←[4majv-cli←[24m\node_modules\←[4majv←[24m\dist\core.js:147:23) at Ajv2020.validateSchema (C:\Users\fieljere\AppData\Roaming\npm\node_modules\←[4majv-cli←[24m\node_modules\←[4majv←[24m\dist\core.js:260:28)
at migrateSchema (C:\Users\fieljere\AppData\Roaming\npm\node_modules\←[4majv-cli←[24m\dist\commands\migrate.js:37:31)
at Array.map ()
at Object.execute (C:\Users\fieljere\AppData\Roaming\npm\node_modules\←[4majv-cli←[24m\dist\commands\migrate.js:29:24)
at Object. (C:\Users\fieljere\AppData\Roaming\npm\node_modules\←[4majv-cli←[24m\dist\index.js:19:24)
←[90m at Module._compile (node:internal/modules/cjs/loader:1103:14)←[39m
←[90m at Object.Module._extensions..js (node:internal/modules/cjs/loader:1155:10)←[39m
←[90m at Module.load (node:internal/modules/cjs/loader:981:32)←[39m
←[90m at Function.Module._load (node:internal/modules/cjs/loader:822:12)←[39m
```

I have draft-04 schemas I want to migrate to 2020 and I'm getting the error above.

If I change the command to use `--spec=draft2019`, everything works as expected

i noticed the stack trace indicates the error message referencing draft/2019-09 instead of 2020-12 in the Ajv2020.validate import

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.