Releases: actgardner/gogen-avro
v10.2.1
This releases fixes a single bug for schema evolution when removing an enum field from a record. If the old schema contained an enum, and the new schema did not contain an enum, an error would be thrown when deserializing old data. We now correctly deserialize the data for the removed field and throw it away (#185).
v10.2.0
v10.1.1
v10.1.0
v10.1.0 fixes the schema evolution behaviour for enumerations to follow the Avro spec:
- If the indices of symbols are re-ordered in the reader and writer schemas, we will now decode the value to the correct symbol from the reader schema. Previously the index in the reader schema didn't match the index in the writer schema, the symbol in the reader schema would be parsed incorrectly. This issue only affected binary-encoded data, and not JSON-encoded data.
- If a symbol in the writer schema does not exist in the reader schema, the reader enum definition's "default" value will be used. Previously this would result in an error. If no default is specified this still produces an error in deserialization, per the spec. This change also affects deserializing JSON-encoded data.
v10.0.0
This version brings major performance improvments by reducing heap allocations in two ways:
- Arrays and the supporting structures for maps are now pre-allocated to the size of the first block of data. In most cases this will avoid any resizing of slices.
- Most wrapper types (except maps) are no longer heap allocated, which removes an allocation per field.
Enum names are now generated using the fully qualified name, to avoid collisions (#170). This may require you to update your code that uses generated structs.
v9.2.0
This version improves deserialization performance in two ways:
- When reading ints, longs, floats and doubles we now reuse a small buffer instead of doing a small allocation per datum. This should especially impact records with many small fields.
- When reading strings we now use an unsafe cast to convert the underlying bytes into a string (like strings.Builder does). This avoids re-allocating and copying the entire content of the string, and will improve performance for string-intensive workloads.
v9.1.1
v9.1.1 fixes another issue with deserializing generic enums.
v9.1.0
v9.1.0 fixes an issue where generic deserialization did not support enums.
v9.0.0
v9.0.0 addresses a single bug in v8.0.0, where two unions with the same types in a different order resolve to the same Go type, which causes deserialization errors (#166).
In keeping with our versioning policy, because this fix changes the name of generated types, it's a breaking change and must be done in a major release.
v8.0.0
Major version 8.0.0 includes improvements to better conform to the Avro spec, as well as some user-requested quality-of-life changes:
The New<Type>
constructors for records set the default values for each field.
JSON deserialization better conforms to the Avro specification. This includes resolving aliases for JSON fields, fixing union type name encoding to be fully qualified, and setting fields to their default values when deserializing JSON data.
JSON encoding of bytes types is now correctly handled by using a custom Bytes type, which is an alias for []byte. Previously these fields serialized and deserialized using the Golang default encoding, which was base64. bytes are now serialized as a string of UTF escape sequences (ex. \u00fe) with one sequence per byte.
Similar to the above, the default value for fields with the bytes type is now correctly handled. Previously a codepoint above \u009f would be converted to their two byte UTF-8 encoding. We now correctly parse values like \u00fe as a single byte (254).
Aliases for fields and types are now resolved according to the specification - aliases in the reader schema are used to match writer names exclusively. Previously we would match fields or types if the writer aliases matched the reader name, or if a name within the same version of the schema matched the alias.
Deserialize convenience methods are now generated for unions to make it easier to parse data where the root type is a union.
The testing framework has been overhauled to provide better coverage for JSON encoding and schema evolution.