ajv-validator / ajv-validator/ajv-errors

Reference Error with relative JSON pointer

未关闭
#100 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
bug
主要语言
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 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。