Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error using --spec=draft2020 #213

Open
jeremyfiel opened this issue Jun 23, 2022 · 0 comments
Open

Error using --spec=draft2020 #213

jeremyfiel opened this issue Jun 23, 2022 · 0 comments

Comments

@jeremyfiel
Copy link

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

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 (<anonymous>)
    at Object.execute (C:\Users\fieljere\AppData\Roaming\npm\node_modules\←[4majv-cli←[24m\dist\commands\migrate.js:29:24)   
    at Object.<anonymous> (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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant