ajv-validator / ajv-validator/ajv-cli

Error migrating from draft2019 to draft2020

Ouverte
#125 2 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
Langage dominant
TypeScript
Étoiles
316
Forks
77
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

Using version 5.0.0, there is an error migration from draft2019 to draft2020.

my-schema.json
```
{
"$schema": "https://json-schema.org/draft/2019-09/schema",
"$id": "https://schema.com/my-schema.json",
"type": "object",
"required": [
"number"
],
"properties": {
"number": {
"type": "number"
}
}
}
```

command
```
> ajv migrate -s "my-schema.json" --spec=draft2020 --indent=4
npm\node_modules\ajv-cli\node_modules\ajv\dist\core.js:133
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 (node_modules\ajv-cli\node_modules\ajv\dist\core.js:133:23)
at Ajv2020.validateSchema (node_modules\ajv-cli\node_modules\ajv\dist\core.js:244:28)
at migrateSchema (node_modules\ajv-cli\dist\commands\migrate.js:37:31)
at Array.map ()
at Object.execute (node_modules\ajv-cli\dist\commands\migrate.js:29:24)
at Object. (node_modules\ajv-cli\dist\index.js:19:24)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
```

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.