Integration of Validation

Issue #2 resolved
Thomas Helmrich created an issue

Hi,

what about integrate a “native” validation?

If the Endpoint is a Domain Model & the convert in ApiController::129 is ready, the valid state of that Object could be checked:

$validator = $validatorResolver->getBaseValidatorConjunction($modelName);
$validation = $this->validator->validate($model);
if($validation->hasErrors()) {
  $errorSet =  $validation->getFlattenedErrors()
  // create error response 
}

Comments (4)

  1. Log in to comment