Imagine that you have a model with some validation.
Model:
class CreateUserDto
{
#[String]
#[Length(max: 20)]
private $name;
#[String]
#[Length(max: 20)]
private $surname;
}
You wrote API and you wanted to try it.
Validation:
$dto = new CreateUserDto($payload)
$validator->validate($dto)
Payload:
You sent the payload and what would you want to get in response?
There are only two options:
- Validation passed.
- Validation failed.
If you want to explain your decision feel free to write comment.
You can vote by emoji:
👍 – validation passed.
👎 – validation failed.
Imagine that you have a model with some validation.
Model:
You wrote API and you wanted to try it.
Validation:
Payload:
{"name": "Dmitrii"}You sent the payload and what would you want to get in response?
There are only two options:
If you want to explain your decision feel free to write comment.
You can vote by emoji:
👍 – validation passed.
👎 – validation failed.