protected function createConstraintViolationResponse(ConstraintViolationListInterface $violationList)
    {
        $errors = $this->validationErrorFormatter->groupViolationsByField($violationList);

        return $this->createJsonResponse(
            ['errors' => $errors],
            422
        );
    }
protected function createConstraintViolationResponse(ConstraintViolationListInterface $violationList)
    {
        $errors = $this->validationErrorFormatter->groupViolationsByField($violationList);

        return $this->createJsonResponse(
            ['errors' => $errors],
            422
        );
    }
protected function createConstraintViolationResponse ( ConstraintViolationListInterface $ violationList ) { $ errors = $ this -> validationErrorFormatter -> groupViolationsByField ( $ violationList ) ; return $ this -> createJsonResponse ( [ 'errors' => $ errors ] , 422 ) ; }
Create a response for constraint violations

@param  ConstraintViolationListInterface $violationList
@return JsonResponse
Create a response for constraint violations