FundingCircle / jackdaw

A Clojure library for the Apache Kafka distributed streaming platform.
https://fundingcircle.github.io/jackdaw/
BSD 3-Clause "New" or "Revised" License
369 stars 80 forks source link

[WB-66] Fix avro union serialisation #226

Closed DaveWM closed 4 years ago

DaveWM commented 4 years ago

When serialising a clojure map to an avro record with a union type schema, the avro serialisation will pick the wrong union type member, and then the serialisation will fail (I'll post a message in slack with more detail). I think the root cause of this is that the match-clj? method isn't strict enough for enums and records. I've therefore made this more strict, which fixes the union type serialisation.

Checklist

codecov[bot] commented 4 years ago

Codecov Report

Merging #226 into master will increase coverage by 0.34%. The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #226      +/-   ##
==========================================
+ Coverage   79.74%   80.09%   +0.34%     
==========================================
  Files          42       42              
  Lines        2622     2627       +5     
  Branches      151      152       +1     
==========================================
+ Hits         2091     2104      +13     
+ Misses        380      371       -9     
- Partials      151      152       +1     
Impacted Files Coverage Δ
src/jackdaw/serdes/edn2.clj 90.90% <0.00%> (+45.45%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 9bbf58b...5c870ca. Read the comment docs.