# How to add Custom renderer validation errors from json forms ajv errors

**URL:** <https://jsonforms.discourse.group/t/how-to-add-custom-renderer-validation-errors-from-json-forms-ajv-errors/492>\
**Category:** General\
**Created:** [November 16, 2021, 8:31am UTC](https://jsonforms.discourse.group/t/how-to-add-custom-renderer-validation-errors-from-json-forms-ajv-errors/492 "2021-11-16T08:31:15Z")\
**Posts on this page:** 1\
**Showing post:** 2

<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:** [November 16, 2021, 8:07pm UTC](https://jsonforms.discourse.group/t/how-to-add-custom-renderer-validation-errors-from-json-forms-ajv-errors/492/2 "2021-11-16T20:07:18Z")

</div>

Hi @vivek, the use case is sadly not that well supported at the moment. The approach you describe should work in general, however your errors will be removed again immediately with any data update within JSON Forms.

We have an [open issue](https://github.com/eclipsesource/jsonforms/issues/1469) for this. It could also be solved with [middleware support](https://github.com/eclipsesource/jsonforms/issues/1670).

To work around this I see three options:

- Wrap AJV which is handed over to JSON Forms. You can then hand back modified validators to JSON Forms and add your own errors whenever they are invoked.
- Copy the existing `JSONFormsStateProvider` and add your own `middleware` support (which can be a simplified `errors`-only version of course). Use the modified `JSONFormsStateProvider` instead of the `JsonForms` component then.
- Listen to all data changes in JSON Forms and invoke `updateErrors` with every data change to re-add your errors.

All of these solutions have some downsides.

We have this issue on our agenda at some point, however first we’ll finish the 3.0 release.

---

_[View the full topic](https://jsonforms.discourse.group/t/how-to-add-custom-renderer-validation-errors-from-json-forms-ajv-errors/492)._
