ajv-validator / ajv-validator/ajv

Better error messaging for NOT

Ouverte
#2,255 1 commentaire 0 réactions 0 personnes assignées Voir sur GitHub
enhancement
Langage dominant
TypeScript
Étoiles
14.8k
Forks
1k
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

**What version of Ajv you are you using?**
8.11.0

**What problem do you want to solve?**
I have a schema with a `not` clause which, on failure, returns a very unhelpful/confusing message: `my-schema.json/thing must NOT be valid`

```json
"thing": {
"type": "number",
"not": {
"exclusiveMinimum": -0.25,
"exclusiveMaximum": 0.25
}
}
```

**What do you think is the correct solution to problem?**
I think the correct messaging would be something along the line of what it would say if the criteria was not wrapped in a `not`. Something like:
```
my-schema.json/thing must NOT be < 0.25, my-schema.json/thing must NOT be > -0.25
```

**Will you be able to implement it?**
Unsure

Guide de contribution

Ouvrir le guide de contribution

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.