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

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

Commit eb552f9d28744f93d56d7c6fc2697cf992c2ab4e in avro's branch 
refs/heads/avro-3709-add-aliases-to-record-fields from Martin Tzvetanov Grigorov
[ https://gitbox.apache.org/repos/asf?p=avro.git;h=eb552f9d2 ]

AVRO-3709: [Rust] Record field's aliases don't have namespace

Use String instead of Alias.

Signed-off-by: Martin Tzvetanov Grigorov <[email protected]>


> [Rust] Add aliases to RecordField
> ---------------------------------
>
>                 Key: AVRO-3709
>                 URL: https://issues.apache.org/jira/browse/AVRO-3709
>             Project: Apache Avro
>          Issue Type: Improvement
>          Components: rust
>    Affects Versions: 1.11.1
>            Reporter: Santiago Fraire Willemoes
>            Assignee: Martin Tzvetanov Grigorov
>            Priority: Minor
>              Labels: rust
>
> Hello everyone, I'm working on an [avdl parser for 
> rust|https://github.com/woile/avdl-rs] and I'm having an issue with the lack 
> of aliases on the `RecordField`.
> For an Avdl like this:
> {code:java}
> protocol MyProtocol {
>     record Hello {
>         string @aliases(["nickname"]) name;
>     }
> }
> {code}
> The schema is rendered as:
> {code:java}
> {
>   "type" : "record",
>   "name" : "Hello",
>   "fields" : [ {
>     "name" : "name",
>     "type" : "string",
>     "aliases" : [ "nickname" ]
>   } ]
> }
> {code}
> But when I generate the schema on rust using the `RecordField`, it doesn't 
> have aliases. 
> See 
> [https://github.com/apache/avro/blob/master/lang/rust/avro/src/schema.rs#L559-L580]
> And even if I use `custom_attributes` with aliases, when generating the 
> schema using `schema.canonical_form()`, they don't appear.
> The `RecordField` has `custom_attributes` for unknown fields but aliases are 
> known. See documentation here:
> [https://avro.apache.org/docs/1.11.1/idl-language/#other-language-features]
> The interesting thing is that the Specification doesn't mention aliases in a 
> RecordField, but they are used widely everywhere.
> I would be willing to submit a PR, not sure if there's another reason for the 
> lack of aliases that I'm missing.
> I would also like to ask for advice, is the Schema supposed to be used to 
> generate a json schema? or is it solely for deserializing a json schema? 
> Should I create a fork of it? I find it strange that it implements serde's 
> serialize but it doesn't fully serialize all the attributes.
> Thanks a lot.



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

Reply via email to