README.md in avromatic-0.17.0 vs README.md in avromatic-0.17.1

- old
+ new

@@ -22,10 +22,13 @@ Or install it yourself as: $ gem install avromatic +See the [Logical Types](#logical-types) section below for details on using +Avromatic with unreleased Avro features. + ## Usage ### Configuration `Avromatic` supports the following configuration: @@ -45,10 +48,14 @@ names for models, that are added to `nested_models` at the end of `Avromatic.configure` and during code reloading in Rails applications. This option is useful for defining models that will be extended when the load order is important. +#### Custom Types + +See the section below on configuring [Custom Types](#custom-type-configuration). + #### Using a Schema Registry/Messaging API The configuration options below are required when using a schema registry (see [Confluent Schema Registry](http://docs.confluent.io/2.0.1/schema-registry/docs/intro.html)) and the [Messaging API](#messaging-api). @@ -67,11 +74,10 @@ the endpoint. * **messaging**: An `AvroTurf::Messaging` object to be shared by all generated models The `build_messaging!` method may be used to create a `Avromatic::Messaging` instance based on the other configuration values. * **logger**: The logger to use for the schema registry client. -* [Custom Types](#custom-types) Example using a schema registry: ```ruby Avromatic.configure do |config| @@ -201,12 +207,13 @@ config.eager_load_models = [ # reference any extended models that should be defined first MyNestedModel ] end +``` -#### Custom Types +#### Custom Type Configuration Custom types can be configured for fields of named types (record, enum, fixed). These customizations are registered on the `Avromatic` module. Once a custom type is registered, it is used for all models with a schema that references that type. It is recommended to register types within a block passed to `Avromatic.configure`: @@ -349,9 +356,26 @@ - The value for an enum type field is in the declared set of values. - Presence of a value for required fields. Empty arrays and maps are considered valid for required fields. - Validity of nested records, including records embedded in array, maps, and unions. + +### Logical Types + +Currently the official Apache Avro Ruby library does not support logical types ([AVRO-1695](https://issues.apache.org/jira/browse/AVRO-1695)). +That feature is in progress and will hopefully be merged soon. + +Avromatic supports logical types as implemented in the [pull request](https://github.com/apache/avro/pull/116) referenced in AVRO-1695. + +Until that change is included in the official library, you can +use [avro-salsify-fork gem](https://github.com/salsify/avro) which includes +the changes from the above pull request. + +To use this gem, reference it in your Gemfile: + +```ruby +gem 'avro-salsify-fork', require: 'avro' +```` ### Unsupported/Future The following types/features are not supported for generated models: