ajv-validator / ajv-validator/ajv-errors

Question: use enum values in custom error message

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

描述

I have the following schema

```
const shared_schema = {
$id: "shared_schema",
title: "Shared Allowed Values",
definitions: {
routes: {
enum: ["R1", "R2", "R3"],
errorMessage: "Route must be a TOC-specified allowed value: R1, R2, R3"
}
}
};
```
Is there any way i could have all the enum values defined for routes inside my errorMessage? As i don't want to write all the enum values again and again. May be something like using a json pointer ${/definitions/routes/enum}

貢獻指南

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

評估

這個 Issue 還沒有評估資料。

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

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