I still did't found a solution.
I've reported the following bug for this: Bug #122692: Generating a server side validation for content does not display the validation messages on the server.
EPiServer Development Team
This is expected but perhaps a bit surprising. The response payload containing the error messages is json-formatted, but when the errorHandler is configured to replace the response the error messages will be replaced.
Setting existingResponse="Auto" should solve your problem.
This is not specific to your custom validation. We're using the TrySkipIisCustomErrors flag on the response to be able to return computer friendly REST responses, so you will experience similar problems for all store responses returning a payload in the body.
Here's an explanation of the TrySkipIisCustomErrors flag.
Does anyone actually have a working solution to this? Setting existingResponse to Auto does fix the validation issue, but with it in place I am unable to get any custom errors to work.
I have "public class RequiredImageSizeValidator : IValidate
" and it's worked good.
But if I add
validation working incorrectly.
If validator return errors, create button becomes disabled, but error not showing.
Server response with httperrors in config
Server response without httperrors in config
How I can remove effect from httperrors in validation?