ajv-validator / ajv-validator/ajv-errors
Reference Error with relative JSON pointer
- Lenguaje dominante
- TypeScript
- Estrellas
- 289
- Forks
- 21
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
### 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.
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Evaluación
Este issue todavía no se ha evaluado.