ajv-validator / ajv-validator/ajv-errors

Use params in custom errors

Đang mở
#17 9 bình luận 12 reaction 0 người được giao Xem trên GitHub
feature
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ả

Hey :) First of all, thank you for this amazing library.
I was wondering if it is possible to use params in custom errors templates ?
For example, I'd like to be able to do something like this:

errorMessage: {
additionalProperties: 'Invalid additional property "${params.additionalProperty}"'
}

To get an error message with the property that failed.
Is there anyway to do it or do we have to post-process the error ?
Thanks !

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.