KitFieldhouse opened a new issue, #531:
URL: https://github.com/apache/avro-rs/issues/531
Hey all!
This implementation allows us to parse a schema of the form:
```
{
"type": {
....some correct schema here
}
}
```
for instance, in this implementation, we can parse
```
{
"type": {
"type": "enum",
"name": "testEnum",
"symbols": ["A","B","C"]
}
}
```
however, in the Java implementation this fails with:
```
No type: {"type":{"type":"enum","name":"testEnum","symbols":["A","B","C"]}}
```
From the [spec](https://avro.apache.org/docs/++version++/specification/) :
> A Schema is represented in [JSON](https://www.json.org/) by one of:
>
> - A JSON string, naming a defined type.
> - A JSON object, of the form:
>
>{"type": "typeName", ...attributes...}
>
>where typeName is either a primitive or derived type name, as defined
below. Attributes not defined in this document are permitted as metadata, but
must not affect the format of serialized data.
>
> - A JSON array, representing a union of embedded types.
which, in my reading, makes it clear that when we are inside a JSON object
as a schema, "type" can only be a string that equals a type name.
What seems to be vague in the specification is if this type name should only
be allowed to be a built-in type name or if user defined type names are
allowed. My belief is that the rational option is to only allow built-in type
names. I opened a [Jira issue](https://issues.apache.org/jira/browse/AVRO-4243)
about this ambiguity in the spec.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]