You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Maybe I'm doing something wrong but the error messages for the each rule are very unclear when using getMessages(). getFullMessage() has a much better result but seeing as I need to return any errors in JSON format it doesn't fit my needs.
Array
(
[allOf] => Array
(
[validator.0] => All of the required rules must pass for `{ "product_title": "test", "quantity": "test" }`
[validator.1] => All of the required rules must pass for `{ "product_title2": "test" }`
)
)
The desired result would look something like this
Array
(
[order_items] => Array
(
[item_1] => Array
(
[product_title] => product_title must be present
)
)
)
The text was updated successfully, but these errors were encountered:
In version 3.0, the array of messages is looking somehow like this:
[
'keySet' => [
'__root__' => 'Each item in order_items must be valid',
'keySet.1' => 'quantity must be an integer value',
'keySet.2' => [
'__root__' => 'order_items contains both missing and extra keys',
'product_title' => 'product_title must be present',
'quantity' => 'quantity must be present',
'product_title2' => 'product_title2 must not be present',
],
],
]
I'm trying to push to get it done as soon as possible, but it will probably be at the beginning of next year.
Maybe I'm doing something wrong but the error messages for the
each
rule are very unclear when usinggetMessages()
.getFullMessage()
has a much better result but seeing as I need to return any errors in JSON format it doesn't fit my needs.My code:
Resulting error messages:
The desired result would look something like this
The text was updated successfully, but these errors were encountered: