Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Be able to set custom keyword for error messages #141

Open
davis90 opened this issue Sep 8, 2021 · 1 comment
Open

Be able to set custom keyword for error messages #141

davis90 opened this issue Sep 8, 2021 · 1 comment

Comments

@davis90
Copy link

davis90 commented Sep 8, 2021

Hi!

Thanks for your great libraries. It's cool to work with.

Being able to define the key for the error messages could be nice.

maybe something like:

import Ajv from 'ajv'
import ajvErrors from 'ajv-errors'

let ajv = new Ajv({ allErrors: true })
ajv = ajvErrors(ajv, { keyword: "myCustomErrorMessage" })

what is your opinion about that?

thank for all!

@davis90 davis90 changed the title Be able to set custom keyword for error Message Be able to set custom keyword for error messages Sep 8, 2021
@kamsar
Copy link

kamsar commented Jan 24, 2022

This would be useful with OpenAPI-based schema inputs since OpenAPI expects all custom properties to start with x-, so being able to use x-errorMessage would be nice.

If this is something the maintainers like, I could look at implementing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants