lib/csv2avro/schema.rb
# TODO: Change this when the avro gem starts to support aliases
Change this when the avro gem starts to support aliases
Change this when the avro gem starts to support aliases
def aliases
      schema_as_json = JSON.parse(schema_string)
      Hash[
        schema_as_json['fields'].select{ |field| field['aliases'] }.flat_map do |field|
          field['aliases'].map { |one_alias| [one_alias, field['name']]}
        end
      ]
    end
def aliases schema_as_json = JSON . parse ( schema_string ) Hash [ schema_as_json [ 'fields' ] . select { | field | field [ 'aliases' ] } . flat_map do | field | field [ 'aliases' ] . map { | one_alias | [ one_alias , field [ 'name' ] ] } end ] end
TODO: Change this when the avro gem starts to support aliases
TODO : Change this when the avro gem starts to support aliases