lib/avro.rb in avro-1.9.2 vs lib/avro.rb in avro-1.10.0

- old
+ new

@@ -26,20 +26,32 @@ class AvroError < StandardError; end class AvroTypeError < Avro::AvroError def initialize(schm=nil, datum=nil, msg=nil) - msg ||= "Not a #{schm.to_s}: #{datum}" + msg ||= "Not a #{schm}: #{datum}" super(msg) end end class << self + attr_writer :disable_enum_symbol_validation attr_writer :disable_field_default_validation + attr_writer :disable_schema_name_validation + def disable_enum_symbol_validation + @disable_enum_symbol_validation ||= + ENV.fetch('AVRO_DISABLE_ENUM_SYMBOL_VALIDATION', '') != '' + end + def disable_field_default_validation @disable_field_default_validation ||= ENV.fetch('AVRO_DISABLE_FIELD_DEFAULT_VALIDATION', '') != '' + end + + def disable_schema_name_validation + @disable_schema_name_validation ||= + ENV.fetch('AVRO_DISABLE_SCHEMA_NAME_VALIDATION', '') != '' end end end require 'avro/schema'