[
https://issues.apache.org/jira/browse/AVRO-3130?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17539479#comment-17539479
]
ASF subversion and git services commented on AVRO-3130:
-------------------------------------------------------
Commit 41360a669e63354b52c15202ef8c28670275cb74 in avro's branch
refs/heads/avro-3130-parse-anonymous-union-type from Martin Tzvetanov Grigorov
[ https://gitbox.apache.org/repos/asf?p=avro.git;h=41360a669 ]
AVRO-3130: Rust: Add a unit test demonstrating that the schema could be parsed
successfully
To prevent regressions in the future
Signed-off-by: Martin Tzvetanov Grigorov <[email protected]>
> Schema.java errors with "No type" when a type object is provided instead of
> text type
> -------------------------------------------------------------------------------------
>
> Key: AVRO-3130
> URL: https://issues.apache.org/jira/browse/AVRO-3130
> Project: Apache Avro
> Issue Type: Bug
> Components: java
> Reporter: Aaron Zinger
> Priority: Minor
>
> When a schema object is provided inside a union or as an array items type,
> the parser looks for a text value for type, doesn't find it, and throws a
> confusing error message of the form "No type: <thing with a type>".
> The error message could be fixed by having GetRequiredText distinguish
> between the key not being present and the value not being text, with the
> latter returning a message like "Value for type must be string".
> However, my preferred change would be to handle schema objects in these
> situations--it seems like it'd be compliant with the spec to have {"type":
> "string"} resolve to "string", and it would let schema generation code be a
> little simpler by letting it reuse schemas. This could also address
> https://issues.apache.org/jira/browse/AVRO-1977, I think.
> Examples below.
> {code:json}
> {
> "type": "record",
> "name": "AccountEvent",
> "fields": [
> {"type":
> ["null",
> { "name": "accountList",
> "type": {
> "type": "array",
> "items": "long"
> }
> }
> ],
> "name":"NullableLongArray"
> }
> ]
> }
> {code}
> Fails with {code:java}"No type:
> {\"name\":\"accountList\",\"type\":{\"type\":\"array\",\"items\":\"long\"}}"{code}
> The error is similar for
> {code:json}
> {
> "type": "array",
> "name": "FavoriteNumbers",
> "items": {"type":{"type": ["null","long"], "name": "NullableNumber"}}
> }
> {code}
--
This message was sent by Atlassian Jira
(v8.20.7#820007)