Avrora.Schema.Encoder.from_erlavro

You're seeing just the function from_erlavro, go back to Avrora.Schema.Encoder module for more information.
Link to this function

from_erlavro(schema, attributes \\ [])

View Source

Specs

from_erlavro(term(), keyword()) :: {:ok, Avrora.Schema.t()} | {:error, term()}

Convert erlavro format to the Schema struct.

Examples

iex> payload =
...>   {:avro_record_type, "Payment", "io.confluent", "", [],
...>        [
...>          {:avro_record_field, "id", "", {:avro_primitive_type, "string", []}, :undefined,
...>           :ascending, []},
...>          {:avro_record_field, "amount", "", {:avro_primitive_type, "double", []}, :undefined,
...>           :ascending, []}
...>        ], "io.confluent.Payment", []}
iex> {:ok, schema} = Avrora.Schema.Encoder.from_erlavro(payload)
iex> schema.id
nil
iex> schema.full_name
"io.confluent.Payment"