avro-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sean Busbey (JIRA)" <j...@apache.org>
Subject [jira] [Created] (AVRO-1989) Ruby schema validation for fixed types should use bytesize in error message
Date Sat, 28 Jan 2017 06:12:24 GMT
Sean Busbey created AVRO-1989:
---------------------------------

             Summary: Ruby schema validation for fixed types should use bytesize in error
message
                 Key: AVRO-1989
                 URL: https://issues.apache.org/jira/browse/AVRO-1989
             Project: Avro
          Issue Type: Bug
          Components: ruby
    Affects Versions: 1.9.0
            Reporter: Sean Busbey
            Assignee: Sean Busbey
            Priority: Minor
             Fix For: 1.9.0


>From AVRO-1886:

I'd like to get one thing improved, but it's fine as a follow-on.
{code}
 +       when :fixed
 +          if datum.is_a? String
 +            message = "expected fixed with size #{expected_schema.size}, got \"#{datum}\"
with size #{datum.size}"
 +            result.add_error(path, message) unless datum.bytesize == expected_schema.size
 +          else
 +            result.add_error(path, "expected fixed with size #{expected_schema.size}, got
#{actual_value_message(datum)}")
 +          end
{code}
the message here should use datum.bytesize instead of datum.size.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message