ajv-validator / ajv-validator/ajv-errors

Use params in custom errors

Open
#17 9 comments 12 reactions 0 assignees View on GitHub
feature
Dominant language
TypeScript
Stars
289
Forks
21
PR merge metrics
No merged PRs in 30d

Description

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 !

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.