ajv-validator / ajv-validator/ajv-errors

Question: use enum values in custom error message

Đang mở
#149 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ả

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}

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.