SchemaHelper
Value members
Concrete methods
Creates a union schema type, with nested unions extracted, and duplicate nulls stripped.
Creates a union schema type, with nested unions extracted, and duplicate nulls stripped.
Union schemas can't contain other union schemas as a direct child, so whenever we create a union, we need to check if our children are unions and flatten
For example, an Option[SealedTrait], would result in a union of a union, so this must be flattened into a single union.
Returns the subschema used for a Left in an Either.
Returns the subschema used for a Left in an Either.
Returns the subschema used for a Right in an Either.
Returns the subschema used for a Right in an Either.
Given the full name of a record, locates the appropriate sub schema from the given union.
Given the full name of a record, locates the appropriate sub schema from the given union.
Requires a UNION schema and will attempt to find a subschema that matches the default value type. If one matches it will move that schema to the head, as required by the spec.
Requires a UNION schema and will attempt to find a subschema that matches the default value type. If one matches it will move that schema to the head, as required by the spec.
Requires a UNION schema and will move the null schema to the head if it exists. Otherwise returns the UNION as is.
Requires a UNION schema and will move the null schema to the head if it exists. Otherwise returns the UNION as is.
Takes an Avro schema, and overrides the namespace of that schema with the given namespace.
Takes an Avro schema, and overrides the namespace of that schema with the given namespace.