Unfortunately no, but I’m glad you asked about this, as it is precisely one of the big things I’m planning to improve in dry-validation 1.0. There’s a big missing concept here, which is validating input prior coercion. I don’t know how the API will look like, but something like this, more or less:
required(:from).coerce_to(:time, format: :iso8601)
What will happen in such case, is that since there are no rules for the output value, it will assume that coercion and its result is everything we need to check, which is:
- is the input value in the right iso8601 format?
- is the output a time object?