Replies: 1 comment
-
I closed this because I saw there's plenty of explanations & discussion already going on elsewhere |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Given this example DTO with a
SnakeCaseMapper
on output and aMax(2)
validation rule:and this test code:
I was expecting a
ValidationException
to be thrown when constructing the DTO.Calling
->validate
again on the object, with the exact same data used to initialize the object seems weird.I can of course "fix" this by adding
$this->validate($this->all());
to the constructor of my DTOs:But I am curious: Am I misunderstanding the purpose of Validation attributes?
Beta Was this translation helpful? Give feedback.
All reactions