Skip to content

v2.0.0

Compare
Choose a tag to compare
@davydog187 davydog187 released this 08 Mar 17:46
· 13 commits to master since this release
7204579

v2.0.0 - March 8th, 2022

Documentation
Blog Post

Changed

  • AvroEx.encode/2 now returns {:error, AvroEx.EncodeError.t()} in the case of an error
  • Primitive integer types now represented as %Primitive{type: :int} instead of %Primitive{type: :integer}
  • Primitive null types now represented as %Primitive{type: :null} instead of %Primitive{type: nil}
  • Schema decoding now supports directly passing Elixir terms, will strictly validate the schema, and produce helpful error messages
  • Removed Ecto as a dependency
  • AvroEx.Schema.full_name/2 - reverses the order of the arguments, accepting a Schema type or name, followed by the namespace

Added

  • AvroEx.encode!/2 - identical to encode/2, but returns raw value. Raises on error
  • AvroEx.decode!/2 - identical to decode/2, but returns raw value. Raises on error
  • AvroEx.decode_schema/1 and AvroEx.decode_schema!/ in place of AvroEx.parse_schema/1
  • Support for encoding and decoding date logical times to and from Date.t()
  • Schema decoding adds a :strict option that will strictly validate the schema for unrecognized fields
  • AvroEx.encode_schema/2 - encode a AvroEx.Schema.t() back to JSON. Supports encoding the schema to Parsing Canonical Form
  • AvroEx.Schema.namespace/2 - Returns the namespace of the given Schema type

Deprecated

  • AvroEx.parse_schema/1
  • AvroEx.parse_schema!/1
  • AvroEx.named_type!/2