ajv-validator / ajv-validator/ajv-errors

Reference Error with relative JSON pointer

オープン
#100 コメント 1 件 リアクション 0 件 担当者 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 を短くまとめたダイジェスト。