Integration of Validation
Issue #2
resolved
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)
-
-
Ok, implemented in the DEV branch!
Nice feature. :)
https://bitbucket.org/99grad-team/nnrestapi/commits/f7405a8c5381c48961665046eb33d14cb82629c4 -
- changed status to resolved
-
reporter nice - thanks for the quick implementation
- Log in to comment
Great idea! On the todo list!!