ajv-validator / ajv-validator/ajv-cli

"error: nullable value must be ["boolean"]" does not give line number

オープン
#111 コメント 1 件 リアクション 1 件 担当者 0 名 GitHub で見る
主要言語
TypeScript
スター
316
フォーク
77
PR マージ指標
30日以内にマージされた PR はありません

説明

I got this error:

```
schema docs/endpoints/schemas/get-employee.json is invalid
error: nullable value must be ["boolean"]
```
but unlike the other schema validation error messages, there is no hint as to _where_ this error is coming from. It turned out that I had accidentally added `nullable: "true"` (this was a typo) in just one of the 100+ instances of nullable. This was extremely hard to find, and the error message didn't make it clear what the problem was in the first place.

Also, a suggestion to make the error message a bit easier to understand:

`nullable value type must be one of ["boolean"]` or just `nullable value must be of type boolean` (seems to be no reason to include a confusing array if there is only one possible type). Even better: `nullable value must be of type boolean, not string`

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。