Hi,
i have connected my fluentvalidation and have added validations.
The problem is that sometimes the error dto containing the error messages are not returned but instead the empty response dto.
Am I missing something?
I can see it stops and the error is complete
I have in my AppHost this confingration
Plugins.Add(new ValidationFeature { ErrorResponseFilter = ValidationErrorFilter });
// Return your own validation result format here
public static object ValidationErrorFilter(ValidationResult validationResult, object errorDto)
{
// Loop through the validationResult create your own custom error response object.
// return your response object
//foreach (var item in validationResult.Errors)
//{
//}
return errorDto;
}
But instead it returns an empty DTO with the correct HTTPStatus Code 400 Predicate
{
"CategoryId": 0,
"Active": false,
"IsFavorite": false
}
Thx!