FasterXML/jackson-dataformat-avro — pull request #14 by joshng (2014-11-14 07:26:43+00:00)
Title: Support serializing "fixed" fields

Hi again, Tatu/multifarious/FasterXML!

I simply added a check for Schema.Type.Fixed in ObjectWriteContext, and massaged the object passed to GenericRecord as needed. Note that I suspect similar adjustments may be necessary for maps/arrays/etc, but I haven't had time to look into it. Perhaps there's a more natural way to do this?

Beyond that, there's one meaningful change to existing functionality here: it appeared to me that AvroGenerator.writeBinary() was unnecessarily copying the byte[] prior to wrapping it in a ByteBuffer, so I removed this copy.

There's still work to do to add AvroSchemaGenerator support for fixed fields from POJO... This would be a great addition! As we discussed, this will likely involve additional annotation support, so feels beyond my comfort-zone to try to tackle for now.

Finally, apologies for the spurious 'import' reformatting; intellij is quite opinionated, and I didn't feel motivated try to reconfigure tonight. :-P

Hope this helps!