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

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

Commit 22f53c8c15e575165abdcd21f6f48efcdd4a33cd in avro's branch 
refs/heads/main from Oscar Westra van Holthe - Kind
[ https://gitbox.apache.org/repos/asf?p=avro.git;h=22f53c8c15 ]

AVRO-4176: Java parser allows field type to be object with custom type (#3772)

* AVRO-4176: Disallow named type alteration

The test cases for self reference unions contained a bug that seemed to
make the parsing bug necessary.

* AVRO-4176: Add test

> Java parser allows field type to be object with custom type
> -----------------------------------------------------------
>
>                 Key: AVRO-4176
>                 URL: https://issues.apache.org/jira/browse/AVRO-4176
>             Project: Apache Avro
>          Issue Type: Bug
>          Components: java
>    Affects Versions: 1.12.0
>            Reporter: Andy Coates
>            Assignee: Oscar Westra van Holthe - Kind
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> I _think_ the Java implementation of the parser is allowing an invalid field 
> definition to be parsed.  The Python parser rejects it.
> For example, consider the following field definition (which would be part of 
> the `fields` array in a `record` type):
>  
> ```
> {
> {{  "type: {}}
> {{    "type": "SomeCustomType"}}
>    }
> {{}}}
> ```
>  
> As I understand it, the above is invalid as the outer `type` can be an 
> object, but that object must have a `type` that is one of the built in types, 
> not a custom type.
> The Java parser does reject double nesting, e.g.
>  
> ```
> {
> {{  "type: {}}
>           "type": \{ "type": "SomeCustomType" }
>    }
> {{}}}
> ```
>  
> If I'm correct and these are all invalid, then the issue with the Java Parser 
> allowing them is it allows invalid schemas to be published (e.g. to the 
> Confluent Schema Registry, written in Java), which other language parsers 
> will reject, causing issues with x-platform compatibility.
> Note: I did try to find an existing bug, but being unsure of the search terms 
> to use for this, I couldn't find one



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

Reply via email to