Table of Contents

Method ReadDefault

Namespace
AvroSharp.Generic
Assembly
AvroSharp.dll

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

schema AvroSchema

The field's schema.

value JsonElement

The default, as written in the schema.

Returns

AvroValue

Exceptions

AvroDataException

The default does not match the schema.