ajv-validator / ajv-validator/ajv-errors

Property name template not working in unevaluatedProperties

Đang mở
#159 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
TypeScript
Star
289
Fork
21
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

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"
}`

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.