ajv-validator / ajv-validator/ajv-errors

Use params in custom errors

Aperta
#17 9 commenti 12 reazioni 0 assegnatari Vedi su GitHub
feature
Lingua principale
TypeScript
Stelle
289
Fork
21
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

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 !

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.