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

ASF subversion and git services commented on AVRO-3809:
-------------------------------------------------------

Commit b431018996e9b408cde18b9c603e318056bddb05 in avro's branch 
refs/heads/master from Andrea
[ https://gitbox.apache.org/repos/asf?p=avro.git;h=b43101899 ]

AVRO-3809: [Rust] Fix validate record reference with implicit namespace (#2374)

* Fix validate record reference with implicit namespace

* AVRO-3809: Add the ticket number to the test method

---------

Co-authored-by: Martin Grigorov <[email protected]>

> Faulty validation of a type reference with implicit nested namespace
> --------------------------------------------------------------------
>
>                 Key: AVRO-3809
>                 URL: https://issues.apache.org/jira/browse/AVRO-3809
>             Project: Apache Avro
>          Issue Type: Bug
>          Components: rust
>            Reporter: Andrea Vinci
>            Priority: Minor
>              Labels: pull-request-available
>          Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> The {{_validate_internal_}} function is not propagating schema's 
> sub-namespaces resulting in validation error of valid values.
> For example, it is not possible to set a value for the following schema even 
> though it is a valid one.
> The issue is that when Avro tries to validate the value for 
> {{_middle_field_2_}} it tries to resolve the reference 
> {{_inner_record_name_}} using the top level namespace 
> {{_space.inner_record_name_}} instead of 
> {{_middle_namespace.inner_record_name._}}
>  
> {code:json}
> {
>             "name": "record_name",
>             "namespace": "space",
>             "type": "record",
>             "fields": [
>               {
>                 "name": "outer_field_1",
>                 "type": {
>                   "type": "record",
>                   "name": "middle_record_name",
>                   "namespace": "middle_namespace",
>                   "fields": [
>                     {
>                       "name": "middle_field_1",
>                       "type": {
>                         "type": "record",
>                         "name": "inner_record_name",
>                         "fields": [
>                           { "name": "inner_field_1", "type": "double" }
>                         ]
>                       }
>                     },
>                     { "name": "middle_field_2", "type": "inner_record_name" }
>                   ]
>                 }
>               }
>             ]
>           }
> {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to