These are chat archives for dry-rb/chat

2nd
Aug 2017
Maciej Mensfeld
@mensfeld
Aug 02 2017 16:01
Hey guys how can I make an array part of schema non-optional?
      required(:topics).each do
        schema do
          required(:id).filled(:str?, format?: Karafka::Schemas::TOPIC_REGEXP)
          required(:name).filled(:str?, format?: Karafka::Schemas::TOPIC_REGEXP)
          required(:inline_mode).filled(:bool?)
          required(:controller).filled
          required(:parser).filled
          required(:interchanger).filled
          required(:max_bytes_per_partition).filled(:int?, gteq?: 0)
          required(:start_from_beginning).filled(:bool?)
        end
      end
does not fail when topics is an empty array
works great when topics is nil or when the strucutre is invalid, but when I assign an empty array, does not fail