8000 [Profiler][Validator] Add a validator panel in profiler by ogizanagi · Pull Request #22554 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Profiler][Validator] Add a validator panel in profiler #22554

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 19, 2017
Merged

[Profiler][Validator] Add a validator panel in profiler #22554

merged 1 commit into from
Jun 19, 2017

Conversation

ogizanagi
Copy link
Contributor
@ogizanagi ogizanagi commented Apr 27, 2017
Q A
Branch? 3.4
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets N/A
License MIT
Doc PR N/A

I'm exploring the possibility of having a validator panel in the profiler.
The integration in the form panel is great, but there are a lot of other use-cases where you're likely to call the validator. The idea of this panel is to reference every calls made to the validator (ValidatorInterface::validate() at least) along with detailed informations.
Dealing with apis and a mobile app, it's not always easy to get the response body within the app to get what's wrong with the call. So now with this panel, I'm able to get the details without the api response.

In action with Symfony demo (on the admin new post form):

symfony-demo

capture d ecran 2017-04-27 a 17 14 24

On another app, by calling the validator elsewhere:

No violations With violations
capture d ecran 2017-04-27 a 17 16 41 capture d ecran 2017-04-27 a 17 17 32

What do you think ?


Note: the SVG icon used should be changed. If anyone is willing to contribute and provide one, I'll be glad to add it!

Copy link
Member
@stof stof left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests are also missing

xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">

<services>
<service id="debug.validator" decorates="validator" class="Symfony\Component\Validator\Validator\TraceableValidator">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this service should be private, as you should never get it at runtime explicitly as debug.validator