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
I'm trying to write a custom validation message for keys in an array of sub-schema elements. The message keys are matched literally, while my key includes the array index of the element: groups.0.name. Here is the (simplified) relevant schema code:
Solution 1. It would be great if I could either add a message to the messages object of the group object from the above example, which will be automatically picked up when validating against the parent schema schema. This solution could also be taken into account, when working on issue #46. Like this:
I think solution 2 would be best and easiest. Solution 1 would introduce a layer of complexity that goes beyond its benefits I think.
There is already a variety of checking for messages, from most specific to least specific, so I can add an additional check for the generic key if the specific key isn't there.
I'm trying to write a custom validation message for keys in an array of sub-schema elements. The message keys are matched literally, while my key includes the array index of the element:
groups.0.name
. Here is the (simplified) relevant schema code:I have two potential solutions in mind:
Solution 1. It would be great if I could either add a message to the messages object of the
group
object from the above example, which will be automatically picked up when validating against the parent schemaschema
. This solution could also be taken into account, when working on issue #46. Like this:Solution 2. Add a message to the messages object of the
schema
object with a wildcard for matching the array index. Example:The text was updated successfully, but these errors were encountered: