Showing @mui/x-date-pickers Validation Errors on Form Submission in Custom JSONForms Renderer

Hi @gr8pathik,

persistent errors should be determined independent of the UI, so that they can for example be reproduced in the backend too.

For this my main recommendation is to implement a custom validator for AJV. Then the errors are determined as part of the regular validation process and don’t need any special handling in the UI.

Some alternatives, although all of them have some downsides:

  • You could perform the custom validation outside of JSON Forms whenever you receive a data update and thereby always hand in updated additionalErrors. Downside: Additional rendering step
  • The custom validation can also be executed as part of the middleware whenever validation is performed, i.e. as part of the INIT, UPDATE_CORE, UPDATE_DATA actions. Downside: Error handling tied to JSON Forms
  • The errors determined during rendering could be collected by a React context, thereby persisting them. Downside: Error handling tied to JSON Forms and UI