-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
failValidationError can take an array of errors #4609
Conversation
…ay of validation errors
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately we cannot change the function signature like this because it will break any developer classes extending this. I do see how this functionality could be appealing though - how about adding a new method failValidationErrors
with this functionality? We could even deprecate the old one so it could be removed down the road. See what the rest of the team thinks too...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aside from the point of @MGatner , the method's name itself implies using a single error so allowing an array of errors here seems unnatural. failValidationErrors
is not a bad idea though. Maybe we can go that route?
…an array of errors instead of changing the signature for failValidationError.
@MGatner @paulbalandan Yeah, I was debating between the two approaches. I went the way I did because the body of both functions are exactly the same but I agree with both of your points so I pushed an update. |
I would like both of your opinions on whether we should deprecate the |
I don't have a strong opinion against deprecating it. Seems to me that having one authoritative version will be one less of a maintenance issue, so I'm good with deprecating the old one if you think so. |
I could be swayed either way. I agree with @paulbalandan about having one less function means less to maintain. If we are going to do that, I would think we would want to change the signature for failValidationErrors() so it can accept an array or a string. |
Hmm okay. I think that's our way to go. Please do what's necessary. |
…ure of ResponseTrait::failValidationErrors so it can take a string as well.
@caswell-wc please also add this to user_guide_src/source/changelogs/v4.1.2.rst |
… method and removed the documentation for the now deprecated failValidationError
Thanks @caswell-wc ! |
Description
Adjusted the ResponseTrait::failValidationError so it can take an array of validation errors
Checklist: