ajv-validator / ajv-validator/ajv

Schema validation - A Default value not matching the type of property does not error on validateSchema/Compile

未關閉
#1,407 1 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
enhancement limitation
主要語言
TypeScript
星號
14.8k
分支
1k
PR 合併指標
30 天內沒有已合併 PR

描述

**What version of Ajv are you using? Does the issue happen if you use the latest version?**
V7.0.3 and yes it happens for previous versions too.

**Ajv options object**
```javascript
{ useDefaults: true }
```

**JSON Schema**
```json
{
"$schema": "http://json-schema.org/draft-07/schema",
"type": "object",
"properties": {
"test": {
"type": "boolean",
"default": "mp3"
}
},
"additionalProperties": false
}
```

**Your code**
https://runkit.com/parora611/ajv-issue

**What results did you expect?**
Error should have been thrown on compile.

**Are you going to resolve the issue?**
Not sure as of now.

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。