ajv-validator / ajv-validator/ajv-errors

Reference Error with relative JSON pointer

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

Mô tả

### 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.

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.