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

Type union coercion fails when record types come before others #258

Open dacreify opened 4 years ago

dacreify commented 4 years ago

Summary

The match-clj? implementation on RecordType doesn't check if clj-map is actually a map, which it may not be if part of a type union.

Repro

  1. Go into jackdaw.serdes.avro-test/schema-type-test to the (testing "union" form
  2. In the avro-schema binding move record-1-schema so that it's the first element of the vector
  3. Run the test and observe that it fails