# Custom error messages in schema

**URL:** <https://jsonforms.discourse.group/t/custom-error-messages-in-schema/672>\
**Category:** General\
**Created:** [March 22, 2022, 7:06pm UTC](https://jsonforms.discourse.group/t/custom-error-messages-in-schema/672 "2022-03-22T19:06:37Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![cornelos](https://yyz2.discourse-cdn.com/free1/user_avatar/jsonforms.discourse.group/cornelos/32/274_2.png) [@cornelos](https://jsonforms.discourse.group/u/cornelos)\
**Post date:** [March 22, 2022, 7:06pm UTC](https://jsonforms.discourse.group/t/custom-error-messages-in-schema/672/1 "2022-03-22T19:06:37Z")

</div>

Hi!

I am trying to get custom validation messages working using ajv-errors.  
A custom message for a format error is working but I cannot get a custom error message for ‘required’ working.

example:

`"zipcode": { "type": "string", "format": "postcode", "errorMessage": {"required": "Postcode is required", "format": "Postcode is in the wrong format"}},`

So In case of a format-error I get the customized message  
But in case of a required error I get the default error message…

What am I doing wrong?

---

<div class="post-metadata">

**Author:** ![sdirix](https://yyz2.discourse-cdn.com/free1/user_avatar/jsonforms.discourse.group/sdirix/32/1073_2.png) [@sdirix](https://jsonforms.discourse.group/u/sdirix)\
**Post date:** [March 22, 2022, 8:35pm UTC](https://jsonforms.discourse.group/t/custom-error-messages-in-schema/672/2 "2022-03-22T20:35:30Z")

</div>

Hi @cornelos,

the `required` is technically an error on the parent of the property not on the property itself. So I would try to customize the error there.

Note that we also now have quite some nice translation support in JSON Forms (via the prop `i18n`) which also allows you to customize the error messages. However this is not yet documented. If you want to try it, you can find some information [here](https://github.com/eclipsesource/jsonforms/issues/1840#issuecomment-984800720).

---

<div class="post-metadata">

**Author:** ![svnt](https://yyz2.discourse-cdn.com/free1/user_avatar/jsonforms.discourse.group/svnt/32/360_2.png) [@svnt](https://jsonforms.discourse.group/u/svnt)\
**Post date:** [June 21, 2022, 9:28am UTC](https://jsonforms.discourse.group/t/custom-error-messages-in-schema/672/3 "2022-06-21T09:28:15Z")

</div>

> [@sdirix](#):
>
> If you want to try it, you can find some information [here](https://github.com/eclipsesource/jsonforms/issues/1840#issuecomment-984800720).

Doesn’t helps me much. How do I use this l18n feature with The Vue vanilla renderer?  
Where I have to put the keys in (ui)schema?

best regards,  
Svnt

---

<div class="post-metadata">

**Author:** ![sdirix](https://yyz2.discourse-cdn.com/free1/user_avatar/jsonforms.discourse.group/sdirix/32/1073_2.png) [@sdirix](https://jsonforms.discourse.group/u/sdirix)\
**Post date:** [June 24, 2022, 7:27am UTC](https://jsonforms.discourse.group/t/custom-error-messages-in-schema/672/4 "2022-06-24T07:27:44Z")

</div>

Hi @svnt, the documentation is not yet finished but a much more comprehensive state is available [here](https://deploy-preview-222--jsonforms.netlify.app/docs/i18n). If something is missing or confusing please leave a comment in the [PR](https://github.com/eclipsesource/jsonforms2-website/pull/222).
