ajv-validator / ajv-validator/ajv-errors

Property name template not working in unevaluatedProperties

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

説明

The property name template {0#} works great in additionalProperties, but it does not seem to work in unevaluated properties. For example, the schema:

` "actions": {
"type": "array",
"items": {
"type": "object",
"unevaluatedProperties": {
"not": true,
"errorMessage": "Unexpected property {0#} in action object"
},
"properties": {
"_id": {
"type": "string"
},
"type": {
"enum": [
"booking",
"chat"
]
},
"className": {
"type": "string"
},
"cta": {
"type": "string"
},
"inquiryTypeId": {
"type": "string"
}
},
"required": [
"_id",
"type",
"className",
"cta"
],
"oneOf": [
{
"$ref": "#/$defs/chatAction"
},
{
"$ref": "#/$defs/bookingAction"
}
]
}
}
`

Yields an error like:
` {
"instancePath": "/0/guide/actions/1/conversionCode",
"schemaPath": "#/properties/actions/items/unevaluatedProperties/errorMessage",
"keyword": "errorMessage",
"params": {
"errors": [
{
"instancePath": "/0/guide/actions/1/conversionCode",
"schemaPath": "#/properties/actions/items/unevaluatedProperties/not",
"keyword": "not",
"params": {},
"message": "must NOT be valid",
"emUsed": true
}
]
},
"message": "Unexpected property {0#} in action object"
}`

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

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

評価

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

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

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