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 摘要。