Q:

How to get all errors of data annotation validation and override its JSON representation in ASP.NET Core?

I would like to get all errors of the Data Annotations after the request comes in . E.g. [Required].
I localized the strings yet. But now I want to change the JSON representation of the errors which looks in default like this:
"errors": {
    "FirstName": [
      "Please provide a valid First Name."
    ]
  }

I need to remove FirstName. But generally the whole JSON structure. 
Where can I override that representation? Is it even possible?
I tried it with an ActionFilter yet but that is too late. The response is given before the methods of the ActionFilter are executed.
UPDATE
Further problem specification:
It is a web api. The error is returned before any code in my controller is executed. I need to get all errors which the Data Annotations like [Required] produce and format them. At the moment it seems that the errors are returned directly when any Data Annotation constraint fails.

A:

You can try to get all errors from ModelState and fill into collection :
if (!ModelState.IsValid)
{
    var errors = new List<string>();
    foreach (var state in ModelState)
    {
        foreach (var error in state.Value.Errors)
        {
            errors.Add(error.ErrorMessage);
        }
    }

    var response = new { errors = errors };
}

And then return to client side using JsonResult :
return new JsonResult(response) { StatusCode = (int)HttpStatusCode.BadRequest };

Update 
When [ApiController] attribute is applied ,ASP.NET Core automatically handles model validation errors by returning a 400 Bad Request with ModelState as the response body :
Automatic HTTP 400 responses
To disable the automatic 400 behavior, set the SuppressModelStateInvalidFilter property to true :
services.AddControllers()
    .ConfigureApiBehaviorOptions(options => 
    {   
        options.SuppressModelStateInvalidFilter = true;     
    });

