Not able to get ajv-errors in custom renderers

“errorMessage”: {
“required”: {
“Name”: “should have an integer property Name”,
“Owner”: “should have a string property Owner”
}
},

I am using an errormessage like this in the schema
I am using ajv errors to get these errors

import Ajv from ‘ajv’;
import AjvErrors from ‘ajv-errors’;

const ajv = new Ajv({
allErrors: true,
strict: false,
});

AjvErrors(ajv, { singleError: false, keepErrors: false });

Name and Owner are fields which are shown by custom renderer .

The custom render is not able to get the errors by ajv-errors .Can you please help me with this.

Hi @BharathKS77,

JSON Forms maps the errors received by AJV to the respective controls. So if that is not working, then probably because the errors don’t look like expected. You should check the output of the errors of your customized AJV and compare it to the output of Vanilla AJV to see what the difference between these errors are.

If you need to manually map the errors to your custom control, then you can use useJsonForms(), e.g. const allErrors = useJsonForms().core.errors.

Note that if all you want to do is to show different isRequired messages then there is no need to customize AJV at all. You can simply use our i18n support to “translate” each message as needed. Customizations are possible on a per-field level.