Dynamic Schemas in 1.x

In 0.x it was possible to make schemas have different form based on a rule or an option

SCHEMA = Dry::Validation.JSON do
  configure do
    option :product
    def use_outcome_hash?
      product.eql?('fizz')
    end
  end
  required(:outcome).filled
  rule(validate_outcome: [:outcome]) do |outcome|
     use_outcome_hash?.then(outcome.schema(OUTCOME))
   end
end

I am looking to migrate to 1.x because 0.x doesn’t seem to play nicely with ruby 2.7.
I haven’t been able to find similar functionality in 1.x is there any way to do it or do I have to create a separate schema for each scenario?

Hey sorry for late reply. It’s hard to say because like always, it depends on the use case. You can use custom rules based on additional conditions in dry-validation 1.x. You have access to contract’s methods within rule blocks so you can simply leverage that.