Feb 12, 2025
Usually find that it works better to make validation rules a struct that conforms to a Validate protocol, then adding rules to a set of rules for each field.
That makes it easier, for example, to have a ruleset that combines rules like [.required, .isAmount, .min(5.00), .max(10_000)].