ajv-validator / ajv-validator/ajv-errors

Use params in custom errors

未關閉
#17 9 則留言 12 個 reaction 已指派 0 人 在 GitHub 檢視
feature
主要語言
TypeScript
星號
289
分支
21
PR 合併指標
30 天內沒有已合併 PR

描述

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 !

貢獻指南

這個儲存庫沒有索引到貢獻指南

評估

這個 Issue 還沒有評估資料。

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

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