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 for this. It could also be solved with middleware support.
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
JSONFormsStateProviderand add your ownmiddlewaresupport (which can be a simplifiederrors-only version of course). Use the modifiedJSONFormsStateProviderinstead of theJsonFormscomponent then. - Listen to all data changes in JSON Forms and invoke
updateErrorswith 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.