What are the packages validation api request for Symfony?


Warning: count(): Parameter must be an array or an object that implements Countable in /home/styllloz/public_html/qa-theme/donut-theme/qa-donut-layer.php on line 274
0 like 0 dislike
122 views
Previously validated api-requests via forms. For me it's not very convenient.

First, form first setit data on the entity, and only then validates. With typehinting methods that is infuriating: you have arguments and return values to specify nullable. There is an option, of course, to use a DTO for this. Only pushes the problem with the validation that require DB queries (UniqueEntity).

Secondly, when there is a need for different whodata validate the data, then you need the group validation. Also not very convenient functionality, which often causes confusion.

Recently sawed api on Laravel. I went from there FormRequest'sthat validinput data before running an action controller.
Started to look for similar packages for Symfony, but found only one - fesor/request-objects

Do you use third-party packages for validation queries? If so, what? And is there any packages similar to FormRequest from Laravel, usable in production?
by | 122 views

2 Answers

0 like 0 dislike
by
0 like 0 dislike
You can use json schema. For example this implementation.
by

Related questions

0 like 0 dislike
2 answers
0 like 0 dislike
2 answers
0 like 0 dislike
3 answers
0 like 0 dislike
2 answers
0 like 0 dislike
3 answers
110,608 questions
257,186 answers
0 comments
35,390 users