Unclear of how to implement ajv-errors to display customer error messages below the label/input element

Returning defaultMessage here leads to JsonForms complaining about the type returned. I solve it by returning defaultMessage as string, but I am not sure this is the right approch.