[
https://issues.apache.org/jira/browse/AVRO-4176?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18081306#comment-18081306
]
ASF subversion and git services commented on AVRO-4176:
-------------------------------------------------------
Commit 39d3ee9859e93323538a2857cc80a73862be8139 in avro's branch
refs/heads/branch-1.12 from Oscar Westra van Holthe - Kind
[ https://gitbox.apache.org/repos/asf?p=avro.git;h=39d3ee9859 ]
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
(cherry picked from commit 22f53c8c15e575165abdcd21f6f48efcdd4a33cd)
> 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)