[
https://issues.apache.org/jira/browse/AVRO-3709?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17686472#comment-17686472
]
ASF subversion and git services commented on AVRO-3709:
-------------------------------------------------------
Commit a512fa2fdf1b370548446e83ac48b9db52e04275 in avro's branch
refs/heads/avro-3646-serde-for-enum-mixed-variants from Martin Grigorov
[ https://gitbox.apache.org/repos/asf?p=avro.git;h=a512fa2fd ]
AVRO-3709: [Rust] Add aliases to record fields (#2087)
* AVRO-3709: [Rust] Add 'aliases' field to RecordField
Signed-off-by: Martin Tzvetanov Grigorov <[email protected]>
* AVRO-3709: [Rust] Add support for serializing RecordField's aliases
Signed-off-by: Martin Tzvetanov Grigorov <[email protected]>
* AVRO-3709: [Rust] Record field's aliases don't have namespace
Use String instead of Alias.
Signed-off-by: Martin Tzvetanov Grigorov <[email protected]>
* AVRO-3709: [Rust] Add support for field aliases in avro_derive
Signed-off-by: Martin Tzvetanov Grigorov <[email protected]>
---------
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: pull-request-available, rust
> Fix For: 1.12.0, 1.11.2
>
> Time Spent: 1h 20m
> Remaining Estimate: 0h
>
> 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)