Definitions and helpers for Avro Names.
Record, Enum and Fixed types are named types. Each has a full name that is composed of two parts; a name and a namespace. Equality of names is defined on the full name.
A namespace is list of scoping names, encoded in the interface description language and Json specification language as a dot separated string, but here as an Elm list.
The empty string may also be used as a namespace to indicate the null namespace. Equality of names (including field names and enum symbols) as well as fullnames is case-sensitive.
Record fields and enum symbols have names as well (but no namespace). Equality of fields and enum symbols is defined on the name of the field/symbol within its scope (the record/enum that defines it). Fields and enum symbols across scopes are never equal.
The name portion of the full name of named types, record field names, and enum symbols must:
Build a TypeName from using the name and namespace fields within a context.
Rules for this are specified in the avro specification.
Arguments:
Normalise a TypeName.
This replaces short names with fullnames, using applicable namespaces to do so, then eliminate namespace attributes, which are now redundant.
Whether two names are compatible for Schema resolution.
This means that either the unqualified names match, or an alias matches the fully qualified name.
Test that a TypeName is valid
That is, test that
An Avro Type Name
This constructor is exposed, but one should only build names which are correctly scoped and have valid names.
If unsure, one should use
contextualTypeNameto parse the data instead.