Skip to content

Releases: actgardner/gogen-avro

v10.2.1

16 Apr 20:20
Compare
Choose a tag to compare

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

11 Feb 19:07
Compare
Choose a tag to compare

This release includes one bug fix and one performance improvement:

  • #179 - Use fully qualified names for "fixed" fields to avoid collisions
  • #178 - Save an allocation by skipping the constructor for unions when the default value is null.

v10.1.1

03 Feb 02:46
14aa90d
Compare
Choose a tag to compare

Several minor bugfixes:

  • Fix newline characters in doc field - #177
  • Populate missing String ops - #175
  • Fix empty container creation - #173

v10.1.0

15 Oct 19:37
Compare
Choose a tag to compare

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

11 Oct 19:06
Compare
Choose a tag to compare

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

11 Oct 17:45
Compare
Choose a tag to compare

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

29 Sep 01:49
Compare
Choose a tag to compare

v9.1.1 fixes another issue with deserializing generic enums.

v9.1.0

12 Sep 20:05
Compare
Choose a tag to compare

v9.1.0 fixes an issue where generic deserialization did not support enums.

v9.0.0

27 Jun 16:20
Compare
Choose a tag to compare

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

08 May 20:21
Compare
Choose a tag to compare

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.