[ 
https://issues.apache.org/jira/browse/AVRO-2525?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17083815#comment-17083815
 ] 

Chris Hoffman commented on AVRO-2525:
-------------------------------------

The avro gem hides it very well (partly by calling it a schema validator when 
it's quite clearly a datum validator), but Avro::Schema::SchemaValidator will 
provide you that ActiveModel-style error message format you're looking for.

> Display field name when raising AvroTypeError
> ---------------------------------------------
>
>                 Key: AVRO-2525
>                 URL: https://issues.apache.org/jira/browse/AVRO-2525
>             Project: Apache Avro
>          Issue Type: Improvement
>          Components: ruby
>            Reporter: Mike Pan
>            Priority: Minor
>
> Currently, `"The datum #\{datum.inspect} is not an example of schema 
> #\{expected_schema}"` is displayed when `AvroTypeError` is raised.
> In the case that user will likely mistype the field name (typo or 
> upper-lower), `nil` will be displayed for `#\{datum.inspect}`. When there are 
> multiple fields mistyped, especially for a large schema initiative, it is 
> quite difficult to find out the mistyped field.
>  
> Expected: field name (or field path) is displayed



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to