Method ReadDefault
ReadDefault(AvroSchema, JsonElement)
Converts a field's default value, as written in the schema (DefaultValue), to an AvroValue: the value a reader gives the field when the data lacks it. Defaults use the JSON encoding with one difference: a union default is not wrapped, and takes the first branch it matches.
public static AvroValue ReadDefault(AvroSchema schema, JsonElement value)
Parameters
schemaAvroSchemaThe field's schema.
valueJsonElementThe default, as written in the schema.
Returns
Exceptions
- AvroDataException
The default does not match the schema.