Module: KafkaRest::SchemaParser

Defined in:
lib/kafka_rest/schema_parser.rb

Constant Summary collapse

TYPE_RE =
%r{(?<="type":\s")[\w\.]+(?=")}.freeze
WHITELIST =
%w(array boolean bytes double enum fixed float int long map null record string)

Class Method Summary collapse

Class Method Details

.call(file) ⇒ Object



7
8
9
10
11
# File 'lib/kafka_rest/schema_parser.rb', line 7

def call(file)
  fail ArgumentError, "#{file} is not a file" unless File.file?(file)

  File.open(file) { |f| parse_file(f) }
end