ajv-validator / ajv-validator/ajv-errors
Reference Error with relative JSON pointer
- 主要言語
- TypeScript
- スター
- 289
- フォーク
- 21
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
### Package Versions:
`node@v14.16.1`
`ajv@8.1.0`
`ajv-errors@3.0.0`
### Problem
Hi when I was trying belowed case I got a `ReferenceError: data1 is not defined` from my node. It seems that ajv's scheme compiler generates wrong code. When I change `schema.foo.bar`'s type definition or reduce the nesting levels the same error will not occurred again.
```javascript
const Ajv = require('ajv');
const ajv = new Ajv({ allErrors: true });
require('ajv-errors')(ajv);
const schema = {
type: "object",
properties: {
foo: {
type: "object",
properties: {
bar: {
type: "string",
errorMessage: "${0}",
},
},
},
},
};
const data = {
foo: {
bar: false,
},
};
ajv.validate(schema, data);
console.log(ajv.errors);
```
Sincerely hope for replying.
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
評価
この issue はまだ評価されていません。