liip / LiipMonitorBundle

Integrates the LiipMonitor library into Symfony
http://liip.ch
467 stars 103 forks source link

[Bug] Controller is ignoring additional controllers #290

Open Cartman34 opened 8 months ago

Cartman34 commented 8 months ago

On version v2.21.0, I am experiencing an issue providing an additional reporter.

According to documentation, I declared my own report service and I try to use it by requesting /health?reporters[]=my_reporter The controller is ok, the service is ok, so I debugged the app and find the issue:

In controller, the action runTests is doing $reporters = $request->query->all('reporters') ?? []; instead of $reporters = $request->query->get('reporters') ?? [];

So all() returns the whole parameters as array and it's not recognizing the reporter alias.

My own need is to rewrite response array to use camelCase only because snake_case is prohibited on my API.

Cartman34 commented 8 months ago

It's working using ?reporters=my_reporter but it's not matching documentation.

kbond commented 8 months ago

Hey @Cartman34!

I'm not quite seeing the issue but what version of Symfony are you on? I know newer versions have locked down the behaviour of query->get() and query->all().

Cartman34 commented 7 months ago

Hey @kbond I am using Symfony v4.4 and I am not allowed to upgrade it for now.

kbond commented 7 months ago

Right, we dropped 4.4 support in the latest version.