You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@avro.apache.org by dk...@apache.org on 2018/12/20 20:57:22 UTC
[avro] branch branch-1.8 updated: [FIX] Support applying default
null when map exists in schema and not in encoded data (#403)
This is an automated email from the ASF dual-hosted git repository.
dkulp pushed a commit to branch branch-1.8
in repository https://gitbox.apache.org/repos/asf/avro.git
The following commit(s) were added to refs/heads/branch-1.8 by this push:
new a18b35e [FIX] Support applying default null when map exists in schema and not in encoded data (#403)
a18b35e is described below
commit a18b35e7d284ecd50c353a93e2ac56894b4ff885
Author: Oded Zahavi <od...@fiverr.com>
AuthorDate: Thu Dec 20 22:57:18 2018 +0200
[FIX] Support applying default null when map exists in schema and not in encoded data (#403)
---
lang/ruby/lib/avro/schema.rb | 1 +
1 file changed, 1 insertion(+)
diff --git a/lang/ruby/lib/avro/schema.rb b/lang/ruby/lib/avro/schema.rb
index 8e345e3..e77ec43 100644
--- a/lang/ruby/lib/avro/schema.rb
+++ b/lang/ruby/lib/avro/schema.rb
@@ -115,6 +115,7 @@ module Avro
datum.is_a?(Array) &&
datum.all?{|d| validate(expected_schema.items, d) }
when :map
+ datum.is_a?(Hash) &&
datum.keys.all?{|k| k.is_a? String } &&
datum.values.all?{|v| validate(expected_schema.values, v) }
when :union