Avrora.Resolver.resolve

You're seeing just the function resolve, go back to Avrora.Resolver module for more information.

Specs

resolve(integer() | String.t()) :: {:ok, Avrora.Schema.t()} | {:error, term()}

Resolve schema by integer ID or by a string name with optional version, then update memory storage.

In case of an integer ID it stores schema in memory with ID key.

Examples

...> {:ok, schema} = Avrora.Resolver.resolve(1)
...> schema.full_name
"io.confluent.Payment"

In case of a string name it stores schema in memory with key name and name:version, also adds schema to the Schema Registry (if it's configured).

A version for the name can be provided by adding : with the version number, e.g. io.confluent.Payment:5. If the Schema Registry is configured (:registry_url), it will first try fetch there, then local schemas folder (:schemas_path).

Examples

...> {:ok, schema1} = Avrora.Resolver.resolve("io.confluent.Payment")
...> {:ok, schema2} = Avrora.Resolver.resolve("io.confluent.Payment:42")
...> schema1.version
42
...> schema2.version
42
...> schema1.full_name
"io.confluent.Payment"
...> schema.full_name
"io.confluent.Payment"