Sha256: 5e4c77a46b3e5cfbb0c04bb1f49569a7c4e1984cedaee6b5ab1a624214c39aff
Contents?: true
Size: 676 Bytes
Versions: 7
Compression:
Stored size: 676 Bytes
Contents
# frozen_string_literal: true module WaterDrop module Schemas # Regexp to check that topic has a valid format TOPIC_REGEXP = /\A(\w|\-|\.)+\z/ # Schema with validation rules for validating that all the message options that # we provide to producer ale valid and usable # @note Does not validate message itself as it is not our concern MessageOptions = Dry::Validation.Schema do required(:topic).filled(:str?, format?: TOPIC_REGEXP) optional(:key).maybe(:str?, :filled?) optional(:partition).filled(:int?, gteq?: 0) optional(:partition_key).maybe(:str?, :filled?) optional(:create_time).maybe(:time?) end end end
Version data entries
7 entries across 7 versions & 1 rubygems