[
https://issues.apache.org/jira/browse/AVRO-4176?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Andy Coates updated AVRO-4176:
------------------------------
Description:
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
was:
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
> 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
> Priority: Major
>
> 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)