Is there a way to validate int? and format? together

This is my first time to try dry-validation, then I face an issue when I want to describe my schema to look like:

CardSchema = Dry::Validation.Schema do
  required(:exp_year).filled(int?, format?: /\A\d{4}\Z/)

Here is what the error message that I got TypeError: no implicit conversion of Integer into String.

No, this is not supported. In dry-schema that will power dry-validation 1.0.0 I want to introduce this concept. We need a way to apply validation rules to input prior coercion, and this is something that dry-validation cannot do right now.

Thank @solnic for the response, I can’t wait to see it in 1.0.0. In the mean time, here is what I come up:

validate(validate_exp_year: :exp_year) do |exp_year|