i would like to make a api extention for create article with batch. so if there any method to extend current response message for parent::create() . i would like to manipulate the response data validation error message with json. if there any way to do that ?
"success": true,
"data": [
{
"success": false,
"message": "tax" This value should not be blank. \n",
"trace": path...
insted of geting above response i would like to make following way with plugin
{
"result":
{
"processed": 10,
"succeeded": 8,
"failed": {
"count": 2,
"errors": [
{ "articleNumber": "1234567890", "validationFailures": ["...", "..."], "error": { "...": "" } },
{ "articleNumber": "1234567891", "validationFailures": ["...", "..."], "error": { "...": "" } },
]
}
}
}
How i can extend Rest.php controller?