laravel / lumen-framework

The Laravel Lumen Framework.
https://lumen.laravel.com
MIT License
1.47k stars 419 forks source link

Change controller validate helper method to behave like Laravel (#1247) #1248

Closed MattApril closed 2 years ago

MattApril commented 2 years ago

1247

driesvints commented 2 years ago

Tests are failing here.

MattApril commented 2 years ago

Whoops, I forgot that I overwrote my own exception handler. Looks like Lumen's default handler excepts the response to be set on the ValidationException. Fixed.

taylorotwell commented 2 years ago

Would this break existing applications?

MattApril commented 2 years ago

Yes, it would cause a breaking change if anyone overwrote the protected extractInputFromRules or throwValidationException methods. I just updated it to use those methods if they are defined.

halloei commented 2 years ago

This broke my application. I'm not overwriting extractInputFromRules() and throwValidationException(), I'm calling them directly from my controller.

driesvints commented 2 years ago

We're reverting this.

MattApril commented 2 years ago

Hmm, that was an unfortunate oversight. Sorry about that.

I think this should be released as a breaking change in the next major version though. The current validation is not behaving as expected.